Added PluginBase::getCommand()

This commit is contained in:
Shoghi Cervantes
2014-03-27 14:56:02 +01:00
parent 605231251a
commit 2385b94ba3
41 changed files with 27 additions and 4 deletions

View File

@ -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
*/