@Override
 public void writeCustomNBT(NBTTagCompound nbt, boolean descPacket) {
   super.writeCustomNBT(nbt, descPacket);
   nbt.setInteger("facing", facing);
   NBTTagCompound tankTag = tank0.writeToNBT(new NBTTagCompound());
   nbt.setTag("tank0", tankTag);
   tankTag = tank1.writeToNBT(new NBTTagCompound());
   nbt.setTag("tank1", tankTag);
   tankTag = tank2.writeToNBT(new NBTTagCompound());
   nbt.setTag("tank2", tankTag);
   energyStorage.writeToNBT(nbt);
   if (!descPacket) {
     nbt.setTag("inventory", Utils.writeInventory(inventory));
   }
 }
  @Override
  public void writeToNBT(NBTTagCompound nbtTags) {
    super.writeToNBT(nbtTags);

    if (fluidTank.getFluid() != null) {
      nbtTags.setTag("fluidTank", fluidTank.writeToNBT(new NBTTagCompound()));
    }

    NBTTagList recurringList = new NBTTagList();

    for (Object3D wrapper : recurringNodes) {
      NBTTagCompound tagCompound = new NBTTagCompound();
      wrapper.write(tagCompound);
      recurringList.appendTag(tagCompound);
    }

    if (recurringList.tagCount() != 0) {
      nbtTags.setTag("recurringNodes", recurringList);
    }

    NBTTagList cleaningList = new NBTTagList();

    for (Object3D obj : cleaningNodes) {
      cleaningList.appendTag(obj.write(new NBTTagCompound()));
    }

    if (cleaningList.tagCount() != 0) {
      nbtTags.setTag("cleaningNodes", cleaningList);
    }
  }
  @Override
  public void writeToNBT(NBTTagCompound nbtTags) {
    super.writeToNBT(nbtTags);

    nbtTags.setBoolean("finishedCalc", finishedCalc);

    if (fluidTank.getFluid() != null) {
      nbtTags.setTag("fluidTank", fluidTank.writeToNBT(new NBTTagCompound()));
    }

    NBTTagList activeList = new NBTTagList();

    for (Coord4D wrapper : activeNodes) {
      NBTTagCompound tagCompound = new NBTTagCompound();
      wrapper.write(tagCompound);
      activeList.appendTag(tagCompound);
    }

    if (activeList.tagCount() != 0) {
      nbtTags.setTag("activeNodes", activeList);
    }

    NBTTagList usedList = new NBTTagList();

    for (Coord4D obj : usedNodes) {
      activeList.appendTag(obj.write(new NBTTagCompound()));
    }

    if (activeList.tagCount() != 0) {
      nbtTags.setTag("usedNodes", usedList);
    }
  }
  @Override
  public void writeToNBT(NBTTagCompound nbtTags) {
    super.writeToNBT(nbtTags);

    if (lavaTank.getFluid() != null) {
      nbtTags.setTag("lavaTank", lavaTank.writeToNBT(new NBTTagCompound()));
    }
  }
 @Override
 public void writeToNBT(NBTTagCompound nbt) {
   super.writeToNBT(nbt);
   NBTTagCompound tankTag = new NBTTagCompound();
   tank.writeToNBT(tankTag);
   nbt.setTag("tank", tankTag);
   nbt.setInteger("prev", prevAmount);
   nbt.setInteger("colour", colour);
 }
  private static void saveTank(ItemStack container, FluidTank tank) {
    if (tank.getFluidAmount() > 0) {
      NBTTagCompound itemTag = ItemUtils.getItemTag(container);

      NBTTagCompound tankTag = new NBTTagCompound();
      tank.writeToNBT(tankTag);
      itemTag.setTag(TANK_TAG, tankTag);
    } else {
      container.stackTagCompound = null;
    }
  }
  @Override
  public NBTTagCompound writeToNBT(NBTTagCompound nbtTags) {
    super.writeToNBT(nbtTags);

    nbtTags.setInteger("tier", tier.ordinal());
    nbtTags.setBoolean("isActive", isActive);
    nbtTags.setInteger("editMode", editMode.ordinal());

    if (fluidTank.getFluid() != null) {
      nbtTags.setTag("fluidTank", fluidTank.writeToNBT(new NBTTagCompound()));
    }

    return nbtTags;
  }
  @Override
  public void writeCustomNBT(NBTTagCompound nbt, boolean descPacket) {
    super.writeCustomNBT(nbt, descPacket);
    nbt.setInteger("facing", facing);
    energyStorage.writeToNBT(nbt);

    NBTTagCompound tankTag = tank.writeToNBT(new NBTTagCompound());
    nbt.setTag("tank", tankTag);

    nbt.setTag("inventory", Utils.writeInventory(inventory));

    nbt.setTag("predictedOutput", Utils.writeInventory(predictedOutput));

    nbt.setIntArray("process", process);
  }
  @Override
  public void writeToNBT(NBTTagCompound tag) {
    super.writeToNBT(tag);

    tag.setBoolean("formed", isFormed());

    if (isFormed()) {
      tag.setDouble("plasmaTemp", getReactor().getPlasmaTemp());
      tag.setDouble("caseTemp", getReactor().getCaseTemp());
      tag.setInteger("injectionRate", getReactor().getInjectionRate());
      tag.setBoolean("burning", getReactor().isBurning());
    } else {
      tag.setDouble("plasmaTemp", 0);
      tag.setDouble("caseTemp", 0);
      tag.setInteger("injectionRate", 0);
      tag.setBoolean("burning", false);
    }

    tag.setTag("fuelTank", fuelTank.write(new NBTTagCompound()));
    tag.setTag("deuteriumTank", deuteriumTank.write(new NBTTagCompound()));
    tag.setTag("tritiumTank", tritiumTank.write(new NBTTagCompound()));
    tag.setTag("waterTank", waterTank.writeToNBT(new NBTTagCompound()));
    tag.setTag("steamTank", steamTank.writeToNBT(new NBTTagCompound()));
  }
  @Override
  public void writeToNBT(NBTTagCompound tagCompound) {
    super.writeToNBT(tagCompound);

    tagCompound.setInteger("tier", getTier());
    if (tank != null) {
      NBTTagCompound inventoryCompound = new NBTTagCompound();
      tank.writeToNBT(inventoryCompound);
      tagCompound.setTag("tank", inventoryCompound);
    }

    tagCompound.setInteger("facing", facing.ordinal());

    tagCompound.setInteger("lavaUsage", lavaUsage);
    tagCompound.setBoolean("isRunning", isRunning);
  }
 @Override
 public NBTTagCompound writeToNBT(NBTTagCompound tag) {
   super.writeToNBT(tag);
   tag.setTag("tank", tank.writeToNBT(new NBTTagCompound()));
   NBTTagList list = new NBTTagList();
   for (int i = 0; i < stack.length; i++) {
     if (stack[i] != null) {
       NBTTagCompound t = new NBTTagCompound();
       stack[i].writeToNBT(t);
       t.setByte("Slot", (byte) i);
       list.appendTag(t);
     }
   }
   tag.setTag("inventory", list);
   tag.setInteger("progress", progress);
   return tag;
 }
