Fix placing a diode on the world border (#1094)

* Fix placing a diode on the world border

* 〃
This commit is contained in:
Patrick 'Quezler' Mounier
2019-11-19 14:40:44 +01:00
committed by Anuken
parent 7955b82b1e
commit 48911005aa

View File

@@ -51,7 +51,7 @@ public class PowerDiode extends Block{
// battery % of the graph on either side, defaults to zero
protected float bar(Tile tile){
return tile.block().hasPower ? tile.entity.power.graph.getBatteryStored() / tile.entity.power.graph.getTotalBatteryCapacity() : 0f;
return (tile != null && tile.block().hasPower) ? tile.entity.power.graph.getBatteryStored() / tile.entity.power.graph.getTotalBatteryCapacity() : 0f;
}
@Override