From 91c9e175d091c3d03fc70a07514a72e6f7ad0b3a Mon Sep 17 00:00:00 2001 From: Eric Stokes Date: Tue, 10 Jan 2012 19:29:55 -0700 Subject: [PATCH] Add setActualDifficulty; Fixes #382 I also changed the difficulty properties to use setActualDifficulty. --- .../java/com/onarandombox/MultiverseCore/MVWorld.java | 11 ++++++++++- .../configuration/DifficultyConfigProperty.java | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java index 0d177c1a..22272601 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java @@ -236,7 +236,16 @@ public class MVWorld implements MultiverseWorld { */ public boolean setActualKeepSpawnInMemory() { // Ensure the memory setting is correct - this.world.setKeepSpawnInMemory(this.getKnownProperty("memory", Boolean.class).getValue()); + this.getCBWorld().setKeepSpawnInMemory(this.getKnownProperty("memory", Boolean.class).getValue()); + return true; + } + + /** + * Used by the active difficulty-property to set the "actual" property. + * @return True if the property was successfully set. + */ + public boolean setActualDifficulty() { + this.getCBWorld().setDifficulty(this.getKnownProperty("difficulty", Difficulty.class).getValue()); return true; } diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java index ac457e03..42b692c6 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/DifficultyConfigProperty.java @@ -106,7 +106,7 @@ public class DifficultyConfigProperty implements MVActiveConfigProperty