Question about plugin depends

Hi everyone, is it possible in the latest version of Paper to better handle a situation where a plugin depend is missing? For example, my plugin call it NickServerCore depends on DiscordSRV. If I make one mistake in the discordSRV console and DiscordSRV dies, I don't want NickServerCore to die, too. I want to gracefully handle the errors. This is probably really simple, but I want to make sure I'm following best practice. Thanks!
6 Replies
Admincraft Meta
Thanks for asking your question!
Once you have finished, please close your thread. Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
command to close
/close !close !solved
Requested by _nickv#0
Nick
NickOP2y ago
Seems like I can just do something like this to remove and update the config?
getPlugin().getDescription().getDepend().remove(0);
getPlugin().reloadConfig();
getPlugin().getDescription().getDepend().remove(0);
getPlugin().reloadConfig();
NVM. Obviously wouldn't work because the plugin wouldn't start anyway without the depend. hmm.
ProGamingDk
ProGamingDk2y ago
maybe softdepend? should work
MrMcyeet
MrMcyeet2y ago
Yep Just check if it's enabled, and if not, don't enable (or disable) the modules of your plugin that use that api
Nick
NickOP2y ago
This is exactly what I ended up doing. Thanks!
MrMcyeet
MrMcyeet2y ago
Np

Did you find this page helpful?