Add some bad code to stop the creative solar panel from exploding when FE is disabled.
This commit is contained in:
parent
e7715937cf
commit
8b2c098b27
1 changed files with 20 additions and 1 deletions
|
@ -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() {
|
||||||
super.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();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
super.update();
|
||||||
|
}
|
||||||
|
|
||||||
setEnergy(getMaxPower());
|
setEnergy(getMaxPower());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue