pocketmine\command\Command::setLabel PHP Method

setLabel() public method

public setLabel ( $name )
    public function setLabel($name)
    {
        $this->nextLabel = $name;
        if (!$this->isRegistered()) {
            $this->timings = new TimingsHandler("** Command: " . $name);
            $this->label = $name;
            return true;
        }
        return false;
    }

Usage Example

Ejemplo n.º 1
0
 private function registerAlias(Command $command, $isAlias, $fallbackPrefix, $label)
 {
     $this->knownCommands[$fallbackPrefix . ":" . $label] = $command;
     if (($command instanceof VanillaCommand or $isAlias) and isset($this->knownCommands[$label])) {
         return false;
     }
     if (isset($this->knownCommands[$label]) and $this->knownCommands[$label]->getLabel() !== null and $this->knownCommands[$label]->getLabel() === $label) {
         return false;
     }
     if (!$isAlias) {
         $command->setLabel($label);
     }
     $this->knownCommands[$label] = $command;
     return true;
 }