mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-07 07:32:03 -07:00
Merge pull request #2187 from Spottedleaf/better-blockstate-failure
Show blockstate location if we failed to read it
This commit is contained in:
@@ -0,0 +1,35 @@
|
|||||||
|
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 7cb4c3e503..c3405950d8 100644
|
||||||
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||||
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockEntityState.java
|
||||||
|
@@ -0,0 +0,0 @@ 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:
|
||||||
|
@@ -0,0 +0,0 @@ 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 location: (" + block.getX() + ", " + block.getY() + ", " + block.getZ() + ")", thr);
|
||||||
|
+ }
|
||||||
|
+ // Paper end
|
||||||
|
}
|
||||||
|
|
||||||
|
public final boolean snapshotDisabled; // Paper
|
||||||
|
--
|
Reference in New Issue
Block a user