block updates and chunk data are ordered now, removed 16x16x16 chunk sending

This commit is contained in:
GameHerobrine 2025-05-22 17:24:27 +03:00
parent 24578f940c
commit 3c18f85d89
4 changed files with 109 additions and 90 deletions

View file

@ -429,13 +429,14 @@ class Level{
if(count($this->changedBlocks) > 0){
foreach($this->changedBlocks as $i => $blocks){
foreach($blocks as $b){
$pk = new UpdateBlockPacket;
$pk->x = ($b >> 32) & 0xff;
$pk->y = ($b >> 24) & 0xff;
$pk->z = ($b >> 16) & 0xff;
$pk->block =($b >> 8) & 0xff;
$pk->meta = $b & 0xff;
$this->server->api->player->broadcastPacket($this->players, $pk);
$x = ($b >> 32) & 0xff;
$y = ($b >> 24) & 0xff;
$z = ($b >> 16) & 0xff;
$id =($b >> 8) & 0xff;
$meta = $b & 0xff;
foreach($this->players as $p){
$p->addBlockUpdateIntoQueue($x, $y, $z, $id, $meta);
}
}
unset($this->changedBlocks[$i]);
}