Fixed a crash when mana pools are broken or removed from the world. Actually has to do with a bug in forge, so this is a bit of a band aid. Closes #1950

This commit is contained in:
Vasco Lavos committed 2016-10-19 20:34:01 +01:00
1 parent ba049f8b45
commit 0085bc2415
1 file changed
+7 -1
@@ -407,7 +407,13 @@ public class TilePool extends TileMod implements IManaPool, IKeyLocked, ISparkAt
@Override
public int getCurrentMana() {
return worldObj != null && worldObj.getBlockState(getPos()).getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.CREATIVE ? MAX_MANA : mana;
if(worldObj != null) {
IBlockState state = worldObj.getBlockState(getPos());
if(state.getProperties().containsKey(BotaniaStateProps.POOL_VARIANT))
return state.getValue(BotaniaStateProps.POOL_VARIANT) == PoolVariant.CREATIVE ? MAX_MANA : mana;
}
return 0;
}
@Override