Cleanup
This commit is contained in:
parent
b450e7e408
commit
b9d064dc06
3 changed files with 12 additions and 8 deletions
|
@ -72,7 +72,6 @@ public class SynchronizedBoilerData extends SynchronizedData<SynchronizedBoilerD
|
|||
@Override
|
||||
public double applyTemperatureChange()
|
||||
{
|
||||
|
||||
if(temperature < 100 + IHeatTransfer.AMBIENT_TEMP)
|
||||
{
|
||||
double temperatureDeficit = 100 + IHeatTransfer.AMBIENT_TEMP - temperature;
|
||||
|
@ -81,23 +80,26 @@ public class SynchronizedBoilerData extends SynchronizedData<SynchronizedBoilerD
|
|||
heatToAbsorb -= heatProvided;
|
||||
temperature += heatProvided / (volume * heatCapacity * 16);
|
||||
}
|
||||
|
||||
if(temperature >= 100 + IHeatTransfer.AMBIENT_TEMP && waterStored != null)
|
||||
{
|
||||
int amountToBoil = (int)Math.floor(heatToAbsorb / enthalpyOfVaporization);
|
||||
amountToBoil = Math.min(amountToBoil, waterStored.amount);
|
||||
waterStored.amount -= amountToBoil;
|
||||
|
||||
if(steamStored == null)
|
||||
{
|
||||
steamStored = new FluidStack(FluidRegistry.getFluid("steam"), amountToBoil);
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
steamStored.amount += amountToBoil;
|
||||
}
|
||||
|
||||
heatToAbsorb -= amountToBoil * enthalpyOfVaporization;
|
||||
}
|
||||
|
||||
heatToAbsorb *= 0.8;
|
||||
|
||||
return temperature;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,11 +3,8 @@ package mekanism.common.multipart;
|
|||
import mekanism.api.IHeatTransfer;
|
||||
import mekanism.common.HeatNetwork;
|
||||
import mekanism.common.util.HeatUtils;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import codechicken.lib.colour.Colour;
|
||||
import codechicken.lib.colour.ColourRGBA;
|
||||
|
||||
/**
|
||||
|
@ -61,11 +58,13 @@ public class MultipartHeatTransmitter extends MultipartTransmitter<IHeatTransfer
|
|||
{
|
||||
temperature += material.inverseHeatCapacity * heatToAbsorb;
|
||||
heatToAbsorb = 0;
|
||||
|
||||
if(Math.abs(temperature - clientTemperature) > (temperature / 100))
|
||||
{
|
||||
clientTemperature = temperature;
|
||||
getPart().sendTemp();
|
||||
}
|
||||
|
||||
return temperature;
|
||||
}
|
||||
|
||||
|
@ -81,11 +80,13 @@ public class MultipartHeatTransmitter extends MultipartTransmitter<IHeatTransfer
|
|||
if(getPart().connectionMapContainsSide(getPart().getAllCurrentConnections(), side))
|
||||
{
|
||||
TileEntity adj = coord().getFromSide(side).getTileEntity(world());
|
||||
|
||||
if(adj instanceof IHeatTransfer)
|
||||
{
|
||||
return (IHeatTransfer)adj;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -487,6 +487,7 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
|||
{
|
||||
temperature += invHeatCapacity * heatToAbsorb;
|
||||
heatToAbsorb = 0;
|
||||
|
||||
return temperature;
|
||||
}
|
||||
|
||||
|
@ -503,9 +504,9 @@ public class TileEntityThermoelectricBoiler extends TileEntityMultiblock<Synchro
|
|||
{
|
||||
return structure;
|
||||
}
|
||||
else
|
||||
{
|
||||
else {
|
||||
TileEntity adj = Coord4D.get(this).getFromSide(side).getTileEntity(worldObj);
|
||||
|
||||
if(adj instanceof IHeatTransfer)
|
||||
{
|
||||
return (IHeatTransfer)adj;
|
||||
|
|
Loading…
Add table
Reference in a new issue