Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #11887 #12039

Merged
merged 3 commits into from
Feb 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,12 @@ public CraftBlockEntityState(World world, T tileEntity) {
if (thr instanceof ThreadDeath) {
throw (ThreadDeath)thr;
}
throw new RuntimeException("Failed to read BlockState at: world: " + this.getWorld().getName() + " location: (" + this.getX() + ", " + this.getY() + ", " + this.getZ() + ")", thr);
throw new RuntimeException(
world == null
? "Failed to read non-placed BlockState"
: "Failed to read BlockState at: world: " + world.getName() + " location: (" + this.getX() + ", " + this.getY() + ", " + this.getZ() + ")",
thr
);
}
// Paper end - Show blockstate location if we failed to read it
}
Expand Down
Loading