mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-03 08:35:20 +00:00
Implemented Channeled packet sending
This commit is contained in:
@ -26,6 +26,7 @@ use pocketmine\event\entity\EntityDamageByEntityEvent;
|
||||
use pocketmine\event\entity\EntityDamageEvent;
|
||||
use pocketmine\item\Item as ItemItem;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\network\Network;
|
||||
use pocketmine\network\protocol\AddEntityPacket;
|
||||
use pocketmine\network\protocol\EntityEventPacket;
|
||||
use pocketmine\Player;
|
||||
@ -65,7 +66,7 @@ class Squid extends WaterAnimal implements Ageable{
|
||||
$pk = new EntityEventPacket();
|
||||
$pk->eid = $this->getId();
|
||||
$pk->event = 15;
|
||||
Server::broadcastPacket($this->hasSpawned, $pk);
|
||||
Server::broadcastPacket($this->hasSpawned, $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
|
||||
}
|
||||
}
|
||||
|
||||
@ -154,7 +155,7 @@ class Squid extends WaterAnimal implements Ageable{
|
||||
$pk->yaw = $this->yaw;
|
||||
$pk->pitch = $this->pitch;
|
||||
$pk->metadata = $this->dataProperties;
|
||||
$player->dataPacket($pk);
|
||||
$player->dataPacket($pk->setChannel(Network::CHANNEL_ENTITY_SPAWNING));
|
||||
|
||||
parent::spawnTo($player);
|
||||
}
|
||||
|
Reference in New Issue
Block a user