From 00fa5ccbe6ea857722f7e1044596fd2d041a76bf Mon Sep 17 00:00:00 2001 From: Ben Spiers <ben.spiers22@gmail.com> Date: Mon, 22 Dec 2014 23:40:29 +0000 Subject: [PATCH] Make the heat methods not crash. --- .../tile/reactor/TileEntityReactorPort.java | 23 +++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/main/java/mekanism/generators/common/tile/reactor/TileEntityReactorPort.java b/src/main/java/mekanism/generators/common/tile/reactor/TileEntityReactorPort.java index ac13ba475..afb205715 100644 --- a/src/main/java/mekanism/generators/common/tile/reactor/TileEntityReactorPort.java +++ b/src/main/java/mekanism/generators/common/tile/reactor/TileEntityReactorPort.java @@ -223,7 +223,11 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl @Override public double getTemp() { - return getReactor().getTemp(); + if(getReactor() != null) + { + return getReactor().getTemp(); + } + return 0; } @Override @@ -235,13 +239,20 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl @Override public double getInsulationCoefficient(ForgeDirection side) { - return getReactor().getInsulationCoefficient(side); + if(getReactor() != null) + { + return getReactor().getInsulationCoefficient(side); + } + return 0; } @Override public void transferHeatTo(double heat) { - getReactor().transferHeatTo(heat); + if(getReactor() != null) + { + getReactor().transferHeatTo(heat); + } } @Override @@ -253,7 +264,11 @@ public class TileEntityReactorPort extends TileEntityReactorBlock implements IFl @Override public double applyTemperatureChange() { - return getReactor().applyTemperatureChange(); + if(getReactor() != null) + { + return getReactor().applyTemperatureChange(); + } + return 0; } @Override