Fix wrong piston world border check (#12007)

This commit is contained in:
Creeam 2025-01-25 12:13:21 -08:00 committed by GitHub
parent 939bb7828f
commit 81bb82f521
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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();