diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java index beb014dc..986345a7 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java @@ -74,6 +74,8 @@ public class MVWorld { private boolean allowAnimals; // Does this World allow Animals to Spawn? private boolean allowMonsters; // Does this World allow Monsters to Spawn? + private boolean keepSpawnInMemory; // Does the World have the spawn loaded all the time? + private Boolean pvp; // Does this World allow PVP? private Boolean fakepvp; // Should this world have fakePVP on? (used for PVP zones) @@ -131,6 +133,8 @@ public class MVWorld { this.setCurrency(config.getInt("worlds." + this.name + ".entryfee.currency", -1)); this.getMobExceptions(); + this.setSpawnInMemory(config.getBoolean("worlds." + this.name + ".keepspawninmemory", true)); + this.getWorldBlacklist().addAll(config.getStringList("worlds." + this.name + ".worldblacklist", new ArrayList())); this.getBlockBlacklist().addAll(config.getIntList("worlds." + this.name + ".blockblacklist", new ArrayList())); this.translateTempSpawn(config); @@ -338,16 +342,24 @@ public class MVWorld { if (name.equalsIgnoreCase("pvp")) { this.setPvp(value); } else if (name.equalsIgnoreCase("animals")) { - this.setAnimals(value); } else if (name.equalsIgnoreCase("monsters")) { this.setMonsters(value); + } else if (name.equalsIgnoreCase("memory") || name.equalsIgnoreCase("spawnmemory")) { + this.setSpawnInMemory(value); } else { - return false; + return false; } return true; } + private void setSpawnInMemory(boolean value) { + this.world.setKeepSpawnInMemory(value); + this.keepSpawnInMemory = value; + this.config.setProperty("worlds." + this.name + ".keepspawninmemory", value); + saveConfig(); + } + private boolean setVariable(String name, double value) { if (name.equalsIgnoreCase("scaling") || name.equalsIgnoreCase("scale")) { this.setScaling(value); @@ -363,7 +375,7 @@ public class MVWorld { /** * This is the one people have access to. It'll handle the rest. - * + * * @param name * @param value * @return diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java index 0134b2ae..5bb6af6a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ModifyCommand.java @@ -21,7 +21,7 @@ enum Action { // Color == Aliascolor enum SetProperties { - alias, animals, monsters, pvp, scaling, aliascolor, color, respawn, currency, curr, price, scale + alias, animals, monsters, pvp, scaling, aliascolor, color, respawn, currency, curr, price, scale, spawnmemory, memory } public class ModifyCommand extends MultiverseCommand {