2021-06-11 12:02:28 +00:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
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
|
2022-03-30 20:28:38 +00:00
|
|
|
index a76cce199acdcecfdd8b998ec08974c2ed0751cf..87c25170fbe8b0591d452612496ee1a627138de7 100644
|
2021-06-11 12:02:28 +00:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
2022-01-13 19:31:48 +00:00
|
|
|
@@ -18,6 +18,7 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
2021-06-11 12:02:28 +00:00
|
|
|
|
2021-10-02 17:21:49 +00:00
|
|
|
this.tileEntity = tileEntity;
|
2021-06-11 12:02:28 +00:00
|
|
|
|
2021-10-02 17:21:49 +00:00
|
|
|
+ try { // Paper - show location on failure
|
|
|
|
// Paper start
|
|
|
|
this.snapshotDisabled = DISABLE_SNAPSHOT;
|
|
|
|
if (DISABLE_SNAPSHOT) {
|
2022-01-13 19:31:48 +00:00
|
|
|
@@ -30,6 +31,14 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
2021-06-11 12:02:28 +00:00
|
|
|
this.load(this.snapshot);
|
|
|
|
}
|
|
|
|
// Paper end
|
|
|
|
+ // Paper start - show location on failure
|
|
|
|
+ } catch (Throwable thr) {
|
|
|
|
+ if (thr instanceof ThreadDeath) {
|
|
|
|
+ throw (ThreadDeath)thr;
|
|
|
|
+ }
|
2021-10-02 17:21:49 +00:00
|
|
|
+ throw new RuntimeException("Failed to read BlockState at: world: " + this.getWorld().getName() + " location: (" + this.getX() + ", " + this.getY() + ", " + this.getZ() + ")", thr);
|
2021-06-11 12:02:28 +00:00
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
|
|
|
|
2021-10-02 17:21:49 +00:00
|
|
|
public void refreshSnapshot() {
|