Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-4258

PermissionAttachment.setPermission() does not update command suggestions.

XMLWordPrintable

    • Icon: New Feature New Feature
    • Resolution: Fixed
    • Icon: Minor Minor
    • None
    • None
    • None
    • [14:49:13 INFO]: This server is running CraftBukkit version git-Spigot-417cfb3-a0a27e5 (MC: 1.13) (Implementing API version 1.13-R0.1-SNAPSHOT) [14:49:13 INFO]: Checking version, please wait... [14:49:14 INFO]: You are running the latest version
    • Yes

      If a plugin changes a permission on a player, the new command autocomplete information is not sent to the client causing commands to erroneously appear red despite the player having access.

      The plugin attached must be run without operator permissions. To show that the issue exists even if permissions are set in PlayerJoinEvent, it will grant access to /gamemode upon joining. To show the issue persists later, the command /givekick will grant access to /kick.

      After logging in and typing /givekick, /gamemode and /kick will still show up as red but the player will have access.

      Side note: Since some servers have permission setups involving hundreds or even thousands of nodes, it may be a better idea to make sending the command suggestion packet optional upon using setPermission, or creating a new method entirely (PermissionAttachment.updateCommandSuggestions for example) to avoid bombarding clients with hundreds of packets when one packet sent at the end of setting permissions is sufficient.

      The NMS method in v1_13_R1 to refresh chat suggestions is net.minecraft.server.CommandDispatcher.a(EntityPlayer).

      Bug reports which do not 1) contain a declaration of testing in Vanilla and without plugins, or 2) in the case of plugin API bugs, contain a minimal reproduction case (source + jar please) will be closed. Bug reports must contain step by step instructions to reproduce the bug from a clean server install with no assumptions or prior knowledge. Also make sure you include the full output of /version in your report. Please copy and paste this statement to the bottom of your report to indicate that you have read and understood it.

        1. Main.java
          1 kB
        2. PermissionExample.jar
          1 kB
        3. plugin.yml
          0.2 kB

            Unassigned Unassigned
            NESlover Michael Dinkel
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: