Skip to content

Commit

Permalink
Fix a bug with Vault Economy not found in loading process.
Browse files Browse the repository at this point in the history
If plugin that enables Vault do it after BentoBox, then a lot of addons disabled their economy settings. This should fix it.
  • Loading branch information
BONNe committed Oct 2, 2020
1 parent e6f8293 commit 27d10f2
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/main/java/world/bentobox/challenges/ChallengesAddon.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*/
Expand Down Expand Up @@ -219,11 +214,10 @@ public void onEnable() {
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();
}

Expand Down Expand Up @@ -531,7 +525,7 @@ public Settings getChallengesSettings()
*/
public boolean isEconomyProvided()
{
return this.economyProvided;
return this.vaultHook != null && this.vaultHook.hook();
}


Expand Down

0 comments on commit 27d10f2

Please sign in to comment.