From b182e35f2a13a35f6e77969f2f71aafa98d3f0ae Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Fri, 19 Jul 2024 05:48:00 +0300 Subject: [PATCH] fixed sending of chunk changes --- src/world/Level.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/world/Level.php b/src/world/Level.php index f92e6284..c0d1647a 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -397,6 +397,7 @@ class Level{ if(count($this->changedCount) > 0){ arsort($this->changedCount); $resendChunks = []; + $reorder = false; foreach($this->changedCount as $index => $count){ if($count < 582){//Optimal value, calculated using the relation between minichunks and single packets break; @@ -404,10 +405,17 @@ class Level{ foreach($this->players as $p){ unset($p->chunksLoaded[$index]); } + $reorder = true; unset($this->changedBlocks[$index]); } $this->changedCount = []; - + + if($reorder){ + foreach($this->players as $p){ + $p->orderChunks(); + } + } + if(count($this->changedBlocks) > 0){ foreach($this->changedBlocks as $i => $blocks){ foreach($blocks as $b){