Fixed potential crash in capacitor related logs

This commit is contained in:
Unknown 2018-07-23 21:52:07 +02:00 committed by unknown
parent 75f961cd98
commit 111dbcd6b6

View file

@ -162,9 +162,15 @@ public class TileEntityCapacitor extends TileEntityAbstractEnergy {
@Override
public String toString() {
return String.format("%s %s %8d",
getClass().getSimpleName(),
Commons.format(world, pos),
energy_getEnergyStored());
if (enumTier == null) {
return String.format("%s %s",
getClass().getSimpleName(),
Commons.format(world, pos));
} else {
return String.format("%s %s %8d",
getClass().getSimpleName(),
Commons.format(world, pos),
energy_getEnergyStored());
}
}
}