25 public const NETWORK_ID = ProtocolInfo::REQUEST_PERMISSIONS_PACKET;
27 public const FLAG_BUILD = 1 << 0;
28 public const FLAG_MINE = 1 << 1;
29 public const FLAG_DOORS_AND_SWITCHES = 1 << 2;
30 public const FLAG_OPEN_CONTAINERS = 1 << 3;
31 public const FLAG_ATTACK_PLAYERS = 1 << 4;
32 public const FLAG_ATTACK_MOBS = 1 << 5;
33 public const FLAG_OPERATOR = 1 << 6;
34 public const FLAG_TELEPORT = 1 << 7;
36 private int $targetActorUniqueId;
38 private int $playerPermission;
39 private int $customFlags;
44 public static function create(
int $targetActorUniqueId,
int $playerPermission,
int $customFlags) : self{
46 $result->targetActorUniqueId = $targetActorUniqueId;
47 $result->playerPermission = $playerPermission;
48 $result->customFlags = $customFlags;
52 public function getTargetActorUniqueId() : int{ return $this->targetActorUniqueId; }
57 public function getCustomFlags() : int{ return $this->customFlags; }
60 $this->targetActorUniqueId = $in->getLLong();
61 $this->playerPermission = $in->
getVarInt();
66 $out->putLLong($this->targetActorUniqueId);
68 $out->putLShort($this->customFlags);
72 return $handler->handleRequestPermissions($this);