2021-06-11 14:02:28 +02: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
|
2024-04-25 23:21:18 +02:00
|
|
|
index 25b7198c0e0afb7a09b1a68f5a53f5c44244cafb..89bd200befb65fe33ee049f7a07d5c771c971b13 100644
|
2021-06-11 14:02:28 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
2024-04-24 08:05:14 +02:00
|
|
|
@@ -30,6 +30,7 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2021-10-02 19:21:49 +02:00
|
|
|
this.tileEntity = tileEntity;
|
2021-06-11 14:02:28 +02:00
|
|
|
|
2024-01-21 12:53:04 +01:00
|
|
|
+ try { // Paper - Show blockstate location if we failed to read it
|
2021-10-02 19:21:49 +02:00
|
|
|
// Paper start
|
|
|
|
this.snapshotDisabled = DISABLE_SNAPSHOT;
|
|
|
|
if (DISABLE_SNAPSHOT) {
|
2024-04-24 08:05:14 +02:00
|
|
|
@@ -42,6 +43,14 @@ public class CraftBlockEntityState<T extends BlockEntity> extends CraftBlockStat
|
2021-06-11 14:02:28 +02:00
|
|
|
this.load(this.snapshot);
|
|
|
|
}
|
|
|
|
// Paper end
|
2024-01-21 12:53:04 +01:00
|
|
|
+ // Paper start - Show blockstate location if we failed to read it
|
2021-06-11 14:02:28 +02:00
|
|
|
+ } catch (Throwable thr) {
|
|
|
|
+ if (thr instanceof ThreadDeath) {
|
|
|
|
+ throw (ThreadDeath)thr;
|
|
|
|
+ }
|
2021-10-02 19:21:49 +02:00
|
|
|
+ throw new RuntimeException("Failed to read BlockState at: world: " + this.getWorld().getName() + " location: (" + this.getX() + ", " + this.getY() + ", " + this.getZ() + ")", thr);
|
2021-06-11 14:02:28 +02:00
|
|
|
+ }
|
2024-01-21 12:53:04 +01:00
|
|
|
+ // Paper end - Show blockstate location if we failed to read it
|
2021-06-11 14:02:28 +02:00
|
|
|
}
|
|
|
|
|
2024-04-24 08:05:14 +02:00
|
|
|
protected CraftBlockEntityState(CraftBlockEntityState<T> state, Location location) {
|