mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-07 18:32:55 +00:00
Implemented Channeled packet sending
This commit is contained in:
@ -22,6 +22,7 @@
|
||||
namespace pocketmine\inventory;
|
||||
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\protocol\ContainerClosePacket;
|
||||
use pocketmine\network\protocol\ContainerOpenPacket;
|
||||
use pocketmine\Player;
|
||||
@ -42,7 +43,7 @@ abstract class ContainerInventory extends BaseInventory{
|
||||
$pk->x = $pk->y = $pk->z = 0;
|
||||
}
|
||||
|
||||
$who->dataPacket($pk);
|
||||
$who->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
|
||||
$this->sendContents($who);
|
||||
}
|
||||
@ -50,7 +51,7 @@ abstract class ContainerInventory extends BaseInventory{
|
||||
public function onClose(Player $who){
|
||||
$pk = new ContainerClosePacket();
|
||||
$pk->windowid = $who->getWindowId($this);
|
||||
$who->dataPacket($pk);
|
||||
$who->dataPacket($pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
parent::onClose($who);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user