mirror of
https://github.com/GTNewHorizons/TinkersConstruct.git
synced 2026-11-14 01:14:18 +00:00
Fix drain-comparator NPE when the controller gets broken #1586
This commit is contained in:
1 parent
9f0349c66b
commit
129fb75e4c
1 file changed
+5
@@ -190,6 +190,11 @@ public class SmelteryDrainLogic extends MultiServantLogic implements IFluidHandl
|
||||
if(master == null)
|
||||
return 0;
|
||||
SmelteryLogic smeltery = (SmelteryLogic) worldObj.getTileEntity(master.x, master.y, master.z);
|
||||
|
||||
// this can happen when the comparator checks its strength before the drain is getting updated on a broken master (smeltery controller)
|
||||
if(smeltery == null)
|
||||
return 0;
|
||||
|
||||
if(smeltery.maxLiquid == 0)
|
||||
return 0;
|
||||
return 15 * smeltery.currentLiquid / smeltery.maxLiquid;
|
||||
|
||||
Reference in new issue
Block a user