mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 02:09:42 +00:00
Fix some command stupidity
This is why NOT to write code at 11PM when one is shattered.
This commit is contained in:
parent
69d6d24a38
commit
9661d845bb
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user