Skip to content

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

Merged
DerEchtePilz merged 6 commits intodev/devfrom
dev/fix-additional-parameter
Jan 3, 2025
Merged

Fixes reloadDataPacks() on Paper 1.21.4 build 63 and above#627
DerEchtePilz merged 6 commits intodev/devfrom
dev/fix-additional-parameter

Conversation

@DerEchtePilz
Copy link
Copy Markdown
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.

@willkroboth willkroboth self-requested a review January 1, 2025 17:31
Copy link
Copy Markdown
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
Copy Markdown
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
@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