Added RemoteServerCommandEvent

This commit is contained in:
Shoghi Cervantes
2014-08-16 13:05:20 +02:00
parent 7e4a191593
commit eee0eb5458
3 changed files with 53 additions and 4 deletions

View File

@ -1661,10 +1661,9 @@ class Server{
Timings::$serverCommandTimer->startTiming();
if(($line = $this->console->getLine()) !== null){
$this->pluginManager->callEvent($ev = new ServerCommandEvent($this->consoleSender, $line));
if($ev->isCancelled()){
return;
if(!$ev->isCancelled()){
$this->dispatchCommand($ev->getSender(), $ev->getCommand());
}
$this->dispatchCommand($this->consoleSender, $ev->getCommand());
}
Timings::$serverCommandTimer->stopTiming();
}