Make the heat methods not crash.

This commit is contained in:
Ben Spiers 2014-12-22 23:40:29 +00:00
parent 37e35d5943
commit 00fa5ccbe6

View file

@ -223,7 +223,11 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
@Override @Override
public double getTemp() public double getTemp()
{ {
return getReactor().getTemp(); if(getReactor() != null)
{
return getReactor().getTemp();
}
return 0;
} }
@Override @Override
@ -235,13 +239,20 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
@Override @Override
public double getInsulationCoefficient(ForgeDirection side) public double getInsulationCoefficient(ForgeDirection side)
{ {
return getReactor().getInsulationCoefficient(side); if(getReactor() != null)
{
return getReactor().getInsulationCoefficient(side);
}
return 0;
} }
@Override @Override
public void transferHeatTo(double heat) public void transferHeatTo(double heat)
{ {
getReactor().transferHeatTo(heat); if(getReactor() != null)
{
getReactor().transferHeatTo(heat);
}
} }
@Override @Override
@ -253,7 +264,11 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl
@Override @Override
public double applyTemperatureChange() public double applyTemperatureChange()
{ {
return getReactor().applyTemperatureChange(); if(getReactor() != null)
{
return getReactor().applyTemperatureChange();
}
return 0;
} }
@Override @Override