Repository navigation
Conversation
me4502
left a comment
There was a problem hiding this comment.
Thanks for the PR! I've left a comment, we had a change lined up for the Folia check to delegate to WorldEdit's, so that we didn't need to keep multiple plugins up to date as we chase various forks around.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| // Folia is Paper-based, so this is a good first check. | ||
| if (PaperLib.isPaper()) { | ||
| return ServerBuildInfo.buildInfo().isBrandCompatible(net.kyori.adventure.key.Key.key("papermc", "folia")); | ||
| return getWorldEdit().isFolia(); // Delegate check to WorldEdit |
There was a problem hiding this comment.
The Paper check is handled by WorldEdit so we can likely bring this up another level. It's also realistically safe to do this without the try/catch as WorldEdit also handles errors, and there shouldn't be any case where someone runs this WG version against an earlier WorldEdit (due to MC version support not overlapping)
There was a problem hiding this comment.
I kept the try/catch because WorldGuardPlugin#getWorldEdit throws CommandException in case the plugin is not installed or enabled at the time of call. I do however agree that the PaperLib#isPaper check is quite superfluous since that is already done by WorldEdit.
The Folia check currently only works when you run the official Folia Paper fork from the PaperMC team.
This simplifies it and simply checks for an existing class from upstream which would encompass all Folia forks and is pretty standard across all Folia compatible plugins.
This change has been tested and is currently live in our production servers. Feel free to request any changes or ask any questions that may arise!