mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-04-21 08:17:34 +00:00
PluginCommand: separate CommandExecutor param
looking at the code now it's clear that this class combines two jobs into the same class. closes #3203
This commit is contained in:
parent
2ff25dfbd2
commit
b43bd5fb67
@ -35,13 +35,14 @@ class PluginCommand extends Command implements PluginIdentifiableCommand{
|
||||
private $executor;
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
* @param Plugin $owner
|
||||
* @param string $name
|
||||
* @param Plugin $owner
|
||||
* @param CommandExecutor $executor
|
||||
*/
|
||||
public function __construct(string $name, Plugin $owner){
|
||||
public function __construct(string $name, Plugin $owner, CommandExecutor $executor){
|
||||
parent::__construct($name);
|
||||
$this->owningPlugin = $owner;
|
||||
$this->executor = $owner;
|
||||
$this->executor = $executor;
|
||||
$this->usageMessage = "";
|
||||
}
|
||||
|
||||
|
@ -181,7 +181,7 @@ abstract class PluginBase implements Plugin, CommandExecutor{
|
||||
continue;
|
||||
}
|
||||
if(is_array($data)){ //TODO: error out if it isn't
|
||||
$newCmd = new PluginCommand($key, $this);
|
||||
$newCmd = new PluginCommand($key, $this, $this);
|
||||
if(isset($data["description"])){
|
||||
$newCmd->setDescription($data["description"]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user