Added the ability to ignore the max entity count on first spawn.

This commit is contained in:
Brianna 2021-03-30 12:51:04 -05:00
parent 847f86a0ae
commit d0b5ffa339
3 changed files with 12 additions and 0 deletions

View File

@ -125,6 +125,10 @@ public class Settings {
"This value depicts the variable {RAND} in equations used by this plugin",
"It generates a random number between (by default) 1 and 4.");
public static final ConfigSetting IGNORE_MAX_ON_FIRST_SPAWN = new ConfigSetting(config, "Main.Ignore Max On First Spawn", false,
"Should the max entity count around spawners be",
"ignored on their first spawn?");
public static final ConfigSetting REMOVE_CORRUPTED_SPAWNERS = new ConfigSetting(config, "Main.Remove Corrupted Spawners", true,
"Should spawners without valid values be removed?",
"This may need to be disabled for compatibility that use",

View File

@ -172,6 +172,10 @@ public class SpawnOptionEntity_1_12 implements SpawnOption {
maxEntitiesAllowed = ((SpawnConditionNearbyEntities) spawnCondition).getMax();
}
// Should we skip the max entity amount on first spawn?
if (spawner.getSpawnCount() == 0 && Settings.IGNORE_MAX_ON_FIRST_SPAWN.getBoolean())
maxEntitiesAllowed = Integer.MAX_VALUE;
// Get the amount of entities around the spawner.
int size = SpawnConditionNearbyEntities.getEntitiesAroundSpawner(location, true);

View File

@ -219,6 +219,10 @@ public class SpawnOptionEntity_1_13 implements SpawnOption {
maxEntitiesAllowed = ((SpawnConditionNearbyEntities) spawnCondition).getMax();
}
// Should we skip the max entity amount on first spawn?
if (spawner.getSpawnCount() == 0 && Settings.IGNORE_MAX_ON_FIRST_SPAWN.getBoolean())
maxEntitiesAllowed = Integer.MAX_VALUE;
// Get the amount of entities around the spawner.
int size = SpawnConditionNearbyEntities.getEntitiesAroundSpawner(location, true);