8000 Register commands as plugin commands on Paper 1.20.6 and above by DerEchtePilz · Pull Request #629 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content

Register commands as plugin commands on Paper 1.20.6 and above #629

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

Merged
merged 14 commits into from
Feb 27, 2025

Conversation

DerEchtePilz
Copy link
Member
@DerEchtePilz DerEchtePilz commented Jan 4, 2025

Fixes #583
Fixes #578

The behaviour for #578 is unexpected, but corect. After this PR, instead of returning the wrong permission, getCommandMap("commandname").getPermission() will return null. This is the correct behaviour which can easily be verified if you follow the initialization chain starting here: https://github.com/PaperMC/Paper/blob/09f1f88f58a03f61092f8636ad780d42db87d8d9/paper-server/src/main/java/io/papermc/paper/command/brigadier/PaperBrigadier.java#L49

@DerEchtePilz DerEchtePilz removed the request for review from willkroboth February 19, 2025 08:55
This fixes the issue described on discord where if a plugin registeres commands with the CommandAPI and Paper's Brigadier API, that the commands that were registered with the CommandAPI do
not appear in the plugin's help topic (/help PluginName) after running `minecraft:reload`.

This reverts commit 35ecee0.
@DerEchtePilz DerEchtePilz force-pushed the experiment/plugin-commands branch 2 times, most recently from f2fd1e7 to e58b0e1 Compare February 21, 2025 20:02
Copy link
Collaborator
@willkroboth willkroboth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just static code analysis right now, haven't re-tested the changes made since I last tried this.

Copy link
Collaborator
@willkroboth willkroboth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Redid the tests I mentioned on Discord and everything seems to be working well. Just a few optional comments, but functionality-wise seems good to merge.

@DerEchtePilz DerEchtePilz merged commit 3463253 into dev/dev Feb 27, 2025
2 checks passed
@DerEchtePilz DerEchtePilz deleted the experiment/plugin-commands branch March 1, 2025 09:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

dispatchCommand not working for CommandAPI commands on 1.20.6+ Paper Commands in the CommandMap don't have the correct permission on Paper
2 participants
0