Skip to content

Commit

Permalink
Fix wrong piston world border check (#12007)
Browse files Browse the repository at this point in the history
  • Loading branch information
HaHaWTH authored Jan 25, 2025
1 parent 939bb78 commit 81bb82f
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,15 @@
}

level.playSound(null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, level.random.nextFloat() * 0.15F + 0.6F);
@@ -249,7 +_,7 @@
}

public static boolean isPushable(BlockState state, Level level, BlockPos pos, Direction movementDirection, boolean allowDestroy, Direction pistonFacing) {
- if (pos.getY() < level.getMinY() || pos.getY() > level.getMaxY() || !level.getWorldBorder().isWithinBounds(pos)) {
+ if (pos.getY() < level.getMinY() || pos.getY() > level.getMaxY() || !level.getWorldBorder().isWithinBounds(pos) || !level.getWorldBorder().isWithinBounds(pos.relative(movementDirection))) { // Paper - Fix piston world border check
return false;
} else if (state.isAir()) {
return true;
@@ -305,12 +_,54 @@
BlockState[] blockStates = new BlockState[toPush.size() + toDestroy.size()];
Direction direction = extending ? facing : facing.getOpposite();
Expand Down

0 comments on commit 81bb82f

Please sign in to comment.