Default piston block entity direction to DOWN (#12039)

This commit is contained in:
masmc05
2025-02-08 21:17:45 +02:00
committed by GitHub
parent 53ae5c95b7
commit 786ddf53c6
2 changed files with 15 additions and 1 deletions

View File

@@ -1,5 +1,14 @@
--- a/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
+++ b/net/minecraft/world/level/block/piston/PistonMovingBlockEntity.java
@@ -35,7 +_,7 @@
private static final double PUSH_OFFSET = 0.01;
public static final double TICK_MOVEMENT = 0.51;
private BlockState movedState = Blocks.AIR.defaultBlockState();
- private Direction direction;
+ private Direction direction = Direction.DOWN; // Paper - default to first value to avoid NPE
private boolean extending;
private boolean isSourcePiston;
private static final ThreadLocal<Direction> NOCLIP = ThreadLocal.withInitial(() -> null);
@@ -299,7 +_,7 @@
if (level.getBlockState(pos).is(Blocks.MOVING_PISTON)) {
BlockState blockState = Block.updateFromNeighbourShapes(blockEntity.movedState, level, pos);