mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
Async chunk compression and serialization is now non-optional
This commit is contained in:
@ -112,6 +112,7 @@ use pocketmine\network\mcpe\protocol\AddPlayerPacket;
|
||||
use pocketmine\network\mcpe\protocol\AdventureSettingsPacket;
|
||||
use pocketmine\network\mcpe\protocol\AnimatePacket;
|
||||
use pocketmine\network\mcpe\protocol\AvailableCommandsPacket;
|
||||
use pocketmine\network\mcpe\protocol\BatchPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockEntityDataPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockEventPacket;
|
||||
use pocketmine\network\mcpe\protocol\BlockPickRequestPacket;
|
||||
@ -803,7 +804,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
return $this->spawnPosition instanceof WeakPosition and $this->spawnPosition->isValid();
|
||||
}
|
||||
|
||||
public function sendChunk($x, $z, $payload){
|
||||
public function sendChunk(int $x, int $z, BatchPacket $payload){
|
||||
if($this->connected === false){
|
||||
return;
|
||||
}
|
||||
@ -811,15 +812,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
||||
$this->usedChunks[Level::chunkHash($x, $z)] = true;
|
||||
$this->chunkLoadCount++;
|
||||
|
||||
if($payload instanceof DataPacket){
|
||||
$this->dataPacket($payload);
|
||||
}else{
|
||||
$pk = new FullChunkDataPacket();
|
||||
$pk->chunkX = $x;
|
||||
$pk->chunkZ = $z;
|
||||
$pk->data = $payload;
|
||||
$this->batchDataPacket($pk);
|
||||
}
|
||||
$this->dataPacket($payload);
|
||||
|
||||
if($this->spawned){
|
||||
foreach($this->level->getChunkEntities($x, $z) as $entity){
|
||||
|
Reference in New Issue
Block a user