diff --git a/paper-api/src/main/java/org/bukkit/Server.java b/paper-api/src/main/java/org/bukkit/Server.java index 0eca908e3d..f271e00e8d 100644 --- a/paper-api/src/main/java/org/bukkit/Server.java +++ b/paper-api/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/paper-api/src/main/java/org/bukkit/World.java b/paper-api/src/main/java/org/bukkit/World.java index 368a5e4f2f..d4acd762c0 100644 --- a/paper-api/src/main/java/org/bukkit/World.java +++ b/paper-api/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 */