@Override
  public void readFromNBT(NBTTagCompound nbtTags) {
    super.readFromNBT(nbtTags);

    finishedCalc = nbtTags.getBoolean("finishedCalc");

    if (nbtTags.hasKey("fluidTank")) {
      fluidTank.readFromNBT(nbtTags.getCompoundTag("fluidTank"));
    }

    if (nbtTags.hasKey("activeNodes")) {
      NBTTagList tagList = nbtTags.getTagList("activeNodes", NBT.TAG_COMPOUND);

      for (int i = 0; i < tagList.tagCount(); i++) {
        activeNodes.add(Coord4D.read((NBTTagCompound) tagList.getCompoundTagAt(i)));
      }
    }

    if (nbtTags.hasKey("usedNodes")) {
      NBTTagList tagList = nbtTags.getTagList("usedNodes", NBT.TAG_COMPOUND);

      for (int i = 0; i < tagList.tagCount(); i++) {
        usedNodes.add(Coord4D.read((NBTTagCompound) tagList.getCompoundTagAt(i)));
      }
    }
  }
Esempio n. 2
0
    @Override
    public void fromBytes(ByteBuf dataStream) {
      packetType = SecurityPacketType.values()[dataStream.readInt()];

      if (packetType == SecurityPacketType.BLOCK) {
        coord4D = Coord4D.read(dataStream);
      } else {
        currentHand = EnumHand.values()[dataStream.readInt()];
      }

      value = SecurityMode.values()[dataStream.readInt()];
    }