16.7_dev-19
This commit is contained in:
@@ -3,7 +3,7 @@ package net.t2code.t2codelib.SPIGOT.system;
|
||||
import net.milkbowl.vault.economy.Economy;
|
||||
import net.milkbowl.vault.permission.Permission;
|
||||
import net.t2code.t2codelib.SPIGOT.api.messages.T2C_Send;
|
||||
import net.t2code.t2codelib.Util;
|
||||
import net.t2code.t2codelib.util.T2C_Util;
|
||||
import org.bukkit.plugin.RegisteredServiceProvider;
|
||||
|
||||
import java.util.Objects;
|
||||
@@ -15,37 +15,37 @@ public class Vault {
|
||||
|
||||
public static void loadVault() throws InterruptedException {
|
||||
long long_ = System.currentTimeMillis();
|
||||
if (T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null && Objects.requireNonNull(T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault")).isEnabled()) {
|
||||
if (T2C_Main.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null && Objects.requireNonNull(T2C_Main.getPlugin().getServer().getPluginManager().getPlugin("Vault")).isEnabled()) {
|
||||
vaultEnable = true;
|
||||
RegisteredServiceProvider<Economy> eco = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
|
||||
RegisteredServiceProvider<Economy> eco = T2C_Main.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
|
||||
if (eco != null) {
|
||||
T2CodeLibMain.setEco(eco.getProvider());
|
||||
if (T2CodeLibMain.getEco() != null) {
|
||||
T2C_Main.setEco(eco.getProvider());
|
||||
if (T2C_Main.getEco() != null) {
|
||||
connected = true;
|
||||
|
||||
T2C_Send.sendStartTextCenter(Util.getPrefix(), " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", true);
|
||||
T2C_Send.sendStartTextCenter(T2C_Util.getPrefix(), " §2Vault / Economy successfully connected!" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", false);
|
||||
} else {
|
||||
connected = false;
|
||||
T2C_Send.sendStartTextCenter(Util.getPrefix(), " §4Economy could not be connected / found! [1]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", true);
|
||||
T2C_Send.sendStartTextCenter(T2C_Util.getPrefix(), " §4Economy could not be connected / found! [1]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", false);
|
||||
}
|
||||
} else {
|
||||
connected = false;
|
||||
T2C_Send.sendStartTextCenter(Util.getPrefix(), " §4Economy could not be connected / found! [2]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", true);
|
||||
T2C_Send.sendStartTextCenter(T2C_Util.getPrefix(), " §4Economy could not be connected / found! [2]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", false);
|
||||
}
|
||||
RegisteredServiceProvider<Permission> perm = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Permission.class);
|
||||
RegisteredServiceProvider<Permission> perm = T2C_Main.getPlugin().getServer().getServicesManager().getRegistration(Permission.class);
|
||||
if (perm != null) {
|
||||
T2CodeLibMain.setPerm(perm.getProvider());
|
||||
T2C_Main.setPerm(perm.getProvider());
|
||||
}
|
||||
} else {
|
||||
vaultEnable = false;
|
||||
connected = false;
|
||||
T2C_Send.sendStartTextCenter(Util.getPrefix()," §4Vault could not be connected! [3]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", true);
|
||||
T2C_Send.sendStartTextCenter(T2C_Util.getPrefix()," §4Vault could not be connected! [3]" + " §7- §e" + (System.currentTimeMillis() - long_) + "ms", false);
|
||||
}
|
||||
}
|
||||
|
||||
public static void vaultDisable() {
|
||||
if (!connected) return;
|
||||
connected = false;
|
||||
T2C_Send.sendStartTextCenter(Util.getPrefix(), " §4Vault / Economy successfully deactivated.", true);
|
||||
T2C_Send.sendStartTextCenter(T2C_Util.getPrefix(), " §4Vault / Economy successfully deactivated.", false);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user