Fix deprecated method calls

This commit is contained in:
tastybento 2023-02-04 09:15:07 -08:00
parent 7aa5dc6187
commit c0e7b6072c
1 changed files with 7 additions and 6 deletions

View File

@ -7,6 +7,7 @@ import org.bukkit.World;
import org.bukkit.World.Environment;
import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.bukkit.entity.SpawnCategory;
import org.bukkit.generator.ChunkGenerator;
import org.eclipse.jdt.annotation.NonNull;
import org.eclipse.jdt.annotation.Nullable;
@ -147,22 +148,22 @@ public class AcidIsland extends GameModeAddon {
// Set spawn rates
if (w != null && getSettings() != null) {
if (getSettings().getSpawnLimitMonsters() > 0) {
w.setMonsterSpawnLimit(getSettings().getSpawnLimitMonsters());
w.setSpawnLimit(SpawnCategory.MONSTER, getSettings().getSpawnLimitMonsters());
}
if (getSettings().getSpawnLimitAmbient() > 0) {
w.setAmbientSpawnLimit(getSettings().getSpawnLimitAmbient());
w.setSpawnLimit(SpawnCategory.AMBIENT, getSettings().getSpawnLimitAmbient());
}
if (getSettings().getSpawnLimitAnimals() > 0) {
w.setAnimalSpawnLimit(getSettings().getSpawnLimitAnimals());
w.setSpawnLimit(SpawnCategory.ANIMAL, getSettings().getSpawnLimitAnimals());
}
if (getSettings().getSpawnLimitWaterAnimals() > 0) {
w.setWaterAnimalSpawnLimit(getSettings().getSpawnLimitWaterAnimals());
w.setSpawnLimit(SpawnCategory.WATER_ANIMAL, getSettings().getSpawnLimitWaterAnimals());
}
if (getSettings().getTicksPerAnimalSpawns() > 0) {
w.setTicksPerAnimalSpawns(getSettings().getTicksPerAnimalSpawns());
w.setTicksPerSpawns(SpawnCategory.ANIMAL, getSettings().getTicksPerAnimalSpawns());
}
if (getSettings().getTicksPerMonsterSpawns() > 0) {
w.setTicksPerMonsterSpawns(getSettings().getTicksPerMonsterSpawns());
w.setTicksPerSpawns(SpawnCategory.MONSTER, getSettings().getTicksPerMonsterSpawns());
}
}
return w;