E5AA Fixes reloadDataPacks() on Paper 1.21.4 build 63 and above by DerEchtePilz · Pull Request #627 · CommandAPI/CommandAPI · GitHub
[go: up one dir, main page]

Skip to content

Fixes reloadDataPacks() on Paper 1.21.4 build 63 and above #627

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 6 commits into from
Jan 3, 2025

Conversation

DerEchtePilz
Copy link
Member

Pointed out by @booky10 in Discord, due to the addition of the datapack lifecycle event in this commit (PaperMC/Paper@feb8756), PackRepository#setSelected now takes in an additional boolean. This results in a NoSuchMethodException when trying to run the current code.
This PR aims to fix that.
Also updates the current version to 9.7.1-SNAPSHOT in case we'd want to release this as a bug fix.

Co-authored-by: booky <53302036+booky10@users.noreply.github.com>
@willkroboth willkroboth self-requested a review January 1, 2025 17:31
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. None of these things are a big deal, functionality looks correct. Just "code style" stuff.

I tried a bit to test this, but weirdly I couldn't reproduce datapacks not working with the old CommandAPI version? I was probably doing something wrong, so I'll try to figure that out again when I have the time.

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.

Testing seems good - as far as I can tell, behavior seems the same as on old paper as well as consistent with Spigot. Although, I realized that I don't really know how the reloadDataPacks process is supposed to work :P. I was initially confused since the functions in my test datapack were reloading correctly. It seems that the functions get reloaded before setSelected is called, so even if that part errors, CommandAPI commands in datapacks still work. Fixing the exception is still definitely good since I'm sure the code after setSelected does important stuff. I just don't know what it does, so I don't know how to test it. But calling the method correctly does make sense to get us back to how it was working before, so I'll assume that's correct 👍.

A few more comments, but nothing at all important. I'd be happy to see this merged.

@DerEchtePilz DerEchtePilz merged commit 25c5080 into dev/dev Jan 3, 2025
4 checks passed
@DerEchtePilz DerEchtePilz deleted the dev/fix-additional-parameter branch January 3, 2025 15:51
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
0