コード例 #1
0
  @Override
  public void writeToNBT(NBTTagCompound nbttagcompound) {
    super.writeToNBT(nbttagcompound);

    NBTTagList nbtTagList = new NBTTagList();
    for (int i = 0; i < this.inventory.length; i++) {
      if (this.inventory[i] != null) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setByte("Slot", (byte) i);
        this.inventory[i].writeToNBT(nbttagcompound1);
        nbtTagList.appendTag(nbttagcompound1);
      }
    }

    nbttagcompound.setTag("Items", nbtTagList);
  }
コード例 #2
0
 public void writeToNBT(NBTTagCompound nbttagcompound) {
   super.writeToNBT(nbttagcompound);
   NBTTagList nbttaglist = new NBTTagList();
   nbttagcompound.setInteger("storage", this.storage);
   nbttagcompound.setInteger("lastX", this.lastX);
   nbttagcompound.setInteger("lastY", this.lastY);
   nbttagcompound.setInteger("lastZ", this.lastZ);
   for (int i = 0; i < this.chargeSlots.length; ++i) {
     if (this.chargeSlots[i] != null) {
       NBTTagCompound nbttagcompound1 = new NBTTagCompound();
       nbttagcompound1.setByte("Slot", (byte) i);
       this.chargeSlots[i].writeToNBT(nbttagcompound1);
       nbttaglist.appendTag(nbttagcompound1);
     }
   }
   nbttagcompound.setTag("Items", nbttaglist);
 }
コード例 #3
0
 @Override
 public void writeToNBT(NBTTagCompound tagCompound) {
   super.writeToNBT(tagCompound);
   NBTTagList itemList = new NBTTagList();
   for (int i = 0; i < inv.length; i++) {
     ItemStack stack = inv[i];
     if (stack != null) {
       NBTTagCompound tag = new NBTTagCompound();
       tag.setByte("Slot", (byte) i);
       stack.writeToNBT(tag);
       itemList.appendTag(tag);
     }
   }
   tagCompound.setTag("Inventory", itemList);
   tagCompound.setInteger("waitTime", this.waitTime);
   tagCompound.setInteger("storage", this.storage);
   tagCompound.setInteger("production", this.production);
 }