forked from kaboomserver/extras
fix: restrict spawners, a lot
LOL! Whoops!
This commit is contained in:
parent
a58ef649cf
commit
70f7134de9
1 changed files with 22 additions and 11 deletions
|
@ -131,23 +131,34 @@ public final class EntitySpawn implements Listener {
|
|||
}
|
||||
|
||||
private void limitSpawner(final CreatureSpawner spawner) {
|
||||
if (EntityType.MINECART_MOB_SPAWNER.equals(spawner.getSpawnedType())) {
|
||||
spawner.setSpawnedType(EntityType.MINECART);
|
||||
}
|
||||
|
||||
if (spawner.getDelay() > 100) {
|
||||
spawner.setMaxSpawnDelay(100);
|
||||
spawner.setDelay(100);
|
||||
final EntityType spawnedType = spawner.getSpawnedType();
|
||||
if (!spawnedType.isAlive() || spawnedType.equals(EntityType.ARMOR_STAND)) {
|
||||
spawner.setSpawnedType(EntityType.PIG);
|
||||
spawner.update();
|
||||
}
|
||||
|
||||
if (spawner.getSpawnCount() > 200) {
|
||||
spawner.setSpawnCount(200);
|
||||
if (spawner.getMinSpawnDelay() <= 5000) {
|
||||
spawner.setMinSpawnDelay(5000);
|
||||
spawner.update();
|
||||
}
|
||||
|
||||
if (spawner.getSpawnRange() > 50) {
|
||||
spawner.setSpawnRange(50);
|
||||
if (spawner.getMaxSpawnDelay() <= 10000) {
|
||||
spawner.setMaxSpawnDelay(10000);
|
||||
spawner.update();
|
||||
}
|
||||
|
||||
if (spawner.getDelay() <= 5000) {
|
||||
spawner.setDelay(5000);
|
||||
spawner.update();
|
||||
}
|
||||
|
||||
if (spawner.getSpawnCount() > 10) {
|
||||
spawner.setSpawnCount(10);
|
||||
spawner.update();
|
||||
}
|
||||
|
||||
if (spawner.getSpawnRange() > 10) {
|
||||
spawner.setSpawnRange(10);
|
||||
spawner.update();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue