diff --git a/common/mekanism/client/gui/GuiSalinationController.java b/common/mekanism/client/gui/GuiSalinationController.java index e25f1744f..13498d596 100644 --- a/common/mekanism/client/gui/GuiSalinationController.java +++ b/common/mekanism/client/gui/GuiSalinationController.java @@ -35,6 +35,11 @@ public class GuiSalinationController extends GuiMekanism fontRenderer.drawString(tileEntity.getInvName(), 5, 5, 0x404040); fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 0x404040); + + fontRenderer.drawString("Structure: " + tileEntity.structured, 50, 21, 0x00CD00); + fontRenderer.drawString("Height: " + tileEntity.height, 50, 30, 0x00CD00); + fontRenderer.drawString("Solars: " + tileEntity.clientSolarAmount, 50, 39, 0x00CD00); + fontRenderer.drawString("Max Temp: " + tileEntity.getMaxTemperature(), 50, 48, 0x00CD00); if(xAxis >= 7 && xAxis <= 23 && yAxis >= 14 && yAxis <= 72) { diff --git a/common/mekanism/common/tile/TileEntitySalinationController.java b/common/mekanism/common/tile/TileEntitySalinationController.java index 14f9480f9..76c0b95b3 100644 --- a/common/mekanism/common/tile/TileEntitySalinationController.java +++ b/common/mekanism/common/tile/TileEntitySalinationController.java @@ -6,6 +6,9 @@ import java.util.Set; import mekanism.api.Coord4D; import mekanism.common.IConfigurable; +import mekanism.common.PacketHandler; +import mekanism.common.PacketHandler.Transmission; +import mekanism.common.network.PacketTileEntity; import mekanism.common.tank.TankUpdateProtocol; import mekanism.common.util.MekanismUtils; import mekanism.generators.common.tile.TileEntityAdvancedSolarGenerator; @@ -65,6 +68,8 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp if(!worldObj.isRemote) { + updatedThisTick = false; + if(ticker == 5) { refresh(); @@ -119,9 +124,16 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp { if(!updatedThisTick) { + boolean prev = structured; + clearStructure(); structured = buildStructure(); + if(structured != prev) + { + PacketHandler.sendPacket(Transmission.CLIENTS_RANGE, new PacketTileEntity().setParams(Coord4D.get(this), getNetworkedData(new ArrayList())), Coord4D.get(this), 50D); + } + if(!structured) { temperature = Math.min(getMaxTemperature(), getTemperature()); @@ -172,6 +184,11 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp public float getMaxTemperature() { + if(!structured) + { + return 1; + } + return 1 + (height-3)*0.5F; } @@ -186,7 +203,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp for(TileEntityAdvancedSolarGenerator solar : solars) { - if(solar.seesSun) + if(solar != null && solar.seesSun) { ret++; } @@ -495,10 +512,18 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp brineTank.setFluid(null); } + boolean prev = structured; + structured = dataStream.readBoolean(); controllerConflict = dataStream.readBoolean(); clientSolarAmount = dataStream.readInt(); height = dataStream.readInt(); + temperature = dataStream.readFloat(); + + if(structured != prev) + { + worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord); + } MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord); } @@ -532,6 +557,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp data.add(controllerConflict); data.add(getSolarAmount()); data.add(height); + data.add(temperature); return data; }