Skip to content

Separate the API away from the plugin #125

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

Closed
wants to merge 2 commits into from
Closed

Conversation

ashtton
Copy link

@ashtton ashtton commented Jun 20, 2025

Love this API, although I'm wanting to use it without installing it on the server. I shaded it and then realized you couldn't access the API due to the API being so baked into the plugin.

I've removed 0 features, only separated the API from the plugin.
I also put the jitpack url / dependency on the README for easy copy & paste.

I highly appreciate the library you've created!!

Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

Catch issues before they fail your Quality Gate with our IDE extension SonarQube for IDE

Copy link
Owner

@koca2000 koca2000 left a comment

Choose a reason for hiding this comment

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

Hi! Thank you for the PR and sorry for my late response. Please see my comments.

Comment on lines +38 to +41
You can also shade the API into your existing plugin and initialize it using
```java
NoteBlockAPI.initializeAPI(this)
```
Copy link
Owner

Choose a reason for hiding this comment

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

I personally wouldn't mind this, but strictly speaking it would be a violation of the LGPL license chosen by the original author of the NoteBlockAPI. If you shade the library and use a relocation (which you should always do in this case), then it is no longer possible to replace it with a modified version unless your plugin is open source, because Java has no mechanism that would allow that. I suggest to remove this part of the README or to mention the fact that plugins that shade the API have to be open source.

@@ -23,9 +21,10 @@
/**
* Main class; contains methods for playing and adjusting songs for players
*/
public class NoteBlockAPI extends JavaPlugin {
public class NoteBlockAPI {
Copy link
Owner

Choose a reason for hiding this comment

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

Unfortunately, there are plugins that rely on the fact that NoteBlockAPI class is JavaPlugin. Therefore, this would be a breaking change.

@ashtton
Copy link
Author

ashtton commented Aug 12, 2025

No problem, I understand.

@ashtton ashtton closed this Aug 12, 2025
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.

2 participants