Skip to content

Commit a0673ac

Browse files
authored
Merge pull request #3344 from Multiverse/fix/test-generator
Pass empty string instead of null for generator id and improve error message
2 parents 608cb86 + 7735a33 commit a0673ac

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/main/java/org/mvplugins/multiverse/core/world/generators/GeneratorProvider.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,15 +95,19 @@ private void loadPluginGenerators() {
9595
private boolean testIsGeneratorPlugin(Plugin plugin) {
9696
String worldName = Bukkit.getWorlds().stream().findFirst().map(World::getName).orElse("world");
9797
try {
98-
return plugin.getDefaultWorldGenerator(worldName, null) != null;
98+
return plugin.getDefaultWorldGenerator(worldName, "") != null;
9999
} catch (UnsupportedOperationException e) {
100100
// Some plugins throw this if they don't support world generation
101101
return false;
102102
} catch (Throwable t) {
103103
Logging.warning("Plugin %s threw an exception when testing if it is a generator plugin! ",
104104
plugin.getName());
105-
Logging.warning("This is NOT a bug in Multiverse. Do NOT report this to Multiverse support.");
106-
t.printStackTrace();
105+
Logging.warning("Error by plugin %s: %s", plugin.getName(), t.getMessage());
106+
Logging.warning("This is NOT a bug in Multiverse. Do NOT report this to Multiverse support. " +
107+
"Enable debug mode with `/mv debug 1` to see the full stack trace.");
108+
if (coreConfig.getGlobalDebug() >= 1) {
109+
t.printStackTrace();
110+
}
107111
// Assume it's a generator plugin since it tried to do something, most likely the id is wrong.
108112
return true;
109113
}

0 commit comments

Comments
 (0)