From 4bc80b8a44f3d7aa3bf44f265f0959b4e801790e Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 1 Dec 2024 13:53:04 -0800 Subject: [PATCH] Do not break when PlayerNaturallySpawnCreaturesEvent is cancelled If there is a player nearby which had its event not cancelled, then that should take precedence. --- patches/server/0163-PlayerNaturallySpawnCreaturesEvent.patch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/patches/server/0163-PlayerNaturallySpawnCreaturesEvent.patch b/patches/server/0163-PlayerNaturallySpawnCreaturesEvent.patch index cb145ad224..b510c92555 100644 --- a/patches/server/0163-PlayerNaturallySpawnCreaturesEvent.patch +++ b/patches/server/0163-PlayerNaturallySpawnCreaturesEvent.patch @@ -9,7 +9,7 @@ from triggering monster spawns on a server. Also a highly more effecient way to blanket block spawns in a world diff --git a/src/main/java/net/minecraft/server/level/ChunkMap.java b/src/main/java/net/minecraft/server/level/ChunkMap.java -index 261943f1f188643793a72bd239dfc5fe604e3b99..ebe6c631d772cf41038701aafbe4e0bbb024f7f5 100644 +index 261943f1f188643793a72bd239dfc5fe604e3b99..e211cd62b9381df353c0921bfaa6ad63f251a6ac 100644 --- a/src/main/java/net/minecraft/server/level/ChunkMap.java +++ b/src/main/java/net/minecraft/server/level/ChunkMap.java @@ -1094,11 +1094,7 @@ public class ChunkMap extends ChunkStorage implements ChunkHolder.PlayerProvider @@ -34,7 +34,7 @@ index 261943f1f188643793a72bd239dfc5fe604e3b99..ebe6c631d772cf41038701aafbe4e0bb + blockRange = 16384.0D; + if (reducedRange) { + event = entityplayer.playerNaturallySpawnedEvent; -+ if (event == null || event.isCancelled()) return false; ++ if (event == null || event.isCancelled()) continue; + blockRange = (double) ((event.getSpawnRadius() << 4) * (event.getSpawnRadius() << 4)); + } + // Paper end - PlayerNaturallySpawnCreaturesEvent