镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Fix AlternativeCommandsHandler not detecting some aliases - #3856

Merged
pop4959 merged 6 commits into
EssentialsX:2.xfrom
JRoy:fix/alt-command-handler
Dec 30, 2020
Merged

pop4959 merged 6 commits into
EssentialsX:2.xfrom
JRoy:fix/alt-command-handler

Conversation

@JRoy

@JRoy JRoy commented Dec 23, 2020 •

Copy link
Copy Markdown
Member

Before this PR, AlternativeCommandsHandler would iterate through all the values of the command map rather than going by the keys. This should work with 99.99999% of plugins but for some god forsaken reason Towny (go figures) hides its aliases from Bukkit for the /town command, exclusively. This causes Essentials to not be able to detect the /t alias and therefore not be able to forward it. The new solution was to iterate over all keys in the known commands map which contains all aliases at time of registration and maps them to a Command object. This, for some reason, recognizes the /t alias for Towny's /town command and all is right in the world.

Also included in this PR;

  • Bumped Paper Version to 1.16.4
    • Should probably be done during MC updates since it throws peer-not-authenticated errors from time to time otherwise
  • Enabled advanced gradle caching
    • Will store caches of the build in gradle cache directory allowing for caches to survive a clean.
  • Enabled checkstyle checks before commit in IntellJ
  • Added a debug message to indicate Essentials is searching for an alternative command to execute

@JRoy JRoy added the type: bugfix PRs that fix bugs in EssentialsX. label Dec 23, 2020
@JRoy JRoy added this to the 2.19.0 milestone Dec 23, 2020
@JRoy
JRoy requested a review from mdcfe December 23, 2020 03:36
@ChrisTaylor201

Copy link
Copy Markdown

This also seems to fix aliases of other plugins, for example /msg from ChatManager.

Before

[11:55:45] [Server thread/INFO]: CONSOLE issued server command: /ess ver
[11:55:45] [Server thread/INFO]: Server version: 1.16.4-R0.1-SNAPSHOT git-Paper-352 (MC: 1.16.4)
[11:55:45] [Server thread/INFO]: EssentialsX version: 2.19.0-dev+29-318df64
[11:55:45] [Server thread/INFO]: LuckPerms version: 5.2.67
[11:55:45] [Server thread/INFO]: Vault version: 1.7.3-b131
[11:55:53] [Server thread/INFO]: ChrisTaylor issued server command: /msg
[11:55:53] [Server thread/INFO]: [Essentials] ChrisTaylor was denied access to command.
[11:55:54] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - chatmanager.bypass.mutechat - false
[11:55:54] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - chatmanager.bypass.commandspy - false
[11:55:54] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - essentials.mail - undefined
[11:55:54] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - essentials.msg - undefined

After

[12:05:27] [Server thread/INFO]: CONSOLE issued server command: /ess ver
[12:05:27] [Server thread/INFO]: Server version: 1.16.4-R0.1-SNAPSHOT git-Paper-352 (MC: 1.16.4)
[12:05:27] [Server thread/INFO]: EssentialsX version: 2.19.0-dev+329-c0321a4
[12:05:27] [Server thread/INFO]: LuckPerms version: 5.2.67
[12:05:27] [Server thread/INFO]: Vault version: 1.7.3-b131
[12:05:34] [Server thread/INFO]: ChrisTaylor issued server command: /msg
[12:05:34] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - chatmanager.bypass.mutechat - false
[12:05:34] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - chatmanager.bypass.commandspy - false
[12:05:34] [luckperms-scheduler-worker-0/INFO]: [LP] VB > christaylor - chatmanager.message - true

@pop4959
pop4959 merged commit 02ba924 into EssentialsX:2.x Dec 30, 2020
@JRoy
JRoy deleted the fix/alt-command-handler branch December 30, 2020 20:34
ressidell pushed a commit to ressidell/Essentials that referenced this pull request Apr 27, 2025
rewsdjad1 pushed a commit to rewsdjad1/EssentialsXPlus that referenced this pull request Aug 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: bugfix PRs that fix bugs in EssentialsX.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants