This commit is contained in:
Aidan C. Brady 2014-01-14 18:43:41 -05:00
parent 98f3f544cd
commit 992b24e868
2 changed files with 32 additions and 1 deletions

View file

@ -36,6 +36,11 @@ public class GuiSalinationController extends GuiMekanism
fontRenderer.drawString(tileEntity.getInvName(), 5, 5, 0x404040); fontRenderer.drawString(tileEntity.getInvName(), 5, 5, 0x404040);
fontRenderer.drawString(MekanismUtils.localize("container.inventory"), 8, (ySize - 96) + 4, 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) if(xAxis >= 7 && xAxis <= 23 && yAxis >= 14 && yAxis <= 72)
{ {
drawCreativeTabHoveringText(tileEntity.waterTank.getFluid() != null ? tileEntity.waterTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.waterTank.getFluidAmount() : MekanismUtils.localize("gui.empty"), xAxis, yAxis); drawCreativeTabHoveringText(tileEntity.waterTank.getFluid() != null ? tileEntity.waterTank.getFluid().getFluid().getLocalizedName() + ": " + tileEntity.waterTank.getFluidAmount() : MekanismUtils.localize("gui.empty"), xAxis, yAxis);

View file

@ -6,6 +6,9 @@ import java.util.Set;
import mekanism.api.Coord4D; import mekanism.api.Coord4D;
import mekanism.common.IConfigurable; 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.tank.TankUpdateProtocol;
import mekanism.common.util.MekanismUtils; import mekanism.common.util.MekanismUtils;
import mekanism.generators.common.tile.TileEntityAdvancedSolarGenerator; import mekanism.generators.common.tile.TileEntityAdvancedSolarGenerator;
@ -65,6 +68,8 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
if(!worldObj.isRemote) if(!worldObj.isRemote)
{ {
updatedThisTick = false;
if(ticker == 5) if(ticker == 5)
{ {
refresh(); refresh();
@ -119,9 +124,16 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
{ {
if(!updatedThisTick) if(!updatedThisTick)
{ {
boolean prev = structured;
clearStructure(); clearStructure();
structured = buildStructure(); 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) if(!structured)
{ {
temperature = Math.min(getMaxTemperature(), getTemperature()); temperature = Math.min(getMaxTemperature(), getTemperature());
@ -172,6 +184,11 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
public float getMaxTemperature() public float getMaxTemperature()
{ {
if(!structured)
{
return 1;
}
return 1 + (height-3)*0.5F; return 1 + (height-3)*0.5F;
} }
@ -186,7 +203,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
for(TileEntityAdvancedSolarGenerator solar : solars) for(TileEntityAdvancedSolarGenerator solar : solars)
{ {
if(solar.seesSun) if(solar != null && solar.seesSun)
{ {
ret++; ret++;
} }
@ -495,10 +512,18 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
brineTank.setFluid(null); brineTank.setFluid(null);
} }
boolean prev = structured;
structured = dataStream.readBoolean(); structured = dataStream.readBoolean();
controllerConflict = dataStream.readBoolean(); controllerConflict = dataStream.readBoolean();
clientSolarAmount = dataStream.readInt(); clientSolarAmount = dataStream.readInt();
height = dataStream.readInt(); height = dataStream.readInt();
temperature = dataStream.readFloat();
if(structured != prev)
{
worldObj.markBlockForRenderUpdate(xCoord, yCoord, zCoord);
}
MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord); MekanismUtils.updateBlock(worldObj, xCoord, yCoord, zCoord);
} }
@ -532,6 +557,7 @@ public class TileEntitySalinationController extends TileEntitySalinationTank imp
data.add(controllerConflict); data.add(controllerConflict);
data.add(getSolarAmount()); data.add(getSolarAmount());
data.add(height); data.add(height);
data.add(temperature);
return data; return data;
} }