From c4b59962563447f3d84c2db1df7a67566d377e85 Mon Sep 17 00:00:00 2001 From: JaTiTV Date: Sun, 15 Jan 2023 20:58:18 +0100 Subject: [PATCH] 14.3_DEV-1 Fix if Vault was disabled before T2CodeLib was loaded --- pom.xml | 2 +- src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index 1a3ca29..798674d 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ net.t2code T2CodeLib - 14.2 + 14.3_DEV-1 jar diff --git a/src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java b/src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java index 15a4030..c3f307a 100644 --- a/src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java +++ b/src/main/java/net/t2code/t2codelib/SPIGOT/system/Vault.java @@ -6,6 +6,8 @@ import net.t2code.t2codelib.SPIGOT.api.messages.T2Csend; import net.t2code.t2codelib.Util; import org.bukkit.plugin.RegisteredServiceProvider; +import java.util.Objects; + public class Vault { public static Boolean vaultEnable; @@ -13,7 +15,7 @@ public class Vault { public static void loadVault() throws InterruptedException { 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; RegisteredServiceProvider eco = T2CodeLibMain.getPlugin().getServer().getServicesManager().getRegistration(Economy.class); if (eco != null) {