From fa9be2477d94d16cfccb8852ec74e226194e5b55 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 3 Dec 2020 18:20:43 +0000 Subject: [PATCH] World: do not fire ChunkListener->onChunkChanged() when a new chunk is set the documentation expressly describes a chunk being _replaced_ by a new chunk. This doesn't fit when the chunk didn't exist to begin with. --- src/world/World.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/world/World.php b/src/world/World.php index f8286d17a..e0bb91982 100644 --- a/src/world/World.php +++ b/src/world/World.php @@ -2054,10 +2054,10 @@ class World implements ChunkManager{ foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){ $listener->onChunkLoaded($chunk); } - } - - foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){ - $listener->onChunkChanged($chunk); + }else{ + foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){ + $listener->onChunkChanged($chunk); + } } }