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.
This commit is contained in:
Dylan K. Taylor 2020-12-03 18:20:43 +00:00
parent 74744fd498
commit fa9be2477d

View File

@ -2054,12 +2054,12 @@ class World implements ChunkManager{
foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){ foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){
$listener->onChunkLoaded($chunk); $listener->onChunkLoaded($chunk);
} }
} }else{
foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){ foreach($this->getChunkListeners($chunkX, $chunkZ) as $listener){
$listener->onChunkChanged($chunk); $listener->onChunkChanged($chunk);
} }
} }
}
/** /**
* Gets the highest block Y value at a specific $x and $z * Gets the highest block Y value at a specific $x and $z