From 27d10f2d16a24f065625c4bb0e85b9159c21b328 Mon Sep 17 00:00:00 2001 From: BONNe Date: Fri, 2 Oct 2020 13:47:35 +0300 Subject: [PATCH] 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. --- .../world/bentobox/challenges/ChallengesAddon.java | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/main/java/world/bentobox/challenges/ChallengesAddon.java b/src/main/java/world/bentobox/challenges/ChallengesAddon.java index 8436dc5..da875a8 100644 --- a/src/main/java/world/bentobox/challenges/ChallengesAddon.java +++ b/src/main/java/world/bentobox/challenges/ChallengesAddon.java @@ -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(); }