14.3_DEV-1

Fix if Vault was disabled before T2CodeLib was loaded
This commit is contained in:
JaTiTV 2023-01-15 20:58:18 +01:00
parent 37db515726
commit c4b5996256
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,7 @@
<groupId>net.t2code</groupId> <groupId>net.t2code</groupId>
<artifactId>T2CodeLib</artifactId> <artifactId>T2CodeLib</artifactId>
<version>14.2</version> <version>14.3_DEV-1</version>
<packaging>jar</packaging> <packaging>jar</packaging>

View File

@ -6,6 +6,8 @@ import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend;
import net.t2code.t2codelib.Util; import net.t2code.t2codelib.Util;
import org.bukkit.plugin.RegisteredServiceProvider; import org.bukkit.plugin.RegisteredServiceProvider;
import java.util.Objects;
public class Vault { public class Vault {
public static Boolean vaultEnable; public static Boolean vaultEnable;
@ -13,7 +15,7 @@ public class Vault {
public static void loadVault() throws InterruptedException { public static void loadVault() throws InterruptedException {
long long_ = System.currentTimeMillis(); long long_ = System.currentTimeMillis();
if (T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null) { if (T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault") != null && Objects.requireNonNull(T2CodeLibMain.getPlugin().getServer().getPluginManager().getPlugin("Vault")).isEnabled()) {
vaultEnable = true; vaultEnable = true;
RegisteredServiceProvider<Economy> eco = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class); RegisteredServiceProvider<Economy> eco = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class);
if (eco != null) { if (eco != null) {