From 130d2a83718b64b951527e945a04e00b67ba52c6 Mon Sep 17 00:00:00 2001 From: Byron Marohn Date: Sat, 9 May 2026 21:53:07 +0000 Subject: [PATCH] Return false silently when WorldRegexMatcher tests an unloaded world --- .../playmonumenta/scriptedquests/utils/WorldRegexMatcher.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/plugin/src/main/java/com/playmonumenta/scriptedquests/utils/WorldRegexMatcher.java b/plugin/src/main/java/com/playmonumenta/scriptedquests/utils/WorldRegexMatcher.java index 102b946a..48d9e82c 100644 --- a/plugin/src/main/java/com/playmonumenta/scriptedquests/utils/WorldRegexMatcher.java +++ b/plugin/src/main/java/com/playmonumenta/scriptedquests/utils/WorldRegexMatcher.java @@ -49,6 +49,10 @@ public void onUnloadWorld(World world) { public boolean matches(World world, String worldRegex) { Set matches = mWorldPatternMatches.get(world.getName()); if (matches == null) { + if (Bukkit.getWorld(world.getName()) == null) { + // World is unloaded; no zone can contain an entity in an unloaded world + return false; + } MMLog.severe( "Falling back to slow regex .matches() to test unloaded world: '" + world.getName() + "' against regex: '" + worldRegex + "'", new IllegalStateException("WorldRegexMatcher testing against an unloaded world")