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 comment duplication in config files on 1.18 #483

Merged
merged 2 commits into from
Jan 24, 2022
Merged

Conversation

nicegamer7
Copy link
Member

This PR fixes comment duplication in config files on 1.18 (#480) by only adding comments when the file is first created.

1.18 adds support for comments, and so it's no longer necessary to add comments every time the server starts. This was the reason for the "duplication" (not actually duplication, it was growing by one line at a time).

Initially I made our wrapper class inherit from YamlConfiguration (which is why I wanted #361 merged, it made that much easier imo), and then I initialized the config objects to either YamlConfiguration or our wrapper class, depending on the server's version. However, I learned afterwards that we still need to add comments when the file is first created, and that is where this solution came from.

@nicegamer7 nicegamer7 linked an issue Jan 10, 2022 that may be closed by this pull request
@nicegamer7 nicegamer7 added the PR: Bugfix Pull requests to fix bugs found in MV. label Jan 10, 2022
Copy link
Member

@benwoo1110 benwoo1110 left a comment

Choose a reason for hiding this comment

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

Tested on my end, comment duplication looks to be fixed. Test build for others to try:
Multiverse-Inventories-4.2.3-SNAPSHOT.zip

@nicegamer7
Copy link
Member Author

Updated to use PaperLib, should be good to go now.

I think we should integrate PaperLib into Core for V5. We can use it for things like async teleports.

Copy link
Member

@benwoo1110 benwoo1110 left a comment

Choose a reason for hiding this comment

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

👍

@benwoo1110 benwoo1110 merged commit a0ee588 into main Jan 24, 2022
@nicegamer7 nicegamer7 deleted the comment_duplication branch January 24, 2022 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR: Bugfix Pull requests to fix bugs found in MV.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

YAML comments duplication
3 participants