diff --git a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java index 5a59f5db..c51ba86e 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java +++ b/src/main/java/com/onarandombox/MultiverseCore/MVWorld.java @@ -78,6 +78,8 @@ public class MVWorld extends SerializationConfig implements MultiverseWorld { PROPERTY_ALIASES.put("spawnlocation", "spawn"); PROPERTY_ALIASES.put("animals", "spawning.animals.spawn"); PROPERTY_ALIASES.put("monsters", "spawning.monsters.spawn"); + PROPERTY_ALIASES.put("animalsrate", "spawning.animals.spawnrate"); + PROPERTY_ALIASES.put("monstersrate", "spawning.monsters.spawnrate"); } /* * We have to use setCBWorld(), setPlugin() and initPerms() to prepare this object for use. @@ -233,6 +235,12 @@ public class MVWorld extends SerializationConfig implements MultiverseWorld { } else { allowMonsters = true; } + if (MVWorld.this.spawning.getAnimalSettings().getSpawnRate() != -1) { + world.get().setTicksPerAnimalSpawns(MVWorld.this.spawning.getAnimalSettings().getSpawnRate()); + } + if (MVWorld.this.spawning.getMonsterSettings().getSpawnRate() != -1) { + world.get().setTicksPerMonsterSpawns(MVWorld.this.spawning.getMonsterSettings().getSpawnRate()); + } world.get().setSpawnFlags(allowMonsters, allowAnimals); plugin.getMVWorldManager().getTheWorldPurger().purgeWorld(MVWorld.this); return super.validateChange(property, newValue, oldValue, object); diff --git a/src/main/java/com/onarandombox/MultiverseCore/configuration/SubSpawnSettings.java b/src/main/java/com/onarandombox/MultiverseCore/configuration/SubSpawnSettings.java index d66bd133..8d66d9e3 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/configuration/SubSpawnSettings.java +++ b/src/main/java/com/onarandombox/MultiverseCore/configuration/SubSpawnSettings.java @@ -17,6 +17,8 @@ public class SubSpawnSettings extends SerializationConfig { @Property private boolean spawn; @Property + private int spawnrate; + @Property private List exceptions; public SubSpawnSettings() { @@ -34,6 +36,7 @@ public class SubSpawnSettings extends SerializationConfig { public void setDefaults() { spawn = true; exceptions = new ArrayList(); + spawnrate = -1; } /** @@ -51,9 +54,24 @@ public class SubSpawnSettings extends SerializationConfig { } /** - * @return the exceptions + * @return The exceptions */ public List getExceptions() { return exceptions; } + + /** + * + * @param The new spawn rate + */ + public void setSpawnRate(int rate) { + this.spawnrate = rate; + } + + /** + * @return The spawn rate + */ + public int getSpawnRate() { + return this.spawnrate; + } }