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:
parent
78524cb95e
commit
19bfb10583
3 changed files with 85 additions and 7 deletions
|
@ -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())) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue