Suggestion/Issue: updateCommands() when gamemode changes
accLarson opened this issue · 2 comments
When a player has a LP permission with a gamemode context (for example essentials.tp with context gamemode=spectator) The command is not registered to that player when they first connect in survival mode. When the player enters the gamemode (spectator) and then begin to type the command (/tp player) there is no tab completion and the command appears red even though the command WILL run properly
Should https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/entity/Player.html#updateCommands-- be ran when gamemodes are changed and gamemode: true
is set in extracontexts' config.yml?
I would agree; though, I am not sure what the design stance is when it comes to calculators storing (last) states. @lucko Are we able to run code that accesses the main thread?
Should be fixed now - see here for code:
https://github.com/LuckPerms/LuckPerms/blob/master/bukkit/src/main/java/me/lucko/luckperms/bukkit/context/BukkitPlayerCalculator.java#L148
https://github.com/LuckPerms/LuckPerms/blob/master/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitCommandListUpdater.java#L78