FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Hotfix CommandAPI throwing errors because of Paper's Brigadier command API by DerEchtePilz · Pull Request #555 · CommandAPI/CommandAPI · GitHub

Hotfix CommandAPI throwing errors because of Paper's Brigadier command API - #555

Merged
DerEchtePilz merged 2 commits into
dev/devfrom
dev/paper-hotfix
May 12, 2024
Merged

Hotfix CommandAPI throwing errors because of Paper's Brigadier command API#555
DerEchtePilz merged 2 commits into
dev/devfrom
dev/paper-hotfix

Conversation

DerEchtePilz commented May 12, 2024
edited
Loading

Copy link
Copy Markdown
Member

Some of this is not pretty but doing this the VarHandle-less way also got rid of the exception in the console which I didn't seem to do with VarHandles.

Nevertheless, this should make it possible to at least register commands using Paper 1.20.6 build 65 and onwards.

I plan to handle all this properly in #517

Regards Paper 1.20.6, build 65+, they've merged the Brigadier command API and removed the vanillaCommandDispatcher field.
+ fixed exception appearing in server log, this isn't done with VarHandles but I think because this is a hotfix, it is fine for now.
I will handle all this properly on dev/commandapi-paper and #517

Sytm commented May 12, 2024

Copy link
Copy Markdown

I gave this PR a quick spin with my plugin and it seems to work without any issues

DerEchtePilz merged commit 8a763c9 into dev/dev May 12, 2024
Comment on lines +97 to +107
private static final Field commandDispatcher;

static {
Field temporary;
try {
temporary = MinecraftServer.class.getDeclaredField("vanillaCommandDispatcher");
} catch (Exception e) {
temporary = null;
}
commandDispatcher = temporary;
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

A field that could be null that doesn't have @Nullable or wrapped in an Optional! 🫢

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL