Fix some command stupidity

This is why NOT to write code at 11PM when one is shattered.
This commit is contained in:
Dylan K. Taylor 2017-01-27 11:21:21 +00:00
parent 69d6d24a38
commit 9661d845bb
2 changed files with 6 additions and 8 deletions

View File

@ -507,20 +507,18 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
}
public function sendCommandData(){
$pk = new AvailableCommandsPacket();
$data = new \stdClass();
$count = 0;
foreach($this->server->getCommandMap()->getCommands() as $command){
//TODO: fix command permission checks on join
/*if(!$command->testPermissionSilent($this)){
continue;
}*/
++$count;
$data->{$command->getName()}->versions[0] = $command->generateCustomCommandData($this);
if(($cmdData = $command->generateCustomCommandData($this)) !== null){
++$count;
$data->{$command->getName()}->versions[0] = $cmdData;
}
}
if($count > 0){
//TODO: structure checking
$pk = new AvailableCommandsPacket();
$pk->commands = json_encode($data);
$this->dataPacket($pk);
}

View File

@ -108,7 +108,7 @@ abstract class Command{
*/
public function generateCustomCommandData(Player $player){
//TODO: fix command permission filtering on join
/*if(!$this->testPermission($player)){
/*if(!$this->testPermissionSilent($player)){
return null;
}*/
$customData = clone $this->commandData;