From 1cbb31f1db07975d89cfedb3805912a3df450ae9 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Mon, 31 Dec 2018 19:35:54 +0000 Subject: [PATCH] Player: Reintroduce permission checks for command hints This was removed way back in 2016 because of an unidentified bug which caused permissible commands not to show up on the client. Back then, command parsing and validity checks were client-sided, and the client would simply not send the command at all if it didn't recognize it. Now, that problem is gone, so it doesn't matter as much if there are permission bugs which cause commands to be erroneously missing. closes #2625 --- src/pocketmine/Player.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pocketmine/Player.php b/src/pocketmine/Player.php index 689f036ec..a8379bfcc 100644 --- a/src/pocketmine/Player.php +++ b/src/pocketmine/Player.php @@ -676,7 +676,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{ public function sendCommandData(){ $pk = new AvailableCommandsPacket(); foreach($this->server->getCommandMap()->getCommands() as $name => $command){ - if(isset($pk->commandData[$command->getName()]) or $command->getName() === "help"){ + if(isset($pk->commandData[$command->getName()]) or $command->getName() === "help" or !$command->testPermissionSilent($this)){ continue; }