Exemplo n.º 1
0
  @Override
  public void readFromNBT(NBTTagCompound nbtTagCompound) {

    super.readFromNBT(nbtTagCompound);
    NBTTagList tagList = nbtTagCompound.getTagList("Inventory", 10);
    inv = new ItemStack[this.getSizeInventory()];
    for (int i = 0; i < tagList.tagCount(); ++i) {
      NBTTagCompound tagCompound = (NBTTagCompound) tagList.getCompoundTagAt(i);
      byte slot = tagCompound.getByte("Slot");
      if (slot >= 0 && slot < inv.length) {
        inv[slot] = ItemStack.loadItemStackFromNBT(tagCompound);
      }
    }
  }