Skip to content

Commit

Permalink
Fix error when loading
Browse files Browse the repository at this point in the history
  • Loading branch information
Dreeam-qwq committed Nov 20, 2022
1 parent 438ff3f commit 332e7ad
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import net.ess3.api.IEssentials;
import net.luckperms.api.LuckPerms;
import net.milkbowl.vault.economy.Economy;
import org.bukkit.Bukkit;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.RegisteredServiceProvider;
import org.bukkit.plugin.java.JavaPlugin;
Expand All @@ -32,7 +31,7 @@ public final class RandomSpawnPlus extends JavaPlugin {
private ConfigFile spawnsManager;

@Getter
private Economy economy;
private static Economy economy = null;

@Getter
private LuckPerms luckPerms;
Expand Down Expand Up @@ -126,13 +125,12 @@ private void setupPermissions() {
luckPerms = rsp.getProvider();
}

private void setupEconomy() throws Exception {
private boolean setupEconomy() {
RegisteredServiceProvider<Economy> rsp = getServer().getServicesManager().getRegistration(Economy.class);
if (rsp == null) {
throw new Exception("Error when loading the Vault API");
return false;
}
economy = rsp.getProvider();
return economy != null;
}


}

0 comments on commit 332e7ad

Please sign in to comment.