From 8226479ce8982c9f5bbafca521c3dd513c989b53 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Sun, 27 Nov 2016 19:32:14 +0100 Subject: [PATCH] Fix a crash with energy phantomfaces and tesla --- .../actuallyadditions/mod/tile/TileEntityBase.java | 9 ++++++--- update/changelog.md | 1 + 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java index 92ee8a31f..57653d0d3 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/tile/TileEntityBase.java @@ -332,10 +332,13 @@ public abstract class TileEntityBase extends TileEntity implements ITickable{ } else if(ActuallyAdditions.teslaLoaded){ if(capability == TeslaUtil.teslaConsumer || capability == TeslaUtil.teslaProducer || capability == TeslaUtil.teslaHolder){ - if(this.teslaWrapper == null){ - this.teslaWrapper = new TeslaForgeUnitsWrapper(this.getEnergyStorage(facing)); + IEnergyStorage storage = this.getEnergyStorage(facing); + if(storage != null){ + if(this.teslaWrapper == null){ + this.teslaWrapper = new TeslaForgeUnitsWrapper(storage); + } + return (T)this.teslaWrapper; } - return (T)this.teslaWrapper; } } return super.getCapability(capability, facing); diff --git a/update/changelog.md b/update/changelog.md index 2dda456e4..856b35640 100644 --- a/update/changelog.md +++ b/update/changelog.md @@ -1,5 +1,6 @@ # 1.11-r83 * Fix an exception during loading some tileentities causing them to lose their data +* Fix a crash with Energy Phantomfaces and Tesla * Improve performance of Patreon display code # 1.11-r82