Do not set world mob spawn settings unless they are >0

This commit is contained in:
tastybento 2020-11-27 07:51:57 -08:00
parent 78067971f6
commit 86a078e31f

View File

@ -130,13 +130,25 @@ public class BSkyBlock extends GameModeAddon implements Listener {
World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld(); World w = settings.isUseOwnGenerator() ? wc.createWorld() : wc.generator(chunkGenerator2).createWorld();
// Set spawn rates // Set spawn rates
if (w != null) { if (w != null) {
if (getSettings().getSpawnLimitMonsters() > 0) {
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters()); w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
}
if (getSettings().getSpawnLimitAmbient() > 0) {
w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient()); w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient());
}
if (getSettings().getSpawnLimitAnimals() > 0) {
w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals()); w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals());
}
if (getSettings().getSpawnLimitWaterAnimals() > 0) {
w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals()); w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals());
}
if (getSettings().getTicksPerAnimalSpawns() > 0) {
w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns()); w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns());
}
if (getSettings().getTicksPerMonsterSpawns() > 0) {
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns()); w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
} }
}
return w; return w;
} }