Skip to content

Commit 332e7ad

Browse files
committed
Fix error when loading
1 parent 438ff3f commit 332e7ad

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/main/java/systems/kscott/randomspawnplus/RandomSpawnPlus.java

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import net.ess3.api.IEssentials;
66
import net.luckperms.api.LuckPerms;
77
import net.milkbowl.vault.economy.Economy;
8-
import org.bukkit.Bukkit;
98
import org.bukkit.configuration.file.FileConfiguration;
109
import org.bukkit.plugin.RegisteredServiceProvider;
1110
import org.bukkit.plugin.java.JavaPlugin;
@@ -32,7 +31,7 @@ public final class RandomSpawnPlus extends JavaPlugin {
3231
private ConfigFile spawnsManager;
3332

3433
@Getter
35-
private Economy economy;
34+
private static Economy economy = null;
3635

3736
@Getter
3837
private LuckPerms luckPerms;
@@ -126,13 +125,12 @@ private void setupPermissions() {
126125
luckPerms = rsp.getProvider();
127126
}
128127

129-
private void setupEconomy() throws Exception {
128+
private boolean setupEconomy() {
130129
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
131130
if (rsp == null) {
132-
throw new Exception("Error when loading the Vault API");
131+
return false;
133132
}
134133
economy = rsp.getProvider();
134+
return economy != null;
135135
}
136-
137-
138136
}

0 commit comments

Comments
 (0)