mirror of
https://github.com/Jozufozu/Flywheel.git
synced 2024-11-11 13:04:05 +01:00
Fixes issue 388, When placing a casing or shaft on a active belt it creates a looping power source. This is avoided by using KineticTileEntity.switchToBlockState, which safely modifies the kinetic network.
This commit is contained in:
parent
0c150ff86f
commit
2d04c87865
@ -5,6 +5,7 @@ import java.util.Collections;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||
import org.apache.commons.lang3.mutable.MutableInt;
|
||||
|
||||
import com.simibubi.create.AllBlocks;
|
||||
@ -266,8 +267,9 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||
return ActionResultType.SUCCESS;
|
||||
if (!player.isCreative())
|
||||
heldItem.shrink(1);
|
||||
worldIn.setBlockState(pos, state.with(PART, Part.PULLEY), 2);
|
||||
belt.attachKinetics();
|
||||
|
||||
KineticTileEntity.switchToBlockState(worldIn, pos, state.with(PART, Part.PULLEY));
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
@ -278,7 +280,9 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||
return ActionResultType.PASS;
|
||||
if (!player.isCreative())
|
||||
heldItem.shrink(1);
|
||||
worldIn.setBlockState(pos, state.with(CASING, true), 2);
|
||||
|
||||
KineticTileEntity.switchToBlockState(worldIn, pos, state.with(CASING, true));
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user