Implemented Channeled packet sending

This commit is contained in:
Shoghi Cervantes
2015-04-14 18:24:40 +02:00
parent bb945446b7
commit 0b176b3fe0
29 changed files with 170 additions and 120 deletions

View File

@ -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);
}