2019-12-13 17:22:16 +01:00
|
|
|
From 552c90cb14a0f1f872e74cf543950d3a531958b0 Mon Sep 17 00:00:00 2001
|
2019-06-15 19:30:43 +02: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-08-21 03:02:51 +02:00
|
|
|
index f6401e2cd..3e22d558e 100644
|
2019-06-15 19:30:43 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
2019-07-05 04:13:38 +02:00
|
|
|
@@ -19,6 +19,8 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
2019-06-15 19:30:43 +02:00
|
|
|
public CraftBlockEntityState(Block block, Class<T> tileEntityClass) {
|
|
|
|
super(block);
|
|
|
|
|
|
|
|
+ try {// Paper - show location on failure
|
|
|
|
+
|
|
|
|
this.tileEntityClass = tileEntityClass;
|
|
|
|
|
|
|
|
// get tile entity from block:
|
2019-07-05 04:13:38 +02:00
|
|
|
@@ -38,6 +40,14 @@ public class CraftBlockEntityState<T extends TileEntity> extends CraftBlockState
|
2019-06-15 19:30:43 +02:00
|
|
|
this.load(this.snapshot);
|
|
|
|
}
|
|
|
|
// Paper end
|
2019-06-15 19:36:09 +02:00
|
|
|
+ // Paper start - show location on failure
|
2019-06-15 19:30:43 +02:00
|
|
|
+ } catch (Throwable thr) {
|
|
|
|
+ if (thr instanceof ThreadDeath) {
|
|
|
|
+ throw (ThreadDeath)thr;
|
|
|
|
+ }
|
2019-06-18 02:43:18 +02:00
|
|
|
+ throw new RuntimeException("Failed to read BlockState at: world: " + block.getWorld().getName() + " location: (" + block.getX() + ", " + block.getY() + ", " + block.getZ() + ")", thr);
|
2019-06-15 19:30:43 +02:00
|
|
|
+ }
|
2019-06-15 19:36:09 +02:00
|
|
|
+ // Paper end
|
2019-06-15 19:30:43 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
public final boolean snapshotDisabled; // Paper
|
|
|
|
--
|
2019-12-12 17:20:43 +01:00
|
|
|
2.24.1
|
2019-06-15 19:30:43 +02:00
|
|
|
|