13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol;
22 public const NETWORK_ID = ProtocolInfo::SET_SCOREBOARD_IDENTITY_PACKET;
24 public const TYPE_REGISTER_IDENTITY = 0;
25 public const TYPE_CLEAR_IDENTITY = 1;
29 public array $entries = [];
35 public static function create(
int $type, array $entries) : self{
37 $result->type = $type;
38 $result->entries = $entries;
43 $this->type = $in->getByte();
47 if($this->type === self::TYPE_REGISTER_IDENTITY){
51 $this->entries[] = $entry;
56 $out->putByte($this->type);
58 foreach($this->entries as $entry){
60 if($this->type === self::TYPE_REGISTER_IDENTITY){
61 $out->putActorUniqueId($entry->actorUniqueId);
67 return $handler->handleSetScoreboardIdentity($this);
decodePayload(PacketSerializer $in)
handle(PacketHandlerInterface $handler)
encodePayload(PacketSerializer $out)
static create(int $type, array $entries)
putUnsignedVarInt(int $v)