Search in sources :

Example 1 with CompoundTagImpl

use of com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.

the class ImprovedOfflinePlayerImpl method setInventory.

@Override
public void setInventory(org.bukkit.inventory.PlayerInventory inventory) {
    CraftInventoryPlayer inv = (CraftInventoryPlayer) inventory;
    NBTTagCompound nbtTagCompound = ((CompoundTagImpl) compound).toNMSTag();
    nbtTagCompound.set("Inventory", inv.getInventory().a(new NBTTagList()));
    this.compound = CompoundTagImpl.fromNMSTag(nbtTagCompound);
    if (this.autosave) {
        savePlayerData();
    }
}
Also used : CraftInventoryPlayer(org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryPlayer) CompoundTagImpl(com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl)

Example 2 with CompoundTagImpl

use of com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.

the class ImprovedOfflinePlayerImpl method getEnderChest.

@Override
public Inventory getEnderChest() {
    if (offlineEnderChests.containsKey(getUniqueId())) {
        return offlineEnderChests.get(getUniqueId());
    }
    InventoryEnderChest endchest = new InventoryEnderChest(null);
    endchest.a(((CompoundTagImpl) this.compound).toNMSTag().getList("EnderItems", 10));
    org.bukkit.inventory.Inventory inv = new CraftInventory(endchest);
    offlineEnderChests.put(getUniqueId(), inv);
    return inv;
}
Also used : CraftInventory(org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory) Inventory(org.bukkit.inventory.Inventory) CompoundTagImpl(com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl)

Example 3 with CompoundTagImpl

use of com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.

the class ImprovedOfflinePlayerImpl method getAttributes.

private AttributeMap getAttributes() {
    AttributeMap amb = new AttributeMap(DefaultAttributes.getSupplier(net.minecraft.world.entity.EntityType.PLAYER));
    amb.load(((CompoundTagImpl) this.compound).toNMSTag().getList("Attributes", 10));
    return amb;
}
Also used : AttributeMap(net.minecraft.world.entity.ai.attributes.AttributeMap) CompoundTagImpl(com.denizenscript.denizen.nms.v1_17.impl.jnbt.CompoundTagImpl)

Example 4 with CompoundTagImpl

use of com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.

the class ImprovedOfflinePlayerImpl method getEnderChest.

@Override
public Inventory getEnderChest() {
    if (offlineEnderChests.containsKey(getUniqueId())) {
        return offlineEnderChests.get(getUniqueId());
    }
    PlayerEnderChestContainer endchest = new PlayerEnderChestContainer(null);
    endchest.fromTag(((CompoundTagImpl) this.compound).toNMSTag().getList("EnderItems", 10));
    org.bukkit.inventory.Inventory inv = new CraftInventory(endchest);
    offlineEnderChests.put(getUniqueId(), inv);
    return inv;
}
Also used : PlayerEnderChestContainer(net.minecraft.world.inventory.PlayerEnderChestContainer) CraftInventory(org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventory) Inventory(org.bukkit.inventory.Inventory) CompoundTagImpl(com.denizenscript.denizen.nms.v1_17.impl.jnbt.CompoundTagImpl)

Example 5 with CompoundTagImpl

use of com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl in project Denizen-For-Bukkit by DenizenScript.

the class PacketHelperImpl method showTileEntityData.

@Override
public void showTileEntityData(Player player, Location location, int action, CompoundTag compoundTag) {
    BlockPos position = new BlockPos(location.getX(), location.getY(), location.getZ());
    send(player, new ClientboundBlockEntityDataPacket(position, action, ((CompoundTagImpl) compoundTag).toNMSTag()));
}
Also used : BlockPos(net.minecraft.core.BlockPos) CompoundTagImpl(com.denizenscript.denizen.nms.v1_17.impl.jnbt.CompoundTagImpl)

Aggregations

CompoundTagImpl (com.denizenscript.denizen.nms.v1_17.impl.jnbt.CompoundTagImpl)4 CompoundTagImpl (com.denizenscript.denizen.nms.v1_18.impl.jnbt.CompoundTagImpl)4 Inventory (org.bukkit.inventory.Inventory)3 CompoundTagImpl (com.denizenscript.denizen.nms.v1_16.impl.jnbt.CompoundTagImpl)2 BlockPos (net.minecraft.core.BlockPos)2 ListTag (net.minecraft.nbt.ListTag)2 AttributeMap (net.minecraft.world.entity.ai.attributes.AttributeMap)2 PlayerEnderChestContainer (net.minecraft.world.inventory.PlayerEnderChestContainer)2 CraftInventory (org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventory)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_16_R3.inventory.CraftInventoryPlayer)1 CraftInventory (org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventory)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventoryPlayer)1 CraftInventory (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventory)1 CraftInventoryPlayer (org.bukkit.craftbukkit.v1_18_R1.inventory.CraftInventoryPlayer)1