Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-15 12:30:06 +01:00
4104545b11
"It was from a different time before books were as jank as they are now. As time has gone on they've only proven to be worse and worse."
35 Zeilen
1.6 KiB
Diff
35 Zeilen
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 972d4aa11a0a119e8e6703af99d93bcd3cddc6d8..315690d72c5ba07b9bb6e7dd997b8f5afdf627f2 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 BlockEntity> extends CraftBlockStat
|
|
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 BlockEntity> extends CraftBlockStat
|
|
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
|