13declare(strict_types=1);
15namespace pocketmine\network\mcpe\protocol\types\command;
18 public const REQUIRES_CHEATS_ENABLED = 1 << 0;
19 public const REQUIRES_ELEVATED_PERMISSIONS = 1 << 1;
20 public const REQUIRES_HOST_PERMISSIONS = 1 << 2;
21 public const REQUIRES_ALLOW_ALIASES = 1 << 3;
28 private int $valueOffset,
29 private array $constraints
31 (
static function(
int ...$_) :
void{})(...$constraints);
32 if(!isset($enum->
getValues()[$valueOffset])){
33 throw new \InvalidArgumentException(
"Invalid enum value offset $valueOffset");
41 public function getValueOffset() : int{
42 return $this->valueOffset;
45 public function getAffectedValue() : string{
46 return $this->enum->getValues()[$this->valueOffset];
53 return $this->constraints;
__construct(private CommandEnum $enum, private int $valueOffset, private array $constraints)