Band-aid for exceptions in unsupported 'running in client' scenario

This commit is contained in:
Mike Primm 2022-03-16 10:24:03 -05:00
parent ab76953294
commit 93c9ab0b5b
2 changed files with 2 additions and 0 deletions

View File

@ -1797,6 +1797,7 @@ public class DynmapPlugin
if(!onblockchange) return; if(!onblockchange) return;
BlockUpdateRec r = new BlockUpdateRec(); BlockUpdateRec r = new BlockUpdateRec();
r.w = event.getWorld(); 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); ForgeWorld fw = getWorld((ServerLevel)r.w, false);
if (fw == null) return; if (fw == null) return;
r.wid = fw.getName(); r.wid = fw.getName();

View File

@ -1797,6 +1797,7 @@ public class DynmapPlugin
if(!onblockchange) return; if(!onblockchange) return;
BlockUpdateRec r = new BlockUpdateRec(); BlockUpdateRec r = new BlockUpdateRec();
r.w = event.getWorld(); 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); ForgeWorld fw = getWorld((ServerLevel)r.w, false);
if (fw == null) return; if (fw == null) return;
r.wid = fw.getName(); r.wid = fw.getName();