Fix a bug with Vault Economy not found in loading process.

If plugin that enables Vault do it after BentoBox, then a lot of addons disabled their economy settings. This should fix it.
This commit is contained in:
BONNe 2020-10-02 13:47:35 +03:00
parent e6f82937c0
commit 27d10f2d16

View File

@ -57,11 +57,6 @@ public class ChallengesAddon extends Addon {
private boolean hooked;
/**
* This boolean indicate if economy is enabled.
*/
private boolean economyProvided;
/**
* VaultHook that process economy.
*/
@ -219,11 +214,10 @@ public class ChallengesAddon extends Addon {
if (!vault.isPresent() || !vault.get().hook())
{
this.vaultHook = null;
this.logWarning("Economy plugin not found so money options will not work!");
this.logWarning("Vault plugin not found. Economy will not work!");
}
else
{
this.economyProvided = true;
this.vaultHook = vault.get();
}
@ -531,7 +525,7 @@ public class ChallengesAddon extends Addon {
*/
public boolean isEconomyProvided()
{
return this.economyProvided;
return this.vaultHook != null && this.vaultHook.hook();
}