Search in sources :

Example 1 with TileEntityChest

use of net.minecraft.server.v1_15_R1.TileEntityChest in project solinia3-core by mixxit.

the class PatchUtils method listToInventory.

public Inventory listToInventory(NBTTagList nbttaglist) {
    TileEntityChest tileentitychest = new TileEntityChest();
    for (int i = 0; i < nbttaglist.size(); i++) {
        NBTTagCompound nbttagcompound = (NBTTagCompound) nbttaglist.get(i);
        int j = nbttagcompound.getByte("Slot") & 0xFF;
        if (j >= 0 && j < 27) {
            tileentitychest.setItem(j, net.minecraft.server.v1_15_R1.ItemStack.a(nbttagcompound));
        }
    }
    return new CraftInventory(tileentitychest);
}
Also used : CraftInventory(org.bukkit.craftbukkit.v1_15_R1.inventory.CraftInventory) TileEntityChest(net.minecraft.server.v1_15_R1.TileEntityChest) NBTTagCompound(net.minecraft.server.v1_15_R1.NBTTagCompound)

Aggregations

NBTTagCompound (net.minecraft.server.v1_15_R1.NBTTagCompound)1 TileEntityChest (net.minecraft.server.v1_15_R1.TileEntityChest)1 CraftInventory (org.bukkit.craftbukkit.v1_15_R1.inventory.CraftInventory)1