Saving Permissions

Messenger_

New Member
I am currently in the middle of attempting to translate previously made Bukkit/Spigot plugins into plugins using the Nukkit API to run on a Bedrock server instead. I have successfully translated 99% of the code, however I am stuck on part of a Permissions plugin. In order to re-save my config and update player's permissions when they are given a new permissions rank the Bukkit code used was (where main is the instance of my plugin):

Java:
main.getConfig().options().copyDefaults(true);
main.saveConfig();
<Custom code to set up player permissions on this line>
player.updateCommands();
I have attempted to translate this code as written below, however I am unsure of the equivalent of the "main.getConfig().options().copyDefaults(true)" line. I am sure there is something very similar that I am missing, but for the life of me I cannot figure out what that is.
Nukkit Code Attempt:
Java:
<Code replacing line 1 of Bukkit code>
main.saveConfig()
<Custom code to set up player permissions on this line>
player.recalculatePermissions();
player.sendCommandData();
What is interesting is that missing this line does not prevent the player from executing the rank's commands, but it DOES prevent the commands from showing up as able to be used in the in-game command menu (ie. if I begin to type "/gamerule", there is no tab complete option like the game does not recognize me as having access to the command, but it will still execute as normal).

If anyone has knowledge of both Bukkit and Nukkit API, help would be much appreciated! I have been scouring the API myself for a while, but to no avail. Thanks in advance!
 
Top