diff --git a/src/main/java/pw/yumc/YumCore/plugin/vault/VaultChat.java b/src/main/java/pw/yumc/YumCore/plugin/vault/VaultChat.java index 2aa2941..1405781 100644 --- a/src/main/java/pw/yumc/YumCore/plugin/vault/VaultChat.java +++ b/src/main/java/pw/yumc/YumCore/plugin/vault/VaultChat.java @@ -19,8 +19,7 @@ public class VaultChat extends VaultBase { static { final RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Chat.class); - chat = rsp.getProvider(); - if (chat == null) { + if (rsp == null || (chat = rsp.getProvider()) == null) { PKit.disable("已加载 Vault 但是未找到聊天相关插件 停止加载..."); } else { Log.info("发现 Vault 使用聊天管理系统 " + chat.getName()); diff --git a/src/main/java/pw/yumc/YumCore/plugin/vault/VaultEconomy.java b/src/main/java/pw/yumc/YumCore/plugin/vault/VaultEconomy.java index 71cca21..050ba7c 100644 --- a/src/main/java/pw/yumc/YumCore/plugin/vault/VaultEconomy.java +++ b/src/main/java/pw/yumc/YumCore/plugin/vault/VaultEconomy.java @@ -20,8 +20,7 @@ public class VaultEconomy extends VaultBase { static { final RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Economy.class); - economy = rsp.getProvider(); - if (economy == null) { + if (rsp == null || (economy = rsp.getProvider()) == null) { PKit.disable("已加载 Vault 但是未找到经济相关插件 停止加载..."); } else { Log.info("发现 Vault 使用经济管理系统 " + economy.getName()); diff --git a/src/main/java/pw/yumc/YumCore/plugin/vault/VaultPermission.java b/src/main/java/pw/yumc/YumCore/plugin/vault/VaultPermission.java index 6618044..6a63b46 100644 --- a/src/main/java/pw/yumc/YumCore/plugin/vault/VaultPermission.java +++ b/src/main/java/pw/yumc/YumCore/plugin/vault/VaultPermission.java @@ -19,8 +19,7 @@ public class VaultPermission extends VaultBase { static { final RegisteredServiceProvider rsp = Bukkit.getServer().getServicesManager().getRegistration(Permission.class); - permission = rsp.getProvider(); - if (permission == null) { + if (rsp == null || (permission = rsp.getProvider()) == null) { PKit.disable("已加载 Vault 但是未找到权限相关插件 停止加载..."); } else { Log.info("发现 Vault 使用权限管理系统 " + permission.getName());