Exemplo n.º 1
0
  @Override
  public NBTTagCompound writeToNBT(NBTTagCompound tagCompound) {
    super.writeToNBT(tagCompound);
    NBTTagList itemList = new NBTTagList();
    for (int i = 0; i < this.chestContents.length; i++) {
      ItemStack stack = this.chestContents[i];
      if (stack != null) {
        NBTTagCompound tag = new NBTTagCompound();
        tag.setByte("Slot", (byte) i);
        stack.writeToNBT(tag);
        itemList.appendTag(tag);
      }
    }
    tagCompound.setTag("Inventory", itemList);
    tagCompound.setString("Spinning", spinning);

    return tagCompound;
  }