Add some bad code to stop the creative solar panel from exploding when FE is disabled.

This commit is contained in:
modmuss50 2019-03-06 14:29:22 +00:00
parent e7715937cf
commit 8b2c098b27

View file

@ -26,9 +26,11 @@ package techreborn.tiles.generator;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import reborncore.api.IToolDrop; import reborncore.api.IToolDrop;
import reborncore.api.power.EnumPowerTier; import reborncore.api.power.EnumPowerTier;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
@ -46,7 +48,24 @@ public class TileCreativeSolarPanel extends TilePowerAcceptor implements IToolDr
@Override @Override
public void update() { public void update() {
//If FE power is disabled we handle the power this way.
if(!PowerSystem.EnergySystem.FE.enabled.get()){
boolean added = false;
for (EnumFacing facing : EnumFacing.VALUES){
TileEntity tileEntity = world.getTileEntity(getPos().offset(facing));
if(tileEntity instanceof TilePowerAcceptor){
((TilePowerAcceptor) tileEntity).addEnergy(100000);
added = true;
}
}
if(!added){
//If nothing happened then go back to to ic2 power
super.update(); super.update();
}
} else {
super.update();
}
setEnergy(getMaxPower()); setEnergy(getMaxPower());
} }