mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
fix a crash on startup with energy items
This commit is contained in:
parent
b9a84481d1
commit
a70468ff72
1 changed files with 6 additions and 3 deletions
|
@ -17,6 +17,7 @@ import de.ellpeck.actuallyadditions.mod.ActuallyAdditions;
|
|||
import de.ellpeck.actuallyadditions.mod.data.PlayerData;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
||||
import de.ellpeck.actuallyadditions.mod.util.compat.ItemTeslaWrapper;
|
||||
import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
|
@ -196,10 +197,12 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
|||
return (T)this.forgeUnitsWrapper;
|
||||
}
|
||||
else if(ActuallyAdditions.teslaLoaded){
|
||||
if(this.teslaWrapper == null){
|
||||
this.teslaWrapper = new ItemTeslaWrapper(this.stack, this.item);
|
||||
if(capability == TeslaUtil.teslaConsumer || capability == TeslaUtil.teslaProducer || capability == TeslaUtil.teslaHolder){
|
||||
if(this.teslaWrapper == null){
|
||||
this.teslaWrapper = new ItemTeslaWrapper(this.stack, this.item);
|
||||
}
|
||||
return (T)this.teslaWrapper;
|
||||
}
|
||||
return (T)this.teslaWrapper;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue