diff options
Diffstat (limited to 'src/main/java/org/bukkit/craftbukkit/CraftServer.java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 170e0911..04d825d6 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -142,6 +142,9 @@ public final class CraftServer implements Server { private final EntityMetadataStore entityMetadata = new EntityMetadataStore(); private final PlayerMetadataStore playerMetadata = new PlayerMetadataStore(); private final WorldMetadataStore worldMetadata = new WorldMetadataStore(); + private int monsterSpawn = -1; + private int animalSpawn = -1; + private int waterAnimalSpawn = -1; static { ConfigurationSerialization.registerClass(CraftOfflinePlayer.class); @@ -172,6 +175,9 @@ public final class CraftServer implements Server { configuration.setDefaults(YamlConfiguration.loadConfiguration(getClass().getClassLoader().getResourceAsStream("configurations/bukkit.yml"))); saveConfig(); ((SimplePluginManager) pluginManager).useTimings(configuration.getBoolean("settings.plugin-profiling")); + monsterSpawn = configuration.getInt("spawn-limits.monsters"); + animalSpawn = configuration.getInt("spawn-limits.animals"); + waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); updater = new AutoUpdater(new BukkitDLUpdaterService(configuration.getString("auto-updater.host")), getLogger(), configuration.getString("auto-updater.preferred-channel")); updater.setEnabled(configuration.getBoolean("auto-updater.enabled")); @@ -493,6 +499,9 @@ public final class CraftServer implements Server { console.spawnAnimals = config.getBoolean("spawn-animals", console.spawnAnimals); console.pvpMode = config.getBoolean("pvp", console.pvpMode); console.allowFlight = config.getBoolean("allow-flight", console.allowFlight); + monsterSpawn = configuration.getInt("spawn-limits.monsters"); + animalSpawn = configuration.getInt("spawn-limits.animals"); + waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals"); for (WorldServer world : console.worlds) { world.difficulty = difficulty; @@ -1161,4 +1170,16 @@ public final class CraftServer implements Server { public SimpleCommandMap getCommandMap() { return commandMap; } + + public int getMonsterSpawnLimit() { + return monsterSpawn; + } + + public int getAnimalSpawnLimit() { + return animalSpawn; + } + + public int getWaterAnimalSpawnLimit() { + return waterAnimalSpawn; + } } |