mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-04 00:55:14 +00:00
Resend command data when op status changes
This commit is contained in:
@ -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
|
||||||
@ -1714,13 +1728,7 @@ class Player extends Human implements CommandSender, InventoryHolder, ChunkLoade
|
|||||||
$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();
|
||||||
|
Reference in New Issue
Block a user