mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-06 09:56:06 +00:00
Merge branch 'master' into mcpe-1.0
This commit is contained in:
@ -523,20 +523,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);
|
||||
}
|
||||
|
Reference in New Issue
Block a user