Should fix #1691
This commit is contained in:
parent
053324154e
commit
8261874665
2 changed files with 4 additions and 4 deletions
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue