AlessioDP / libby

A runtime dependency management library for plugins running in Java-based Minecraft server platforms.
MIT License
76 stars 20 forks source link

Add support for the new Paper Plugins. #13

Closed kyngs closed 1 year ago

kyngs commented 1 year ago

This PR adds PaperLibraryManager which can be used to load dependencies in plugins loaded via the new Paper API (https://docs.papermc.io/paper/dev/getting-started/paper-plugins) The BukkitLibraryManager does not work under Paper Plugins.

4drian3d commented 1 year ago

I think if you are going to make a Paper plugin, you should use the dependency download API that is already included in the server. That way you avoid problems, you avoid having to relocate the dependencies in compile and runtime, among other things I only just understood the need for this pull request, lgtm

kyngs commented 1 year ago

While that's true for a paper only plugin, it makes things unnecessarily complicated for multiplatform plugins which have the dependency download behavior in some common class.

EDIT: Also, by using library class loader this probably isolates the dependencies similarly to how you would do it via paper API

AlessioDP commented 1 year ago

Merged, thank you for this feature :)

The only issue is that it can be compiled only with Java 16+, I will look into it but not sure how to handle that.

frengor commented 1 year ago

The only issue is that it can be compiled only with Java 16+, I will look into it but not sure how to handle that.

In UltimateAdvancementAPI, we compile the project for Java 16 (for Libby it's 8), but the minimum required Java version for compiling is currently 17, since MC 19 uses Java 17. I think something like this may work for Libby as well, so simply removing Java 11 from the GitHub Action workflow file.