Not recognizing economy plugin
Putting the link to the issue here as it really is a core plugin issue and not resolved. I do not see how it is the other plugins fault (Vault or Xconomy) as they are loaded with no errors and working fine.
https://github.com/BentoBoxWorld/Challenges/issues/254#issue-674555020
Not sure if it is an issue with Xconomy enabling after Bento Box looks for the plugin:
[12:31:26] [Server thread/INFO]: [Vault] Loading Vault v1.7.3-b131 [12:31:26] [Server thread/INFO]: [BentoBox] Loading BentoBox v1.14.2 [12:31:26] [Server thread/INFO]: [PlayerKits] Loading PlayerKits v2.6.2 [12:31:26] [Server thread/INFO]: [XConomy] Loading XConomy v2.5.11 [12:31:26] [Server thread/INFO]: [Vault] Enabling Vault v1.7.3-b131 [12:31:27] [Server thread/INFO]: [Vault] [Permission] SuperPermissions loaded as backup permission system. [12:31:27] [Server thread/INFO]: [Vault] Enabled Version 1.7.3-b131 [12:31:27] [Server thread/INFO]: [BentoBox] Enabling BentoBox v1.14.2 [12:31:27] [Server thread/INFO]: [BentoBox] Loading Settings from config.yml... [12:31:28] [Server thread/INFO]: [BentoBox] Hooking with Vault... [12:31:28] [Server thread/ERROR]: [BentoBox] Could not hook with Vault because: no plugin supporting economy has been found. Skipping... [12:31:28] [Server thread/INFO]: [BentoBox] Loading addons... [12:31:29] [Server thread/INFO]: [BentoBox] Loaded 11 addons. [12:31:30] [Server thread/INFO]: [XConomy] Enabling XConomy v2.5.11
[12:31:28] [Server thread/INFO]: [BentoBox] Hooking with Vault... [12:31:28] [Server thread/ERROR]: [BentoBox] Could not hook with Vault because: no plugin supporting economy has been found.
The error occurs when the Economy Service Provider could not be gathered.
If I recall correctly, this occurs when there are no plugins that registers it (Vault does not, it just provides the API for it). In that case, I think it's because XConomy is enabled after BentoBox, although it's loaded before BentoBox.
And that's actually "to be expected". XConomy registers the Economy Service Provider on enable.
https://github.com/YiC200333/XConomy/blob/master/src/main/java/me/Yi/XConomy/XConomy.java#L56
I don't really know what we could do for this... Most economy plugins do not have this issue; and while I have a few ideas of what we could change on our end, I'm afraid it's going to do more harm than good. Try to contact the developer of this plugin and ask him if he can find a workaround. If most economy plugins don't have this issue, that means there must be some way to avoid it.
Do you have a suggestion of an economy plugin that does work? I have tried two now ☹️
This also happens with CMI (using normal Vault + CMIInjector...not their Vault fork). But...this is on 1.16.3 so that also may be a contributing problem. I only mention this as a mental note (a caveat). I think it was ShopGUI+ that also does not like their fork of fault...which forces the use of CMI's injector. Maybe BentoBox needs to load before the injector? idk and testing is pointless on 1.16.x. Hope these thoughts help.
Since this is an issue with the order in which plugins are loaded, and addons are always enabled on a scheduler task (ensuring after all other plugins are enabled), I did some snooping around how various addons (Biomes, Challenges, etc.) are loaded - there would be nothing stopping an addon from hooking into Vault, and other addons would be able to use this provided the addon that hooks into Vault loads first.
So here's a hacky, addon solution: https://github.com/jstnf/NoVaultLeftBehind
package world.bentobox.novaultleftbehind;
import world.bentobox.bentobox.api.addons.Addon;
import world.bentobox.bentobox.hooks.VaultHook;
public class NoVaultLeftBehind extends Addon {
@Override
public void onEnable() {
// This addon is simple - just attempt to hook Vault again
// This relies on this addon being enabled FIRST
if (!getPlugin().getHooks().getHook("Vault").isPresent()) {
getLogger().info("Vault was not previously hooked when BentoBox was loading.");
getLogger().info("Attempting to hook again, just in case...");
getPlugin().getHooks().registerHook(new VaultHook());
}
}
@Override
public void onDisable() { }
}
Before:

After:
