Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix AlternativeCommandsHandler not detecting some aliases #3856

Merged
merged 6 commits into from Dec 30, 2020

Conversation

JRoy
Copy link
Member

@JRoy JRoy commented Dec 23, 2020

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

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
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.

None yet

4 participants