Ejemplo n.º 1
0
  public void readFromNBT(NBTTagCompound tagCompound) {
    if (tagCompound != null) {
      NBTTagList tagList = tagCompound.getTagList("Inventory", 10);
      for (int i = 0; i < tagList.tagCount(); ++i) {
        NBTTagCompound nbttagcompound = (NBTTagCompound) tagList.getCompoundTagAt(i);
        int j = nbttagcompound.getByte("Slot") & 255;
        ItemStack itemstack = ItemStack.loadItemStackFromNBT(nbttagcompound);

        if (itemstack != null) {
          this.inventory[j] = itemstack;
        }
      }
    }
  }