From 6e7daf4e851c6950c3904ff1968590484c9facd3 Mon Sep 17 00:00:00 2001 From: Eric Stokes Date: Mon, 3 Oct 2011 19:40:21 -0600 Subject: [PATCH] And this is why we need unit tests... --- src/main/java/com/onarandombox/MultiverseCore/MVWorld.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java index 6885b260..32693508 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java @@ -749,13 +749,15 @@ public class MVWorld { int diff = Integer.parseInt(difficulty); if (diff >= 0 && diff <= 3) { worlddiff = Difficulty.getByValue(diff); + } else { + return false; } } catch (Exception e2) { return false; } } this.getCBWorld().setDifficulty(worlddiff); - config.setProperty("worlds." + this.name + ".difficulty", worlddiff); + config.setProperty("worlds." + this.name + ".difficulty", worlddiff.getValue()); saveConfig(); return true; }