diff --git a/src/pocketmine/command/PluginCommand.php b/src/pocketmine/command/PluginCommand.php index f60aa7559..cb91520cd 100644 --- a/src/pocketmine/command/PluginCommand.php +++ b/src/pocketmine/command/PluginCommand.php @@ -39,11 +39,7 @@ class PluginCommand extends Command implements PluginIdentifiableCommand{ public function __construct($name, Plugin $owner){ parent::__construct($name); $this->owningPlugin = $owner; - if(!($owner instanceof CommandExecutor)){ - trigger_error("Plugin does not implement CommandExecutor", E_USER_WARNING); - }else{ - $this->executor = $owner; - } + $this->executor = $owner; $this->usageMessage = ""; } diff --git a/src/pocketmine/plugin/Plugin.php b/src/pocketmine/plugin/Plugin.php index 6233bbb9d..ba79bb48c 100644 --- a/src/pocketmine/plugin/Plugin.php +++ b/src/pocketmine/plugin/Plugin.php @@ -23,13 +23,14 @@ * Plugin related classes */ namespace pocketmine\plugin; +use pocketmine\command\CommandExecutor; /** * It is recommended to use PluginBase for the actual plugin * */ -interface Plugin{ +interface Plugin extends CommandExecutor{ /** * Called when the plugin is loaded, before calling onEnable() diff --git a/src/pocketmine/plugin/PluginBase.php b/src/pocketmine/plugin/PluginBase.php index 42711c25b..843859ffe 100644 --- a/src/pocketmine/plugin/PluginBase.php +++ b/src/pocketmine/plugin/PluginBase.php @@ -22,9 +22,7 @@ namespace pocketmine\plugin; use pocketmine\command\Command; -use pocketmine\command\CommandExecutor; use pocketmine\command\CommandSender; -use pocketmine\command\PluginCommand; use pocketmine\command\PluginIdentifiableCommand; use pocketmine\Server; use pocketmine\utils\Config; @@ -152,6 +150,18 @@ abstract class PluginBase implements Plugin{ } } + /** + * @param CommandSender $sender + * @param Command $command + * @param string $label + * @param array $args + * + * @return bool + */ + public function onCommand(CommandSender $sender, Command $command, $label, array $args){ + return false; + } + /** * @return bool */