From 4043d5abcb7a67876fdfdff6023e11f945aa14d0 Mon Sep 17 00:00:00 2001 From: "main()" Date: Sat, 22 Dec 2012 00:53:03 +0100 Subject: [PATCH] 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. --- .../MultiverseCore/utils/WorldManager.java | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java b/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java index 63c786f8..4f266407 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/WorldManager.java @@ -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); }