- Fixed gantry shafts able to cause loops in kinetic connectivity when switching to powered state
This commit is contained in:
simibubi 2021-02-06 18:11:35 +01:00
parent 88f80c6240
commit 2315625c4b

View file

@ -187,13 +187,9 @@ public class GantryShaftBlock extends DirectionalKineticBlock {
toUpdate.add(pos);
for (BlockPos blockPos : toUpdate) {
BlockState blockState = worldIn.getBlockState(blockPos);
if (!shouldPower) {
TileEntity te = worldIn.getTileEntity(blockPos);
if (te instanceof KineticTileEntity)
((KineticTileEntity) te).detachKinetics();
}
TileEntity te = worldIn.getTileEntity(blockPos);
if (te instanceof KineticTileEntity)
((KineticTileEntity) te).detachKinetics();
if (blockState.getBlock() instanceof GantryShaftBlock)
worldIn.setBlockState(blockPos, blockState.with(POWERED, shouldPower), 2);
}