chainstone fixes

This commit is contained in:
gnembon committed 2020-10-15 02:58:51 -03:00
1 parent a51c8ca707
commit e93c7d442c
1 file changed
+5 -3
@@ -115,7 +115,7 @@ public abstract class PistonHandler_customStickyMixin
{ {
if ( (currentState.getBlock() == Blocks.CHAIN && isChainOnAxis(currentState, motionDirection)) if ( (currentState.getBlock() == Blocks.CHAIN && isChainOnAxis(currentState, motionDirection))
|| isEndRodOnAxis(currentState, motionDirection.getAxis()) || isEndRodOnAxis(currentState, motionDirection.getAxis())
|| Block.sideCoversSmallSquare(world, currentPos, motionDirection.getOpposite())) || Block.sideCoversSmallSquare(world, currentPos, motionDirection))
{ {
return true; return true;
} }
@@ -237,10 +237,12 @@ public abstract class PistonHandler_customStickyMixin
{ {
if (CarpetSettings.chainStone) if (CarpetSettings.chainStone)
{ {
if (blockState.getBlock() == Blocks.CHAIN && isChainOnAxis(blockState, direction)) if (blockState.getBlock() == Blocks.CHAIN && isChainOnAxis(blockState, direction) && !blockState2.isAir())
{ {
if ((blockState2.getBlock() == Blocks.CHAIN && (blockState.get(ChainBlock.AXIS) == blockState2.get(ChainBlock.AXIS))) Block otherBlock = blockState2.getBlock();
if ((otherBlock == Blocks.CHAIN && (blockState.get(ChainBlock.AXIS) == blockState2.get(ChainBlock.AXIS)))
|| isEndRodOnAxis(blockState2, blockState.get(ChainBlock.AXIS)) || isEndRodOnAxis(blockState2, blockState.get(ChainBlock.AXIS))
|| otherBlock == Blocks.HONEY_BLOCK
|| Block.sideCoversSmallSquare(world, blockPos, direction.getOpposite())) || Block.sideCoversSmallSquare(world, blockPos, direction.getOpposite()))
{ {
if (!tryMove(blockPos, direction)) if (!tryMove(blockPos, direction))