コード例 #1
0
 @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));
   }
 }
コード例 #2
0
  @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);
    }
  }
コード例 #3
0
  @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);
    }
  }
コード例 #4
0
  @Override
  public void writeToNBT(NBTTagCompound nbtTags) {
    super.writeToNBT(nbtTags);

    if (lavaTank.getFluid() != null) {
      nbtTags.setTag("lavaTank", lavaTank.writeToNBT(new NBTTagCompound()));
    }
  }
コード例 #5
0
 @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);
 }
コード例 #6
0
  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;
    }
  }
コード例 #7
0
  @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;
  }
コード例 #8
0
  @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);
  }
コード例 #9
0
  @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()));
  }
コード例 #10
0
  @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);
  }
コード例 #11
0
 @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;
 }
コード例 #12
0
ファイル: Melter.java プロジェクト: Robbi-Blechdose/BaconMod
  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);
  }
コード例 #13
0
  @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);
  }
コード例 #14
0
 @Override
 public void writeCustomNBT(NBTTagCompound nbt, boolean descPacket) {
   super.writeCustomNBT(nbt, descPacket);
   NBTTagCompound tankTag = tank.writeToNBT(new NBTTagCompound());
   nbt.setTag("tank", tankTag);
 }