From a1b163e5638d8c7768a66b90ee9db7736b109a84 Mon Sep 17 00:00:00 2001 From: Daniel Saukel Date: Tue, 30 Jun 2020 13:49:16 +0200 Subject: [PATCH] try-catch all sign initializations; resolves #799 --- .../de/erethon/dungeonsxl/sign/passive/ScriptSign.java | 8 +++++++- .../main/java/de/erethon/dungeonsxl/world/DGameWorld.java | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/core/src/main/java/de/erethon/dungeonsxl/sign/passive/ScriptSign.java b/core/src/main/java/de/erethon/dungeonsxl/sign/passive/ScriptSign.java index 137b2468..dd45369a 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/sign/passive/ScriptSign.java +++ b/core/src/main/java/de/erethon/dungeonsxl/sign/passive/ScriptSign.java @@ -89,7 +89,13 @@ public class ScriptSign extends Passive { continue; } - dSign.initialize(); + try { + dSign.initialize(); + } catch (Exception exception) { + dSign.markAsErroneous("An error occurred while initializing a sign of the type " + dSign.getName() + + ". This is not a user error. Please report the following stacktrace to the developer of the plugin:"); + exception.printStackTrace(); + } if (!dSign.hasTriggers()) { dSign.trigger(null); } diff --git a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java index a16331a5..53faa604 100644 --- a/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java +++ b/core/src/main/java/de/erethon/dungeonsxl/world/DGameWorld.java @@ -189,7 +189,13 @@ public class DGameWorld extends DInstanceWorld implements GameWorld { } if (dSign.isOnDungeonInit()) { - dSign.initialize(); + try { + dSign.initialize(); + } catch (Exception exception) { + dSign.markAsErroneous("An error occurred while initializing a sign of the type " + dSign.getName() + + ". This is not a user error. Please report the following stacktrace to the developer of the plugin:"); + exception.printStackTrace(); + } if (!dSign.isErroneous() && dSign.isSetToAir()) { dSign.setToAir(); }