This commit is contained in:
drcrazy 2019-03-25 14:36:48 +03:00
parent 053324154e
commit 8261874665
2 changed files with 4 additions and 4 deletions

View file

@ -32,7 +32,6 @@ import net.minecraftforge.energy.CapabilityEnergy;
import net.minecraftforge.energy.IEnergyStorage;
import reborncore.api.IToolDrop;
import reborncore.api.power.EnumPowerTier;
import reborncore.common.powerSystem.PowerSystem;
import reborncore.common.powerSystem.TilePowerAcceptor;
import techreborn.init.ModBlocks;

View file

@ -65,8 +65,9 @@ public class TileLightningRod extends TilePowerAcceptor implements IToolDrop {
--onStatusHoldTicks;
if (onStatusHoldTicks == 0 || getEnergy() <= 0) {
if (getBlockType() instanceof BlockMachineBase)
((BlockMachineBase) getBlockType()).setActive(false, world, pos);
if (world.getBlockState(pos).getBlock() instanceof BlockMachineBase) {
((BlockMachineBase) world.getBlockState(pos).getBlock()).setActive(false, world, pos);
}
onStatusHoldTicks = -1;
}
@ -87,7 +88,7 @@ public class TileLightningRod extends TilePowerAcceptor implements IToolDrop {
world.addWeatherEffect(lightningBolt);
world.spawnEntity(lightningBolt);
addEnergy(baseEnergyStrike * (0.3F + weatherStrength));
((BlockMachineBase) getBlockType()).setActive(true, world, pos);
((BlockMachineBase) world.getBlockState(pos).getBlock()).setActive(true, world, pos);
onStatusHoldTicks = 400;
}
}