13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
21 public const NETWORK_ID = ProtocolInfo::POSITION_TRACKING_D_B_SERVER_BROADCAST_PACKET;
23 public const ACTION_UPDATE = 0;
24 public const ACTION_DESTROY = 1;
25 public const ACTION_NOT_FOUND = 2;
28 private int $trackingId;
38 $result->action = $action;
39 $result->trackingId = $trackingId;
44 public function getAction() : int{ return $this->action; }
46 public function getTrackingId() : int{ return $this->trackingId; }
52 $this->action = $in->getByte();
54 $this->nbt =
new CacheableNbt($in->getNbtCompoundRoot());
58 $out->putByte($this->action);
60 $out->put($this->nbt->getEncodedNbt());
64 return $handler->handlePositionTrackingDBServerBroadcast($this);
static create(int $action, int $trackingId, CacheableNbt $nbt)
encodePayload(PacketSerializer $out)
handle(PacketHandlerInterface $handler)
decodePayload(PacketSerializer $in)