diff options
-rw-r--r-- | src/main/java/org/bukkit/Server.java | 38 | ||||
-rw-r--r-- | src/main/java/org/bukkit/World.java | 84 |
2 files changed, 122 insertions, 0 deletions
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 @@ -182,6 +182,44 @@ public interface Server extends PluginMessageRecipient { public File getUpdateFolderFile(); /** + * Gets default ticks per animal spawns value + * <p /> + * <b>Example Usage:</b> + * <ul> + * <li>A value of 1 will mean the server will attempt to spawn monsters every tick. + * <li>A value of 400 will mean the server will attempt to spawn monsters every 400th tick. + * <li>A value below 0 will be reset back to Minecraft's default. + * </ul> + * <p /> + * <b>Note:</b> + * If set to 0, animal spawning will be disabled. We recommend using spawn-animals to control this instead. + * <p /> + * Minecraft default: 400. + * + * @return The default ticks per animal spawns value + */ + public int getTicksPerAnimalSpawns(); + + /** + * Gets the default ticks per monster spawns value + * <p /> + * <b>Example Usage:</b> + * <ul> + * <li>A value of 1 will mean the server will attempt to spawn monsters every tick. + * <li>A value of 400 will mean the server will attempt to spawn monsters every 400th tick. + * <li>A value below 0 will be reset back to Minecraft's default. + * </ul> + * <p /> + * <b>Note:</b> + * If set to 0, monsters spawning will be disabled. We recommend using spawn-monsters to control this instead. + * <p /> + * Minecraft default: 1. + * + * @return The default ticks per monsters spawn value + */ + public int getTicksPerMonsterSpawns(); + + /** * Gets a player object by the given username * <p /> * This method may not return objects for offline players 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 @@ -769,6 +769,90 @@ public interface World extends PluginMessageRecipient { public boolean canGenerateStructures(); /** + * Gets the world's ticks per animal spawns value + * <p /> + * This value determines how many ticks there are between attempts to spawn animals. + * <p /> + * <b>Example Usage:</b> + * <ul> + * <li>A value of 1 will mean the server will attempt to spawn animals in this world every tick. + * <li>A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick. + * <li>A value below 0 will be reset back to Minecraft's default. + * </ul> + * <p /> + * <b>Note:</b> + * If set to 0, animal spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + * <p /> + * Minecraft default: 400. + * + * @return The world's ticks per animal spawns value + */ + public long getTicksPerAnimalSpawns(); + + /** + * Sets the world's ticks per animal spawns value + * <p /> + * This value determines how many ticks there are between attempts to spawn animals. + * <p /> + * <b>Example Usage:</b> + * <ul> + * <li>A value of 1 will mean the server will attempt to spawn animals in this world every tick. + * <li>A value of 400 will mean the server will attempt to spawn animals in this world every 400th tick. + * <li>A value below 0 will be reset back to Minecraft's default. + * </ul> + * <p /> + * <b>Note:</b> + * If set to 0, animal spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + * <p /> + * 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 + * <p /> + * This value determines how many ticks there are between attempts to spawn monsters. + * <p /> + * <b>Example Usage:</b> + * <ul> + * <li>A value of 1 will mean the server will attempt to spawn monsters in this world every tick. + * <li>A value of 400 will mean the server will attempt to spawn monsters in this world every 400th tick. + * <li>A value below 0 will be reset back to Minecraft's default. + * </ul> + * <p /> + * <b>Note:</b> + * If set to 0, monsters spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + * <p /> + * Minecraft default: 1. + * + * @return The world's ticks per monster spawns value + */ + public long getTicksPerMonsterSpawns(); + + /** + * Sets the world's ticks per monster spawns value + * <p /> + * This value determines how many ticks there are between attempts to spawn monsters. + * <p /> + * <b>Example Usage:</b> + * <ul> + * <li>A value of 1 will mean the server will attempt to spawn monsters in this world on every tick. + * <li>A value of 400 will mean the server will attempt to spawn monsters in this world every 400th tick. + * <li>A value below 0 will be reset back to Minecraft's default. + * </ul> + * <p /> + * <b>Note:</b> + * If set to 0, monsters spawning will be disabled for this world. We recommend using {@link #setSpawnFlags(boolean, boolean)} to control this instead. + * <p /> + * 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 */ public enum Environment { |