Fix a crash with energy phantomfaces and tesla

This commit is contained in:
Ellpeck 2016-11-27 19:32:14 +01:00
parent 442d0f6a4e
commit 8226479ce8
2 changed files with 7 additions and 3 deletions

View file

@ -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);

View file

@ -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