2019-06-17 07:47:51 +00:00
|
|
|
From 04c4f0e5dc5048071fb5fc42dac2a2302091c670 Mon Sep 17 00:00:00 2001
|
2019-06-15 17:30:43 +00:00
|
|
|
From: Spottedleaf <Spottedleaf@users.noreply.github.com>
|
|
|
|
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
|
2019-06-17 07:47:51 +00:00
|
|
|
index 7cb4c3e503..a593882988 100644
|
2019-06-15 17:30:43 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
@@ -20,6 +20,8 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
|
|
|
public CraftBlockEntityState(Block block, Class<T> tileEntityClass) {
|
|
|
|
super(block);
|
|
|
|
|
|
|
|
+ try {// Paper - show location on failure
|
|
|
|
+
|
|
|
|
this.tileEntityClass = tileEntityClass;
|
|
|
|
|
|
|
|
// get tile entity from block:
|
2019-06-15 17:36:09 +00:00
|
|
|
@@ -39,6 +41,14 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
2019-06-15 17:30:43 +00:00
|
|
|
this.load(this.snapshot);
|
|
|
|
}
|
|
|
|
// Paper end
|
2019-06-15 17:36:09 +00:00
|
|
|
+ // Paper start - show location on failure
|
2019-06-15 17:30:43 +00:00
|
|
|
+ } catch (Throwable thr) {
|
|
|
|
+ if (thr instanceof ThreadDeath) {
|
|
|
|
+ throw (ThreadDeath)thr;
|
|
|
|
+ }
|
2019-06-18 00:41:53 +00:00
|
|
|
+ throw new RuntimeException("Failed to read BlockState at location: " + block.getWorld().getName() + " (" + block.getX() + ", " + block.getY() + ", " + block.getZ() + ")", thr);
|
2019-06-15 17:30:43 +00:00
|
|
|
+ }
|
2019-06-15 17:36:09 +00:00
|
|
|
+ // Paper end
|
2019-06-15 17:30:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean snapshotDisabled; // Paper
|
|
|
|
--
|
|
|
|
2.21.0
|
|
|
|
|