Fix comparators on drains crashing if the smeltery is invalid (or there is none) #1342

This commit is contained in:
Bernhard Bonigl committed 2015-01-14 23:37:18 +01:00
1 parent d17ca72edd
commit 2d81be02d3
1 file changed
+3
@@ -186,6 +186,9 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
public int comparatorStrength ()
{
CoordTuple master = this.getMasterPosition();
// invalid smeltery
if(master == null)
return 0;
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getTileEntity(master.x, master.y, master.z);
return 15 * smeltery.currentLiquid / smeltery.maxLiquid;
}