mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-09 20:30:28 +01:00
4e958e229f
Co-authored-by: Jake Potrebic <jake.m.potrebic@gmail.com> Co-authored-by: zml <zml@stellardrift.ca> Co-authored-by: Mariell Hoversholm <proximyst@proximyst.com>
35 lines
1.6 KiB
Diff
35 lines
1.6 KiB
Diff
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
|
|
index feeae1a9eb309ae4101783b191bb2bffe9aeb7d3..6e9eff2c29528b857cf758e9e45606c8a1c1cc8d 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<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:
|
|
@@ -38,6 +40,14 @@ public class CraftBlockEntityState<T extends TileEntity> 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
|