Break cycle between Command
and CommandMap
(aliases, label)
#6508
Labels
BC break
Breaks API compatibility
Category: Core
Related to internal functionality
Easy task
Probably really easy to do, good task for first-time contributors
Type: Cleanup
Removes or deprecates API methods or behaviour
Milestone
Description
Have
CommandMap
track commands' active aliases and "label" (primary alias) instead ofCommand
Justification
Since a command's active aliases are tracked by
Command
internally, aCommand
needs to ensure it is only registered to a singleCommandMap
at a time.This is a dumb limitation and requires extra complexity. We could just have the active aliases tracked by
CommandMap
itself, since they're only actually important to theCommandMap
anyway.Going further, aliases could be entirely removed from
Command
. They could just be passed as astring[]
toCommandMap->register()
.In addition, if #6506 were implemented,
Command->getName()
(primary alias) could be deleted too, as its only actual use is foronCommand()
.PocketMine-MP/src/command/Command.php
Lines 139 to 181 in 48a908e
PocketMine-MP/src/command/Command.php
Lines 205 to 210 in 48a908e
The text was updated successfully, but these errors were encountered: