mirror of
https://github.com/PaperMC/Paper.git
synced 2025-05-19 05:30:23 -07:00
Fix wrong piston world border check (#12007)
This commit is contained in:
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();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user