Fix up Chemical Crystalizer saving issue

This commit is contained in:
Aidan C. Brady 2014-02-25 07:52:15 -05:00
parent b8337f9bd1
commit a37b6950e6

View file

@ -226,6 +226,12 @@ public class TileEntityChemicalCrystalizer extends TileEntityElectricBlock imple
isActive = dataStream.readBoolean(); isActive = dataStream.readBoolean();
operatingTicks = dataStream.readInt(); operatingTicks = dataStream.readInt();
for(int i = 0; i < 6; i++)
{
sideConfig[i] = dataStream.readByte();
}
controlType = RedstoneControl.values()[dataStream.readInt()]; controlType = RedstoneControl.values()[dataStream.readInt()];
if(dataStream.readBoolean()) if(dataStream.readBoolean())
@ -247,6 +253,7 @@ public class TileEntityChemicalCrystalizer extends TileEntityElectricBlock imple
data.add(isActive); data.add(isActive);
data.add(operatingTicks); data.add(operatingTicks);
data.add(sideConfig);
data.add(controlType.ordinal()); data.add(controlType.ordinal());
if(inputTank.getGas() != null) if(inputTank.getGas() != null)
@ -272,6 +279,14 @@ public class TileEntityChemicalCrystalizer extends TileEntityElectricBlock imple
controlType = RedstoneControl.values()[nbtTags.getInteger("controlType")]; controlType = RedstoneControl.values()[nbtTags.getInteger("controlType")];
inputTank.read(nbtTags.getCompoundTag("rightTank")); inputTank.read(nbtTags.getCompoundTag("rightTank"));
if(nbtTags.hasKey("sideDataStored"))
{
for(int i = 0; i < 6; i++)
{
sideConfig[i] = nbtTags.getByte("config"+i);
}
}
} }
@Override @Override
@ -284,6 +299,13 @@ public class TileEntityChemicalCrystalizer extends TileEntityElectricBlock imple
nbtTags.setInteger("controlType", controlType.ordinal()); nbtTags.setInteger("controlType", controlType.ordinal());
nbtTags.setCompoundTag("rightTank", inputTank.write(new NBTTagCompound())); nbtTags.setCompoundTag("rightTank", inputTank.write(new NBTTagCompound()));
nbtTags.setBoolean("sideDataStored", true);
for(int i = 0; i < 6; i++)
{
nbtTags.setByte("config"+i, sideConfig[i]);
}
} }
@Override @Override