mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-29 14:49:59 +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(){
|
public function sendCommandData(){
|
||||||
$pk = new AvailableCommandsPacket();
|
|
||||||
$data = new \stdClass();
|
$data = new \stdClass();
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach($this->server->getCommandMap()->getCommands() as $command){
|
foreach($this->server->getCommandMap()->getCommands() as $command){
|
||||||
//TODO: fix command permission checks on join
|
if(($cmdData = $command->generateCustomCommandData($this)) !== null){
|
||||||
/*if(!$command->testPermissionSilent($this)){
|
++$count;
|
||||||
continue;
|
$data->{$command->getName()}->versions[0] = $cmdData;
|
||||||
}*/
|
}
|
||||||
++$count;
|
|
||||||
$data->{$command->getName()}->versions[0] = $command->generateCustomCommandData($this);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if($count > 0){
|
if($count > 0){
|
||||||
//TODO: structure checking
|
//TODO: structure checking
|
||||||
|
$pk = new AvailableCommandsPacket();
|
||||||
$pk->commands = json_encode($data);
|
$pk->commands = json_encode($data);
|
||||||
$this->dataPacket($pk);
|
$this->dataPacket($pk);
|
||||||
}
|
}
|
||||||
|
@ -108,7 +108,7 @@ abstract class Command{
|
|||||||
*/
|
*/
|
||||||
public function generateCustomCommandData(Player $player){
|
public function generateCustomCommandData(Player $player){
|
||||||
//TODO: fix command permission filtering on join
|
//TODO: fix command permission filtering on join
|
||||||
/*if(!$this->testPermission($player)){
|
/*if(!$this->testPermissionSilent($player)){
|
||||||
return null;
|
return null;
|
||||||
}*/
|
}*/
|
||||||
$customData = clone $this->commandData;
|
$customData = clone $this->commandData;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user