Skip to content

Commit

Permalink
Fixed sticky pistons destroying unpullable blocks
Browse files Browse the repository at this point in the history
More specifically, blocks with mobility flag 1 should not be pulled by pistons, they should only be destroyed when a block is pushed into them, and should not be pullable. Previously they'd be destroyed when attempting to pull them.
Also fixes #319
  • Loading branch information
Roadhog360 committed Sep 1, 2023
1 parent 6132816 commit c5ab817
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ public boolean onBlockEventReceived(World world, int x, int y, int z, int extend
Block blockToPull = world.getBlock(x + xoffset2, y + yoffset2, z + zoffset2);
int metaToPull = world.getBlockMetadata(x + xoffset2, y + yoffset2, z + zoffset2);

if (this.isSticky && !PistonBehaviorRegistry.isNonStickyBlock(blockToPull, metaToPull)) {
if (this.isSticky && blockToPull.getMobilityFlag() != 1 && !PistonBehaviorRegistry.isNonStickyBlock(blockToPull, metaToPull)) {
if (etfuturum$getPushableBlocks(world, x + xoffset2, y + yoffset2, z + zoffset2, oppositeSide, oppositeSide, x + xoffset, y + yoffset, z + zoffset, pushedBlockList, pushedBlockPosList) == 0) {
world.setBlockToAir(x + xoffset, y + yoffset, z + zoffset);
} else {
Expand Down

0 comments on commit c5ab817

Please sign in to comment.