mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 02:42:58 +00:00
Move command timings to Timings::
this avoids duplicate timings entries when command labels are changed and changed back, or if multiple command maps are in use. In addition, it also solves some PHPStan issues :)
This commit is contained in:
@ -31,8 +31,6 @@ use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\lang\Translatable;
|
||||
use pocketmine\permission\PermissionManager;
|
||||
use pocketmine\Server;
|
||||
use pocketmine\timings\Timings;
|
||||
use pocketmine\timings\TimingsHandler;
|
||||
use pocketmine\utils\BroadcastLoggerForwarder;
|
||||
use pocketmine\utils\TextFormat;
|
||||
use function explode;
|
||||
@ -60,8 +58,6 @@ abstract class Command{
|
||||
private ?string $permission = null;
|
||||
private ?string $permissionMessage = null;
|
||||
|
||||
public ?TimingsHandler $timings = null;
|
||||
|
||||
/**
|
||||
* @param string[] $aliases
|
||||
*/
|
||||
@ -136,7 +132,6 @@ abstract class Command{
|
||||
public function setLabel(string $name) : bool{
|
||||
$this->nextLabel = $name;
|
||||
if(!$this->isRegistered()){
|
||||
$this->timings = new TimingsHandler(Timings::INCLUDED_BY_OTHER_TIMINGS_PREFIX . "Command: " . $name);
|
||||
$this->label = $name;
|
||||
|
||||
return true;
|
||||
|
Reference in New Issue
Block a user