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

Remove ".paper-remapped/" from plugin path #91

Merged
merged 20 commits into from
Oct 18, 2024
Merged

Conversation

pavog
Copy link
Member

@pavog pavog commented Oct 2, 2024

In the latest version 1.21, Paper has changed some internals so that the plugins are apparently loaded from the path /plugins/.paper-remapped/ instead of /plugins/. This also causes the error messages to change the plugin path from /plugins/<filename> to /plugins/.paper-remapped/<filename>.

We extract the plugin path from the log and use it in the problem message that we display to the user.
We also use the plugin path to display it in solutions. E.g.: Delete the file plugins/.paper-remapped/mclogs-bukkit-dev.jar.
But the user cannot see or access the .paper-remapped folder, so they cannot delete the file from there.
This can lead to confusion.
Therefore, this PR changes this behavior and replaces the path /plugins/.paper-remapped/ with /plugins/ in all places.

In addition, this PR changes the following:

  • Two new functions have been added to the PluginProblem class :
    • correctPluginPath changes plugins/.paper-remapped/ to plugins/
    • extractPluginName can extract the name of the plugin from the path, this can simplify some regexes in the problem classes
  • ⚠️ Many of the problems that are actually plugin problems now extend from the PluginProblem class, so the member variable $pluginName can be removed and they offer the PluginInstallDifferentVersionSolution
  • Adds some new tests for PaperMC 1.21.1
  • Adds the PluginInstallDifferentVersionSolution to UnsupportedClassVersionProblem

…nd PluginFileSolution + Add PluginInstallDifferentVersionSolution and PluginRemoveFileSolution in BukkitPluginFileProblem and just call parent::setMatches in subclasses
…ce PluginRemoveFileSolution with FileDeleteSolution.
@pavog pavog requested a review from matthi4s October 15, 2024 13:43
@pavog pavog merged commit 874a5d1 into master Oct 18, 2024
3 checks passed
@pavog pavog deleted the fix-paper-remapped-paths branch October 18, 2024 15:23
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