Make despawn distance configs per-category, improve per category spawn limit config (#6717)
Also adds per-world spawn limit config in paper.yml for `underground_water_creature`, and migrates existing spawn limit config options to their Mojang names.
This commit is contained in:
@@ -226,7 +226,7 @@ index 0000000000000000000000000000000000000000..00000000000000000000000000000000
|
||||
} else if (!this.isPersistenceRequired() && !this.requiresCustomPersistence()) {
|
||||
- Player entityhuman = this.level.findNearbyPlayer(this, -1.0D, EntitySelector.affectsSpawning); // Paper
|
||||
+ // Paper start - optimise checkDespawn
|
||||
+ Player entityhuman = this.level.findNearbyPlayer(this, level.paperConfig.hardDespawnDistance + 1, EntitySelector.affectsSpawning); // Paper
|
||||
+ Player entityhuman = this.level.findNearbyPlayer(this, level.paperConfig.hardDespawnDistances.getInt(this.getType().getCategory()) + 1, EntitySelector.affectsSpawning); // Paper
|
||||
+ if (entityhuman == null) {
|
||||
+ entityhuman = ((ServerLevel)this.level).playersAffectingSpawning.isEmpty() ? null : ((ServerLevel)this.level).playersAffectingSpawning.get(0);
|
||||
+ }
|
||||
|
||||
Reference in New Issue
Block a user