diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/Bukkit.java | 12 | ||||
-rw-r--r-- | src/main/java/org/bukkit/Server.java | 18 | ||||
-rw-r--r-- | src/main/java/org/bukkit/World.java | 42 |
3 files changed, 72 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/Bukkit.java b/src/main/java/org/bukkit/Bukkit.java index 86547007..8654b50a 100644 --- a/src/main/java/org/bukkit/Bukkit.java +++ b/src/main/java/org/bukkit/Bukkit.java @@ -353,4 +353,16 @@ public final class Bukkit { public static HelpMap getHelpMap() { return server.getHelpMap(); } + + public static int getMonsterSpawnLimit() { + return server.getMonsterSpawnLimit(); + } + + public static int getAnimalSpawnLimit() { + return server.getAnimalSpawnLimit(); + } + + public static int getWaterAnimalSpawnLimit() { + return server.getWaterAnimalSpawnLimit(); + } } diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 44f44af4..119685a5 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -621,4 +621,22 @@ public interface Server extends PluginMessageRecipient { * @throws IllegalArgumentException If the size is not a multiple of 9. */ Inventory createInventory(InventoryHolder owner, int size, String title); + + /** + * Gets user-specified limit for number of monsters that can spawn in a chunk + * @returns The monster spawn limit + */ + int getMonsterSpawnLimit(); + + /** + * Gets user-specified limit for number of animals that can spawn in a chunk + * @returns The animal spawn limit + */ + int getAnimalSpawnLimit(); + + /** + * Gets user-specified limit for number of water animals that can spawn in a chunk + * @returns The water animal spawn limit + */ + int getWaterAnimalSpawnLimit(); }
\ No newline at end of file diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 2035a93b..dae10d78 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -896,6 +896,48 @@ public interface World extends PluginMessageRecipient, Metadatable { public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns); /** + * Gets limit for number of monsters that can spawn in a chunk in this world + * @returns The monster spawn limit + */ + int getMonsterSpawnLimit(); + + /** + * Sets the limit for number of monsters that can spawn in a chunk in this world + * <p /> + * <b>Note:</b> + * If set to a negative number the world will use the server-wide spawn limit instead. + */ + void setMonsterSpawnLimit(int limit); + + /** + * Gets the limit for number of animals that can spawn in a chunk in this world + * @returns The animal spawn limit + */ + int getAnimalSpawnLimit(); + + /** + * Sets the limit for number of animals that can spawn in a chunk in this world + * <p /> + * <b>Note:</b> + * If set to a negative number the world will use the server-wide spawn limit instead. + */ + void setAnimalSpawnLimit(int limit); + + /** + * Gets the limit for number of water animals that can spawn in a chunk in this world + * @returns The water animal spawn limit + */ + int getWaterAnimalSpawnLimit(); + + /** + * Sets the limit for number of water animals that can spawn in a chunk in this world + * <p /> + * <b>Note:</b> + * If set to a negative number the world will use the server-wide spawn limit instead. + */ + void setWaterAnimalSpawnLimit(int limit); + + /** * Represents various map environment types that a world may be */ public enum Environment { |