-
-
Notifications
You must be signed in to change notification settings - Fork 131
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
[API] "com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI.plugin" is null #1133
Comments
SSB sets the instance when plugin loads, and this field cant be null unless you access it before its initialized. |
I added a null check for the API instance. |
I have the same issue @OmerBenGera |
Send me your entire logs (Upload them to pastebin) |
For sure ! |
Mind showing me the entire code and how you use the API? |
My bad @OmerBenGera, this is the good log* |
File (sgUtiles.java) File (userUtils.java)
|
I have no clue why it happens. |
Mind sending me a copy of your plugin? |
If you want (in pm Discord) |
What's your discord? I will open a ticket for you |
Teyir#4439 |
After looking at your jar, I can clearly see what the issue is. Make sure you don't shade the API into your jar, and only have it on runtime. |
Oh I have make a mistake with my maven.... Sorry for this "issue" |
Minecraft's Version
1.18.2 (paper)
Plugin's Version
latest dev build and API 1.10.0
Describe the bug
I have this error
java.lang.NullPointerException: Cannot invoke "com.bgsoftware.superiorskyblock.api.SuperiorSkyblock.getProviders()" because "com.bgsoftware.superiorskyblock.api.SuperiorSkyblockAPI.plugin" is null
I can't init SuperiorSkyblockAPI.plugin to my plugin.
I already add the softdepend [SuperiorSkyblock2].
To Reproduce
Main function onEnable:
hookSuperiorSkyblock(this); SuperiorSkyblockAPI.getProviders();
function hookSuperiorSkyblock()
private void hookSuperiorSkyblock(Plugin plugin) { for(RegisteredListener listener : HandlerList.getRegisteredListeners(Bukkit.getPluginManager().getPlugin("SuperiorSkyblock2"))) { try { if(listener.getListener().getClass() == Class.forName("com.bgsoftware.superiorskyblock.module.generators.listeners.GeneratorsListener")){ HandlerList.unregisterAll(listener.getListener()); plugin.getLogger().info(String.format("%s: Unregistered inbuilt-generator from Plugin (%s) to use this one", this.getClass().getSimpleName(), listener.getListener().getClass().getName())); } } catch (ClassNotFoundException e) { plugin.getLogger().warning(String.format("%s: Generator class for inbuilt-generator not found (%s)", this.getClass().getSimpleName(), listener.getListener().getClass().getName())); } } }
My pom.xml
<dependency> <groupId>com.bgsoftware</groupId> <artifactId>SuperiorSkyblockAPI</artifactId> <version>1.10.0</version> </dependency>
Thank you very much !
Additional Information
No response
The text was updated successfully, but these errors were encountered: