#662: Support for configuring Water Underground Creatures spawn settings

By: Doc <nachito94@msn.com>
This commit is contained in:
Bukkit/Spigot 2021-10-05 11:31:21 +11:00
parent f4b28573d2
commit 8b6e67635a
3 changed files with 121 additions and 0 deletions

View file

@ -451,6 +451,27 @@ public final class Bukkit {
public static int getTicksPerWaterAmbientSpawns() {
return server.getTicksPerAmbientSpawns();
}
/**
* Gets the default ticks per water underground creature spawns value.
* <p>
* <b>Example Usage:</b>
* <ul>
* <li>A value of 1 will mean the server will attempt to spawn water underground creature
* every tick.
* <li>A value of 400 will mean the server will attempt to spawn water underground creature
* 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, water underground creature spawning will be disabled.
* <p>
* Minecraft default: 1.
*
* @return the default ticks per water underground creature spawn value
*/
public static int getTicksPerWaterUndergroundCreatureSpawns() {
return server.getTicksPerWaterUndergroundCreatureSpawns();
}
/**
* Gets a player object by the given username.
@ -1234,6 +1255,15 @@ public final class Bukkit {
return server.getAmbientSpawnLimit();
}
/**
* Get user-specified limit for number of water creature underground that can spawn
* in a chunk.
* @return the water underground creature limit
*/
public static int getWaterUndergroundCreatureSpawnLimit() {
return server.getWaterUndergroundCreatureSpawnLimit();
}
/**
* Gets user-specified limit for number of ambient mobs that can spawn in
* a chunk.