public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); woodType = nbttagcompound.getByte("woodType"); NBTTagList nbttaglist = nbttagcompound.getTagList("Items"); storage = new ItemStack[getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); i++) { NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i); byte byte0 = nbttagcompound1.getByte("Slot"); if (byte0 >= 0 && byte0 < storage.length) { storage[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } }
public void readFromNBT(NBTTagCompound nbttagcompound) { super.readFromNBT(nbttagcompound); // timeleft = nbttagcompound.getInteger("timeleft"); NBTTagList nbttaglist = nbttagcompound.getTagList("Items"); metalItemStacks = new ItemStack[getSizeInventory()]; for (int i = 0; i < nbttaglist.tagCount(); i++) { NBTTagCompound nbttagcompound1 = (NBTTagCompound) nbttaglist.tagAt(i); byte byte0 = nbttagcompound1.getByte("Slot"); if (byte0 >= 0 && byte0 < metalItemStacks.length) { metalItemStacks[byte0] = ItemStack.loadItemStackFromNBT(nbttagcompound1); } } }