Beispiel #12
0
  public void writeToNBT(NBTTagCompound par1NBTTagCompound) {
    super.writeToNBT(par1NBTTagCompound);
    NBTTagList nbttaglist = new NBTTagList();

    for (int i = 0; i < this.inv.length; ++i) {
      if (this.inv[i] != null) {
        NBTTagCompound nbttagcompound1 = new NBTTagCompound();
        nbttagcompound1.setByte("Slot", (byte) i);
        this.inv[i].writeToNBT(nbttagcompound1);
        nbttaglist.appendTag(nbttagcompound1);
      }
    }
    par1NBTTagCompound.setTag("Items", nbttaglist);
    lava.writeToNBT(par1NBTTagCompound);
    par1NBTTagCompound.setInteger("Heat", heat);
    par1NBTTagCompound.setInteger("Pro", progress);
  }
  @Override
  public void writeToNBT(NBTTagCompound tag) {

    super.writeToNBT(tag);

    NBTTagList tagList = new NBTTagList();
    for (int currentIndex = 0; currentIndex < inventory.length; ++currentIndex) {
      if (inventory[currentIndex] != null) {
        NBTTagCompound tagCompound = new NBTTagCompound();
        tagCompound.setByte("Slot", (byte) currentIndex);
        inventory[currentIndex].writeToNBT(tagCompound);
        tagList.appendTag(tagCompound);
      }
    }
    tag.setTag("Items", tagList);

    NBTTagCompound tankTag = new NBTTagCompound();
    tank.writeToNBT(tankTag);
    tag.setTag("tank", tankTag);

    NBTTagList droneItems = new NBTTagList();
    for (int currentIndex = 0; currentIndex < getDroneSlots(); ++currentIndex) {
      if (getFakePlayer().inventory.getStackInSlot(currentIndex) != null) {
        NBTTagCompound tagCompound = new NBTTagCompound();
        tagCompound.setByte("Slot", (byte) currentIndex);
        getFakePlayer().inventory.getStackInSlot(currentIndex).writeToNBT(tagCompound);
        droneItems.appendTag(tagCompound);
      }
    }
    tag.setTag("droneItems", droneItems);

    NBTTagList extendedList = new NBTTagList();
    for (Map.Entry<String, IExtendedEntityProperties> entry : properties.entrySet()) {
      NBTTagCompound propertyTag = new NBTTagCompound();
      propertyTag.setString("key", entry.getKey());
      entry.getValue().saveNBTData(propertyTag);
      extendedList.appendTag(propertyTag);
    }
    tag.setTag("extendedProperties", extendedList);
  }
 @Override
 public void writeCustomNBT(NBTTagCompound nbt, boolean descPacket) {
   super.writeCustomNBT(nbt, descPacket);
   NBTTagCompound tankTag = tank.writeToNBT(new NBTTagCompound());
   nbt.setTag("tank", tankTag);
 }