@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 ArrayList<Object> getNetworkedData(ArrayList<Object> data) { super.getNetworkedData(data); data.add(tier.ordinal()); data.add(isActive); data.add(valve); data.add(editMode.ordinal()); if (valve > 0) { data.add(FluidRegistry.getFluidName(valveFluid)); } if (fluidTank.getFluid() != null) { data.add(1); data.add(FluidRegistry.getFluidName(fluidTank.getFluid())); data.add(fluidTank.getFluid().amount); } else { data.add(0); } return data; }