mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 01:16:15 +00:00
Added PluginBase::getCommand()
This commit is contained in:
@ -28,6 +28,7 @@ namespace PocketMine;
|
||||
use PocketMine\Block\Block;
|
||||
use PocketMine\Command\CommandSender;
|
||||
use PocketMine\Command\ConsoleCommandSender;
|
||||
use PocketMine\Command\PluginCommand;
|
||||
use PocketMine\Command\SimpleCommandMap;
|
||||
use PocketMine\Entity\Entity;
|
||||
use PocketMine\Event\Event;
|
||||
@ -373,6 +374,19 @@ class Server{
|
||||
$this->properties->set($variable, $value == true ? "1" : "0");
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $name
|
||||
*
|
||||
* @return PluginCommand
|
||||
*/
|
||||
public function getPluginCommand($name){
|
||||
if(($command = $this->commandMap->getCommand($name)) instanceof PluginCommand){
|
||||
return $command;
|
||||
}else{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Server
|
||||
*/
|
||||
|
Reference in New Issue
Block a user