Fix another kinetic loop when removing shafts from a belt segment

This commit is contained in:
simibubi 2020-07-10 12:49:24 +02:00
parent cf80822024
commit 3902569cbd

View file

@ -299,12 +299,7 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
if (state.get(PART) == BeltPart.PULLEY) {
if (world.isRemote)
return ActionResultType.SUCCESS;
world.setBlockState(context.getPos(), state.with(PART, BeltPart.MIDDLE), 2);
BeltTileEntity belt = BeltHelper.getSegmentTE(world, context.getPos());
if (belt != null) {
belt.detachKinetics();
belt.attachKinetics();
}
KineticTileEntity.switchToBlockState(world, pos, state.with(PART, BeltPart.MIDDLE));
if (player != null && !player.isCreative())
player.inventory.placeItemBackInInventory(world, AllBlocks.SHAFT.asStack());
return ActionResultType.SUCCESS;