From b969b5d8f13b593d565b76f4d977ff96f2c71b5f Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sun, 8 Oct 2023 13:14:53 +0300 Subject: [PATCH] help will not call any events to detect can player execute the command or no --- src/API/ConsoleAPI.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/API/ConsoleAPI.php b/src/API/ConsoleAPI.php index 673ab952..4ef83f8e 100644 --- a/src/API/ConsoleAPI.php +++ b/src/API/ConsoleAPI.php @@ -245,10 +245,9 @@ class ConsoleAPI{ } $cmds = []; foreach($this->help as $c => $h){ - if($this->server->api->dhandle("console.command." . $c, ["cmd" => $c, "parameters" => [], "issuer" => $issuer, "alias" => false]) === false or $this->server->api->dhandle("console.command", ["cmd" => $c, "parameters" => [], "issuer" => $issuer, "alias" => false]) === false){ - continue; + if(isset($this->server->api->ban->cmdWhitelist[$c]) || !($issuer instanceof Player) || $this->server->api->ban->isOp($issuer)){ + $cmds[$c] = $h; } - $cmds[$c] = $h; } $max = ceil(count($cmds) / 5);