mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 12:18:46 +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
@ -37,11 +37,12 @@ class PluginCommand extends Command implements PluginIdentifiableCommand{
|
|||||||
/**
|
/**
|
||||||
* @param string $name
|
* @param string $name
|
||||||
* @param Plugin $owner
|
* @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);
|
parent::__construct($name);
|
||||||
$this->owningPlugin = $owner;
|
$this->owningPlugin = $owner;
|
||||||
$this->executor = $owner;
|
$this->executor = $executor;
|
||||||
$this->usageMessage = "";
|
$this->usageMessage = "";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -181,7 +181,7 @@ abstract class PluginBase implements Plugin, CommandExecutor{
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if(is_array($data)){ //TODO: error out if it isn't
|
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"])){
|
if(isset($data["description"])){
|
||||||
$newCmd->setDescription($data["description"]);
|
$newCmd->setDescription($data["description"]);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user