Player: don't re-request chunks unless they've already been sent

if they've been requested, the ChunkCache will take care of rebuilding the chunk packet before sending it.
This commit is contained in:
Dylan K. Taylor 2021-04-18 23:53:34 +01:00
parent 129c638e29
commit b4afa46fad
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -2345,7 +2345,7 @@ class Player extends Human implements CommandSender, ChunkListener, IPlayer{
public function onChunkChanged(int $chunkX, int $chunkZ, Chunk $chunk) : void{
$status = $this->usedChunks[$hash = World::chunkHash($chunkX, $chunkZ)] ?? null;
if($status !== null && !$status->equals(UsedChunkStatus::NEEDED())){
if($status !== null && $status->equals(UsedChunkStatus::SENT())){
$this->usedChunks[$hash] = UsedChunkStatus::NEEDED();
$this->nextChunkOrderRun = 0;
}