1
0
mirror of https://github.com/PaperMC/Paper.git synced 2025-07-26 17:52:02 -07:00

Fix wrong piston world border check ()

This commit is contained in:
Creeam
2025-01-25 12:13:21 -08:00
committed by GitHub
parent 939bb7828f
commit 81bb82f521

@@ -61,6 +61,15 @@
} }
level.playSound(null, pos, SoundEvents.PISTON_CONTRACT, SoundSource.BLOCKS, 0.5F, level.random.nextFloat() * 0.15F + 0.6F); 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 @@ @@ -305,12 +_,54 @@
BlockState[] blockStates = new BlockState[toPush.size() + toDestroy.size()]; BlockState[] blockStates = new BlockState[toPush.size() + toDestroy.size()];
Direction direction = extending ? facing : facing.getOpposite(); Direction direction = extending ? facing : facing.getOpposite();