mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-11-22 23:28:35 +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.data.PlayerData;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
import de.ellpeck.actuallyadditions.mod.util.ItemUtil;
|
||||||
import de.ellpeck.actuallyadditions.mod.util.compat.ItemTeslaWrapper;
|
import de.ellpeck.actuallyadditions.mod.util.compat.ItemTeslaWrapper;
|
||||||
|
import de.ellpeck.actuallyadditions.mod.util.compat.TeslaUtil;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
@ -196,11 +197,13 @@ public abstract class ItemEnergy extends ItemEnergyContainer{
|
||||||
return (T)this.forgeUnitsWrapper;
|
return (T)this.forgeUnitsWrapper;
|
||||||
}
|
}
|
||||||
else if(ActuallyAdditions.teslaLoaded){
|
else if(ActuallyAdditions.teslaLoaded){
|
||||||
|
if(capability == TeslaUtil.teslaConsumer || capability == TeslaUtil.teslaProducer || capability == TeslaUtil.teslaHolder){
|
||||||
if(this.teslaWrapper == null){
|
if(this.teslaWrapper == null){
|
||||||
this.teslaWrapper = new ItemTeslaWrapper(this.stack, this.item);
|
this.teslaWrapper = new ItemTeslaWrapper(this.stack, this.item);
|
||||||
}
|
}
|
||||||
return (T)this.teslaWrapper;
|
return (T)this.teslaWrapper;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue