Getting the generator is now wrapped in a try block.

The Bukkit API calls a plugin method. If that method throws exceptions, they fall through right into our face and then Bukkit blames us. Not good.
Thanks andrewkm for mentioning this.
This commit is contained in:
main() 2012-12-22 00:53:03 +01:00
parent eff56f74da
commit 4043d5abcb
1 changed files with 9 additions and 2 deletions

View File

@ -370,8 +370,15 @@ public class WorldManager implements MVWorldManager {
if (type != null) {
creator.type(type);
}
if ((world.getGenerator() != null) && (!world.getGenerator().equals("null")))
creator.generator(world.getGenerator());
if ((world.getGenerator() != null) && (!world.getGenerator().equals("null"))) {
try {
creator.generator(world.getGenerator());
} catch (Throwable t) {
Logging.warning("Failed to set the generator for world '%s' to '%s': %s", name, world.getGenerator(), t);
Logging.warning("World '%s' was NOT loaded!", name);
return false;
}
}
return doLoad(creator, ignoreExists);
}