mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-09 16:42:03 -07:00
Implement API for ambient mob spawn limit. Add spawn-limit.ambient to
bukkit.yml. Adds BUKKIT-2765
This commit is contained in:
@@ -155,6 +155,7 @@ public final class CraftServer implements Server {
|
||||
private int monsterSpawn = -1;
|
||||
private int animalSpawn = -1;
|
||||
private int waterAnimalSpawn = -1;
|
||||
private int ambientSpawn = -1;
|
||||
private File container;
|
||||
private WarningState warningState = WarningState.DEFAULT;
|
||||
|
||||
@@ -190,6 +191,7 @@ public final class CraftServer implements Server {
|
||||
monsterSpawn = configuration.getInt("spawn-limits.monsters");
|
||||
animalSpawn = configuration.getInt("spawn-limits.animals");
|
||||
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
|
||||
ambientSpawn = configuration.getInt("spawn-limits.ambient");
|
||||
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
|
||||
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
|
||||
|
||||
@@ -526,6 +528,7 @@ public final class CraftServer implements Server {
|
||||
monsterSpawn = configuration.getInt("spawn-limits.monsters");
|
||||
animalSpawn = configuration.getInt("spawn-limits.animals");
|
||||
waterAnimalSpawn = configuration.getInt("spawn-limits.water-animals");
|
||||
ambientSpawn = configuration.getInt("spawn-limits.ambient");
|
||||
warningState = WarningState.value(configuration.getString("settings.deprecated-verbose"));
|
||||
console.autosavePeriod = configuration.getInt("ticks-per.autosave");
|
||||
|
||||
@@ -1236,6 +1239,10 @@ public final class CraftServer implements Server {
|
||||
return waterAnimalSpawn;
|
||||
}
|
||||
|
||||
public int getAmbientSpawnLimit() {
|
||||
return ambientSpawn;
|
||||
}
|
||||
|
||||
public boolean isPrimaryThread() {
|
||||
return Thread.currentThread().equals(console.primaryThread);
|
||||
}
|
||||
|
Reference in New Issue
Block a user