mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
fixed sending of chunk changes
This commit is contained in:
parent
66d847c82f
commit
b182e35f2a
1 changed files with 9 additions and 1 deletions
|
|
@ -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){
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue