PocketMine-MP
5.39.3 git-66148f13a91e4af6778ba9f200ca25ad8a04a584
Loading...
Searching...
No Matches
CommandData.php
1
<?php
2
3
/*
4
* This file is part of BedrockProtocol.
5
* Copyright (C) 2014-2022 PocketMine Team <https://github.com/pmmp/BedrockProtocol>
6
*
7
* BedrockProtocol is free software: you can redistribute it and/or modify
8
* it under the terms of the GNU Lesser General Public License as published by
9
* the Free Software Foundation, either version 3 of the License, or
10
* (at your option) any later version.
11
*/
12
13
declare(strict_types=1);
14
15
namespace
pocketmine\network\mcpe\protocol\types\command;
16
17
use
function
is_int;
18
19
class
CommandData
{
20
private
string
$permission;
21
26
public
function
__construct
(
27
public
string
$name,
28
public
string
$description,
29
public
int
$flags,
30
int
|
string
$permission,
31
public
?
CommandHardEnum
$aliases,
32
public
array $overloads,
33
public
array $chainedSubCommandData
34
){
35
(
function
(
CommandOverload
...$overloads) :
void
{})(...$overloads);
36
(
function
(
ChainedSubCommandData
...$chainedSubCommandData) :
void
{})(...$chainedSubCommandData);
37
$this->permission = is_int($permission) ? CommandPermissions::toName($permission) : $permission;
38
}
39
40
public
function
getName() : string{
41
return $this->name;
42
}
43
44
public
function
getDescription() : string{
45
return $this->description;
46
}
47
48
public
function
getFlags() : int{
49
return $this->flags;
50
}
51
52
public
function
getPermission() : string{
53
return $this->permission;
54
}
55
56
public
function
getAliases() : ?CommandHardEnum{
57
return $this->aliases;
58
}
59
63
public
function
getOverloads
() : array{
64
return $this->overloads;
65
}
66
70
public
function
getChainedSubCommandData
() : array{
71
return $this->chainedSubCommandData;
72
}
73
}
pocketmine\network\mcpe\protocol\types\command\ChainedSubCommandData
Definition
ChainedSubCommandData.php:17
pocketmine\network\mcpe\protocol\types\command\CommandData
Definition
CommandData.php:19
pocketmine\network\mcpe\protocol\types\command\CommandData\getOverloads
getOverloads()
Definition
CommandData.php:63
pocketmine\network\mcpe\protocol\types\command\CommandData\__construct
__construct(public string $name, public string $description, public int $flags, int|string $permission, public ?CommandHardEnum $aliases, public array $overloads, public array $chainedSubCommandData)
Definition
CommandData.php:26
pocketmine\network\mcpe\protocol\types\command\CommandData\getChainedSubCommandData
getChainedSubCommandData()
Definition
CommandData.php:70
pocketmine\network\mcpe\protocol\types\command\CommandHardEnum
Definition
CommandHardEnum.php:17
pocketmine\network\mcpe\protocol\types\command\CommandOverload
Definition
CommandOverload.php:17
vendor
pocketmine
bedrock-protocol
src
types
command
CommandData.php
Generated by
1.12.0