From be8ff3ad6da3fb500f0aebf223fe9b300ffee39b Mon Sep 17 00:00:00 2001 From: Eric Stokes Date: Sun, 26 Jun 2011 09:16:26 -0600 Subject: [PATCH] Fix null environments for worlds --- src/com/onarandombox/MultiverseCore/MVWorld.java | 3 ++- src/com/onarandombox/MultiverseCore/MultiverseCore.java | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/com/onarandombox/MultiverseCore/MVWorld.java b/src/com/onarandombox/MultiverseCore/MVWorld.java index b7bca350..988cde96 100644 --- a/src/com/onarandombox/MultiverseCore/MVWorld.java +++ b/src/com/onarandombox/MultiverseCore/MVWorld.java @@ -50,6 +50,7 @@ public class MVWorld { this.generator = world.getGenerator(); this.generatorString = generatorString; this.seed = seed; + this.environment = world.getEnvironment(); this.initLists(); @@ -78,7 +79,7 @@ public class MVWorld { this.setRealMobBehaviors(); - config.setProperty("worlds." + this.name + ".environment", world.getEnvironment()); + config.setProperty("worlds." + this.name + ".environment", this.environment); config.setProperty("worlds." + this.name + ".generatorString",generatorString); if (seed != null) { config.setProperty("worlds." + this.name + ".seed", this.seed); diff --git a/src/com/onarandombox/MultiverseCore/MultiverseCore.java b/src/com/onarandombox/MultiverseCore/MultiverseCore.java index 78d8bc5f..c27fb8ff 100644 --- a/src/com/onarandombox/MultiverseCore/MultiverseCore.java +++ b/src/com/onarandombox/MultiverseCore/MultiverseCore.java @@ -393,7 +393,7 @@ public class MultiverseCore extends JavaPlugin { public boolean addWorld(String name, Environment env, String seedString, String generator) { Long seed = null; - if (seedString.length() > 0) { + if (seedString != null && seedString.length() > 0) { try { seed = Long.parseLong(seedString); } catch (NumberFormatException numberformatexception) {