From ec01da91bbba8d4a1d928df6273389923491e75e Mon Sep 17 00:00:00 2001 From: EvilSeph Date: Fri, 10 Feb 2012 10:23:21 -0500 Subject: Added configurable animal and monster ticks per spawn setting. --- src/main/java/org/bukkit/Server.java | 38 ++++++++++++++++ src/main/java/org/bukkit/World.java | 84 ++++++++++++++++++++++++++++++++++++ 2 files changed, 122 insertions(+) diff --git a/src/main/java/org/bukkit/Server.java b/src/main/java/org/bukkit/Server.java index 0eca908e..f271e00e 100644 --- a/src/main/java/org/bukkit/Server.java +++ b/src/main/java/org/bukkit/Server.java @@ -181,6 +181,44 @@ public interface Server extends PluginMessageRecipient { */ public File getUpdateFolderFile(); + /** + * Gets default ticks per animal spawns value + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, animal spawning will be disabled. We recommend using spawn-animals to control this instead. + *

+ * Minecraft default: 400. + * + * @return The default ticks per animal spawns value + */ + public int getTicksPerAnimalSpawns(); + + /** + * Gets the default ticks per monster spawns value + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, monsters spawning will be disabled. We recommend using spawn-monsters to control this instead. + *

+ * Minecraft default: 1. + * + * @return The default ticks per monsters spawn value + */ + public int getTicksPerMonsterSpawns(); + /** * Gets a player object by the given username *

diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 368a5e4f..d4acd762 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -768,6 +768,90 @@ public interface World extends PluginMessageRecipient { */ public boolean canGenerateStructures(); + /** + * Gets the world's ticks per animal spawns value + *

+ * This value determines how many ticks there are between attempts to spawn animals. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, animal spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + *

+ * Minecraft default: 400. + * + * @return The world's ticks per animal spawns value + */ + public long getTicksPerAnimalSpawns(); + + /** + * Sets the world's ticks per animal spawns value + *

+ * This value determines how many ticks there are between attempts to spawn animals. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, animal spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + *

+ * Minecraft default: 400. + * + * @param ticksPerAnimalSpawns the ticks per animal spawns value you want to set the world to + */ + public void setTicksPerAnimalSpawns(int ticksPerAnimalSpawns); + + /** + * Gets the world's ticks per monster spawns value + *

+ * This value determines how many ticks there are between attempts to spawn monsters. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, monsters spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + *

+ * Minecraft default: 1. + * + * @return The world's ticks per monster spawns value + */ + public long getTicksPerMonsterSpawns(); + + /** + * Sets the world's ticks per monster spawns value + *

+ * This value determines how many ticks there are between attempts to spawn monsters. + *

+ * Example Usage: + *

+ *

+ * Note: + * If set to 0, monsters spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + *

+ * Minecraft default: 1. + * + * @param ticksPerMonsterSpawns the ticks per monster spawns value you want to set the world to + */ + public void setTicksPerMonsterSpawns(int ticksPerMonsterSpawns); + /** * Represents various map environment types that a world may be */ -- cgit v1.2.3