|
PocketMine-MP 5.36.1 git-eaa7c4834c8fe2f379d24e7f0ee6cc63cfb18ccc
|
Inheritance diagram for pocketmine\command\SimpleCommandMap:
Collaboration diagram for pocketmine\command\SimpleCommandMap:Public Member Functions | |
| __construct (private Server $server) | |
| clearCommands () | |
| dispatch (CommandSender $sender, string $commandLine) | |
| getAliasMap () | |
| getCommand (string $name, ?CommandAliasMap $senderAliasMap=null) | |
| getUniqueCommands () | |
| register (Command $command, array $otherAliases=[]) | |
| registerServerAliases () | |
| unregister (Command $command) | |
Static Public Member Functions | |
| static | handleConflicted (CommandSender $sender, string $alias, array $conflictedEntries, CommandAliasMap $fallbackAliasMap) |
Definition at line 87 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::__construct | ( | private Server | $server | ) |
Definition at line 97 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::clearCommands | ( | ) |
Implements pocketmine\command\CommandMap.
Definition at line 236 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::dispatch | ( | CommandSender | $sender, |
| string | $commandLine ) |
Implements pocketmine\command\CommandMap.
Definition at line 174 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::getAliasMap | ( | ) |
Returns the global alias map for this command map. Aliases in this map will be used as a fallback when user-specific aliases don't give any results.
Implements pocketmine\command\CommandMap.
Definition at line 322 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::getCommand | ( | string | $name, |
| ?CommandAliasMap | $senderAliasMap = null ) |
Returns the command(s) bound to the given name or alias. This will return an array if the alias is conflicted (multiple commands bound to it).
Implements pocketmine\command\CommandMap.
Definition at line 242 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::getUniqueCommands | ( | ) |
Definition at line 268 of file SimpleCommandMap.php.
|
static |
TODO: probably need to find a better place to put this
Definition at line 213 of file SimpleCommandMap.php.
Referenced by pocketmine\command\defaults\HelpCommand\execute().
Here is the caller graph for this function:| pocketmine\command\SimpleCommandMap::register | ( | Command | $command, |
| array | $otherAliases = [] ) |
Registering a command with (command(namespace="myplugin", name="mycommand"), otherAliases=["myc"]) will bind:
If two commands claim the same alias, it will become conflicted, and neither command will be usable with that alias unless the alias is explicitly rebound in the alias map. The user will be shown an error when trying to use it, listing all namespaced names (not aliases) of the commands bound to it. The user can then use one of the namespaced names to run the command they want.
| string[] | $otherAliases |
@phpstan-param list<string> $otherAliases
Implements pocketmine\command\CommandMap.
Definition at line 148 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::registerServerAliases | ( | ) |
Definition at line 272 of file SimpleCommandMap.php.
| pocketmine\command\SimpleCommandMap::unregister | ( | Command | $command | ) |
Definition at line 167 of file SimpleCommandMap.php.