Add configuration options for water_ambient spawning

By: md_5 <git@md-5.net>
This commit is contained in:
Bukkit/Spigot
2020-06-26 18:39:34 +10:00
parent 3ed2628aa9
commit 4cf580fde0
3 changed files with 124 additions and 0 deletions

View File

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