Skip to content

Commit

Permalink
Fix comparators on drains crashing if the smeltery is invalid (or the…
Browse files Browse the repository at this point in the history
…re is none) #1342
  • Loading branch information
bonii-xx committed Jan 14, 2015
1 parent d17ca72 commit 2d81be0
Showing 1 changed file with 3 additions and 0 deletions.
Expand Up @@ -186,6 +186,9 @@ public void onDataPacket (NetworkManager net, S35PacketUpdateTileEntity packet)
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;
}
Expand Down

0 comments on commit 2d81be0

Please sign in to comment.