mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 01:46:04 +00:00
World: replace sendBlocks() with createBlockUpdatePackets()
this allows the caller to decide how the packets should be sent.
This commit is contained in:
@ -390,7 +390,9 @@ class InGamePacketHandler extends PacketHandler{
|
||||
}else{
|
||||
$blocks[] = $blockPos;
|
||||
}
|
||||
$this->player->getLocation()->getWorld()->sendBlocks([$this->player], $blocks);
|
||||
foreach($this->player->getWorld()->createBlockUpdatePackets($blocks) as $packet){
|
||||
$this->session->sendDataPacket($packet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -616,7 +618,9 @@ class InGamePacketHandler extends PacketHandler{
|
||||
|
||||
try{
|
||||
if(!$block->updateText($this->player, $text)){
|
||||
$this->player->getWorld()->sendBlocks([$this->player], [$pos]);
|
||||
foreach($this->player->getWorld()->createBlockUpdatePackets([$pos]) as $updatePacket){
|
||||
$this->session->sendDataPacket($updatePacket);
|
||||
}
|
||||
}
|
||||
}catch(\UnexpectedValueException $e){
|
||||
throw BadPacketException::wrap($e);
|
||||
|
Reference in New Issue
Block a user