diff --git a/src/pocketmine/command/Command.php b/src/pocketmine/command/Command.php index 189a3b03b..38f562abb 100644 --- a/src/pocketmine/command/Command.php +++ b/src/pocketmine/command/Command.php @@ -79,11 +79,11 @@ abstract class Command{ */ public function __construct($name, $description = "", $usageMessage = null, array $aliases = []){ $this->commandData = self::generateDefaultData(); - $this->name = $this->nextLabel = $this->label = $name; + $this->name = $name; + $this->setLabel($name); $this->setDescription($description); $this->usageMessage = $usageMessage === null ? "/" . $name : $usageMessage; $this->setAliases($aliases); - $this->timings = new TimingsHandler("** Command: " . $name); } /** @@ -208,6 +208,9 @@ abstract class Command{ public function setLabel($name){ $this->nextLabel = $name; if(!$this->isRegistered()){ + if($this->timings instanceof TimingsHandler){ + $this->timings->remove(); + } $this->timings = new TimingsHandler("** Command: " . $name); $this->label = $name;