From 93c9ab0b5bfc5a81ff2c123131d3c6f264035256 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Wed, 16 Mar 2022 10:24:03 -0500 Subject: [PATCH] Band-aid for exceptions in unsupported 'running in client' scenario --- .../src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java | 1 + forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java | 1 + 2 files changed, 2 insertions(+) diff --git a/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java b/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java index c950af23..aec39852 100644 --- a/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java +++ b/forge-1.18.2/src/main/java/org/dynmap/forge_1_18_2/DynmapPlugin.java @@ -1797,6 +1797,7 @@ public class DynmapPlugin if(!onblockchange) return; BlockUpdateRec r = new BlockUpdateRec(); r.w = event.getWorld(); + if(!(r.w instanceof ServerLevel)) return; // band-aid to prevent errors in unsupported 'running in client' scenario ForgeWorld fw = getWorld((ServerLevel)r.w, false); if (fw == null) return; r.wid = fw.getName(); diff --git a/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java b/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java index 871e48b6..05cdbf63 100644 --- a/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java +++ b/forge-1.18/src/main/java/org/dynmap/forge_1_18/DynmapPlugin.java @@ -1797,6 +1797,7 @@ public class DynmapPlugin if(!onblockchange) return; BlockUpdateRec r = new BlockUpdateRec(); r.w = event.getWorld(); + if(!(r.w instanceof ServerLevel)) return; // band-aid to prevent errors in unsupported 'running in client' scenario ForgeWorld fw = getWorld((ServerLevel)r.w, false); if (fw == null) return; r.wid = fw.getName();