mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-29 08:27:03 +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
1 changed files with 7 additions and 3 deletions
|
@ -5,6 +5,7 @@ import java.util.Collections;
|
||||||
import java.util.LinkedList;
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
import org.apache.commons.lang3.mutable.MutableInt;
|
import org.apache.commons.lang3.mutable.MutableInt;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
@ -266,8 +267,9 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
if (!player.isCreative())
|
if (!player.isCreative())
|
||||||
heldItem.shrink(1);
|
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;
|
return ActionResultType.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -278,7 +280,9 @@ public class BeltBlock extends HorizontalKineticBlock implements ITE<BeltTileEnt
|
||||||
return ActionResultType.PASS;
|
return ActionResultType.PASS;
|
||||||
if (!player.isCreative())
|
if (!player.isCreative())
|
||||||
heldItem.shrink(1);
|
heldItem.shrink(1);
|
||||||
worldIn.setBlockState(pos, state.with(CASING, true), 2);
|
|
||||||
|
KineticTileEntity.switchToBlockState(worldIn, pos, state.with(CASING, true));
|
||||||
|
|
||||||
return ActionResultType.SUCCESS;
|
return ActionResultType.SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue