Inheritance: extends pocketmine\math\Vector3
 public function __construct(Vector3 $v, Level $level, $name, $delay)
 {
     parent::__construct($v->x, $v->y, $v->z);
     $this->name = $name;
     $this->delay = $delay;
     $this->eid = Entity::$entityCount++;
 }
Exemplo n.º 2
0
 public function addParticle(Particle $particle, array $players = null)
 {
     $pk = $particle->encode();
     if ($players === null) {
         $players = $this->getUsingChunk($particle->x >> 4, $particle->z >> 4);
     }
     if ($pk !== null) {
         if (!is_array($pk)) {
             Server::broadcastPacket($players, $pk);
         } else {
             $this->server->batchPackets($players, $pk, false);
         }
     }
 }
Exemplo n.º 3
0
 public function __construct(Vector3 $pos, $id, $data = 0)
 {
     parent::__construct($pos->x, $pos->y, $pos->z);
     $this->id = $id & 0xfff;
     $this->data = $data;
 }
Exemplo n.º 4
0
 public function addParticle(Particle $particle, array $players = null)
 {
     $pk = $particle->encode();
     if ($players === null) {
         $players = $this->getUsingChunk($particle->x >> 4, $particle->z >> 4);
     }
     if ($pk !== null) {
         if (!is_array($pk)) {
             Server::broadcastPacket($players, $pk->setChannel(Network::CHANNEL_WORLD_EVENTS));
         } else {
             $this->server->batchPackets($players, $pk, false, Network::CHANNEL_WORLD_EVENTS);
         }
     }
 }
 public function __construct(Vector3 $pos, Block $b)
 {
     parent::__construct($pos->x, $pos->y, $pos->z);
     $this->data = $b->getId() + ($b->getDamage() << 12);
 }
Exemplo n.º 6
0
 public function __construct(Vector3 $pos, $width = 0, $height = 0)
 {
     parent::__construct($pos->x, $pos->y, $pos->z);
     $this->width = $width;
     $this->height = $height;
 }
Exemplo n.º 7
0
 /**
  * @param Vector3 $pos
  * @param int $text
  * @param string $title
  */
 public function __construct(Vector3 $pos, $text, $title = "")
 {
     parent::__construct($pos->x, $pos->y, $pos->z);
     $this->text = $text;
     $this->title = $title;
 }
Exemplo n.º 8
0
 public function addParticle(Particle $particle, array $players = \null)
 {
     $pk = $particle->encode();
     if ($players === \null) {
         if ($pk !== \null) {
             if (!\is_array($pk)) {
                 $this->addChunkPacket($particle->x >> 4, $particle->z >> 4, $pk);
             } else {
                 foreach ($pk as $e) {
                     $this->addChunkPacket($particle->x >> 4, $particle->z >> 4, $e);
                 }
             }
         }
     } else {
         if ($pk !== \null) {
             if (!\is_array($pk)) {
                 Server::broadcastPacket($players, $pk);
             } else {
                 $this->server->batchPackets($players, $pk, \false);
             }
         }
     }
 }