mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-22 12:39:43 +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){
|
if(count($this->changedCount) > 0){
|
||||||
arsort($this->changedCount);
|
arsort($this->changedCount);
|
||||||
$resendChunks = [];
|
$resendChunks = [];
|
||||||
|
$reorder = false;
|
||||||
foreach($this->changedCount as $index => $count){
|
foreach($this->changedCount as $index => $count){
|
||||||
if($count < 582){//Optimal value, calculated using the relation between minichunks and single packets
|
if($count < 582){//Optimal value, calculated using the relation between minichunks and single packets
|
||||||
break;
|
break;
|
||||||
|
|
@ -404,10 +405,17 @@ class Level{
|
||||||
foreach($this->players as $p){
|
foreach($this->players as $p){
|
||||||
unset($p->chunksLoaded[$index]);
|
unset($p->chunksLoaded[$index]);
|
||||||
}
|
}
|
||||||
|
$reorder = true;
|
||||||
unset($this->changedBlocks[$index]);
|
unset($this->changedBlocks[$index]);
|
||||||
}
|
}
|
||||||
$this->changedCount = [];
|
$this->changedCount = [];
|
||||||
|
|
||||||
|
if($reorder){
|
||||||
|
foreach($this->players as $p){
|
||||||
|
$p->orderChunks();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(count($this->changedBlocks) > 0){
|
if(count($this->changedBlocks) > 0){
|
||||||
foreach($this->changedBlocks as $i => $blocks){
|
foreach($this->changedBlocks as $i => $blocks){
|
||||||
foreach($blocks as $b){
|
foreach($blocks as $b){
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue