From 552c90cb14a0f1f872e74cf543950d3a531958b0 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sat, 15 Jun 2019 10:28:25 -0700 Subject: [PATCH] Show blockstate location if we failed to read it diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java index f6401e2cd..3e22d558e 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java @@ -19,6 +19,8 @@ public class CraftBlockEntityState extends CraftBlockState public CraftBlockEntityState(Block block, Class tileEntityClass) { super(block); + try {// Paper - show location on failure + this.tileEntityClass = tileEntityClass; // get tile entity from block: @@ -38,6 +40,14 @@ public class CraftBlockEntityState extends CraftBlockState this.load(this.snapshot); } // Paper end + // Paper start - show location on failure + } catch (Throwable thr) { + if (thr instanceof ThreadDeath) { + throw (ThreadDeath)thr; + } + throw new RuntimeException("Failed to read BlockState at: world: " + block.getWorld().getName() + " location: (" + block.getX() + ", " + block.getY() + ", " + block.getZ() + ")", thr); + } + // Paper end } public final boolean snapshotDisabled; // Paper -- 2.24.1