From 4a63b706451f3639c0fa6f247b5811553a57b98b Mon Sep 17 00:00:00 2001 From: notant <84870445+antbag-dev@users.noreply.github.com> Date: Wed, 12 Jun 2024 16:56:46 +0500 Subject: [PATCH] Command --- src/antbag/JoinCount/Main.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/antbag/JoinCount/Main.php b/src/antbag/JoinCount/Main.php index 5265126..c49a423 100644 --- a/src/antbag/JoinCount/Main.php +++ b/src/antbag/JoinCount/Main.php @@ -21,13 +21,12 @@ public function onEnable(): void { $this->listener = new PlayerJoinListener($this->getDataFolder() . "playerData.json", $this->config); $this->getServer()->getPluginManager()->registerEvents($this->listener, $this); - // Dodanie uprawnienia $perm = new Permission("joincount.totalplayers", "Allows the user to see the total number of players"); PermissionManager::getInstance()->addPermission($perm); } public function onCommand(CommandSender $sender, Command $command, string $label, array $args): bool { - if ($command->getName() === "totalplayers") { + if ($command->getName() === "registeredplayers") { if($sender->hasPermission("joincount.totalplayers")) { $totalPlayers = count($this->listener->loadData()); $sender->sendMessage("Total players registered: " . $totalPlayers);