mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-31 23:33:06 +00:00
Resend command data when op status changes
This commit is contained in:
parent
018897062c
commit
192fba9c88
@ -440,6 +440,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
}
|
}
|
||||||
|
|
||||||
$this->recalculatePermissions();
|
$this->recalculatePermissions();
|
||||||
|
$this->sendCommandData();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -503,6 +504,19 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
return $this->perm->getEffectivePermissions();
|
return $this->perm->getEffectivePermissions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function sendCommandData(){
|
||||||
|
$pk = new AvailableCommandsPacket();
|
||||||
|
$data = [];
|
||||||
|
foreach($this->server->getCommandMap()->getCommands() as $command){
|
||||||
|
$data[$command->getName()] = $command->generateJsonData($this);
|
||||||
|
}
|
||||||
|
if(count($data) > 0){
|
||||||
|
//TODO: structure checking
|
||||||
|
$pk->commands = json_encode($data);
|
||||||
|
$this->dataPacket($pk);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param SourceInterface $interface
|
* @param SourceInterface $interface
|
||||||
* @param null $clientID
|
* @param null $clientID
|
||||||
@ -1713,14 +1727,8 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
if($this->isOp()){
|
if($this->isOp()){
|
||||||
$this->setRemoveFormat(false);
|
$this->setRemoveFormat(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
$pk = new AvailableCommandsPacket();
|
$this->sendCommandData();
|
||||||
$data = [];
|
|
||||||
foreach($this->server->getCommandMap()->getCommands() as $command){
|
|
||||||
$data[$command->getName()] = $command->generateJsonData($this);
|
|
||||||
}
|
|
||||||
$pk->commands = json_encode($data);
|
|
||||||
$this->dataPacket($pk);
|
|
||||||
|
|
||||||
if($this->isCreative()){
|
if($this->isCreative()){
|
||||||
$this->inventory->sendCreativeContents();
|
$this->inventory->sendCreativeContents();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user