mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-03 13:42:25 -07:00
Fix Mob Spawning Relative to View Distance
Changes the mob spawning algorithm to properly account for view distance and the range around players. Needs better documentation. By: md_5 <git@md-5.net>
This commit is contained in:
@@ -146,7 +146,13 @@
|
||||
} else {
|
||||
list1 = List.of();
|
||||
}
|
||||
@@ -425,7 +473,9 @@
|
||||
@@ -420,12 +468,14 @@
|
||||
ChunkPos chunkcoordintpair = chunk.getPos();
|
||||
|
||||
chunk.incrementInhabitedTime(timeDelta);
|
||||
- if (!list1.isEmpty() && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair)) {
|
||||
+ if (!list1.isEmpty() && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair, true)) { // Spigot
|
||||
NaturalSpawner.spawnForChunk(this.level, chunk, spawnercreature_d, list1);
|
||||
}
|
||||
|
||||
if (this.level.shouldTickBlocksAt(chunkcoordintpair.toLong())) {
|
||||
|
Reference in New Issue
Block a user