From 9beac6a2a45ec61027c505acd0382122b1364d39 Mon Sep 17 00:00:00 2001 From: Jake Date: Sat, 27 Nov 2021 22:31:38 -0800 Subject: [PATCH] Fix hostile mob spawning Upstream adds this check and didn't flip it since mojang flipped the return boolean from previous versions. This will end up removed from this patch when (if) upstream fixes this --- ...Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch b/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch index bdd12d1e9d..7a0006e19e 100644 --- a/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch +++ b/patches/server/0432-Optimize-anyPlayerCloseEnoughForSpawning-to-use-dist.patch @@ -272,7 +272,7 @@ index 8868ffcda194e8c2300181a2cdda9337dbde6284..95f195980e28bb59f43e5ca1d5e79ebe public String getDebugStatus() { diff --git a/src/main/java/net/minecraft/server/level/ServerChunkCache.java b/src/main/java/net/minecraft/server/level/ServerChunkCache.java -index a66d9d6df1fc0ad68f51ea96d4e1a2d725c73b05..c3875acfad91c50a7fec4b1f8e06e8a32e2ea037 100644 +index a66d9d6df1fc0ad68f51ea96d4e1a2d725c73b05..f02643d12ac1959d92e895174b22775ee18a32d8 100644 --- a/src/main/java/net/minecraft/server/level/ServerChunkCache.java +++ b/src/main/java/net/minecraft/server/level/ServerChunkCache.java @@ -881,6 +881,37 @@ public class ServerChunkCache extends ChunkSource { @@ -338,7 +338,7 @@ index a66d9d6df1fc0ad68f51ea96d4e1a2d725c73b05..c3875acfad91c50a7fec4b1f8e06e8a3 + if (this.level.isPositionEntityTicking(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkproviderserver_a.holder, chunkcoordintpair, false)) { // Paper - optimise isOutsideOfRange chunk1.incrementInhabitedTime(j); - if (flag2 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && !this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkcoordintpair, true)) { // Spigot -+ if (flag2 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && !this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkproviderserver_a.holder, chunkcoordintpair, true)) { // Spigot // Paper - optimise isOutsideOfRange ++ if (flag2 && (this.spawnEnemies || this.spawnFriendlies) && this.level.getWorldBorder().isWithinBounds(chunkcoordintpair) && this.chunkMap.anyPlayerCloseEnoughForSpawning(chunkproviderserver_a.holder, chunkcoordintpair, true)) { // Spigot // Paper - optimise isOutsideOfRange NaturalSpawner.spawnForChunk(this.level, chunk1, spawnercreature_d, this.spawnFriendlies, this.spawnEnemies, flag1); }