getLine() public method

Reads a line from console, if available. Returns null if not available
public getLine ( ) : string | null
return string | null
Exemplo n.º 1
0
 public function checkConsole()
 {
     Timings::$serverCommandTimer->startTiming();
     if (($line = $this->console->getLine()) !== null) {
         $this->pluginManager->callEvent($ev = new ServerCommandEvent($this->consoleSender, $line));
         if (!$ev->isCancelled()) {
             $this->dispatchCommand($ev->getSender(), $ev->getCommand());
         }
     }
     Timings::$serverCommandTimer->stopTiming();
 }