NPE preventing from using the API
mgl opened this issue ยท 5 comments
What steps will reproduce the problem?
Use this code in a plugin:
SilkUtil su = SilkUtil.hookIntoSilkSpanwers();
Expected output
No error.
What do you see instead?
Error in console preventing my plugin from loading.
Log file of the issue/error
/version output?
CraftBukkit version git-TacoSpigot-"65fd35f" (MC: 1.8.8) (Implementing API version 1.8.8-R0.2-SNAPSHOT)
SilkSpawners version
4.0.0
Problem happens on 3.7.4 too.
Thanks!
You should document the API, I only found this page with broken javadocs: https://dev.bukkit.org/projects/silkspawners/pages/api
Can you please post some code snippets of your plugin, where you call the SilkSpawners API? I'm missing a reproducible example.
Duplicate of #87
Thanks!
Make sure to add depend: [SilkSpawners]
to your plugin.yml
and move the initialization of SilkUtil into your onEnable()
method - otherwise SilkSpawners is not yet correctly initialized.
private SilkUtil su;
@Override
public void onEnable() {
// do your stuff
su = SilkUtil.hookIntoSilkSpanwers();
...
}
I'll add a warning nevertheless.