koca2000 / NoteBlockAPI

https://www.spigotmc.org/resources/noteblockapi.19287/
GNU Lesser General Public License v3.0
119 stars 40 forks source link

NoteBlockAPI.getAPI() is null #108

Closed 42784 closed 1 month ago

42784 commented 1 month ago

Error reported during the use of paper 1.20.1:java.lang.NullPointerException: Cannot invoke "com.xxmicloxx.NoteBlockAPI.NoteBlockAPI.handleDeprecated(java.lang.StackTraceElement[])" because the return value of "com.xxmicloxx.NoteBlockAPI.NoteBlockAPI.getAPI()" is null

I can confirm that this API has loaded normally on the server (as can be seen through/plugins)

I used the jar obtained from Maven and the jar downloaded from Spigot to try com. xxmicloxx NoteBlockAPI. NoteBlockAPI. getAPI(), but both are null

By reading the source code of SongPlayer, I found this code: public SongPlayer (Song song, SoundCategory southern category) NoteBlockAPI. getAPI(). handleDepreciated (Thread. current Thread(). getStackTrace());

Because NoteBlockAPI. getAPI() is null, I encountered an error when using this plugin

I am not good at English. This was translated directly from Chinese through a translator, which may have some grammar errors and be difficult to understand. I am so sorry PixPin_2024-08-10_01-20-17 PixPin_2024-08-10_01-21-44

koca2000 commented 1 month ago

Add <scope>provided</scope> to your pom inside the NoteBlockAPI dependency.

42784 commented 1 month ago

This is useful, I solved the problem and successfully played music on MC! thank!

koca2000 commented 1 month ago

I am glad to hear that.