From 894fa0e3a660479c4f508c9a056b5bf5186061f2 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Sun, 2 Oct 2016 22:50:20 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E6=A3=80=E6=B5=8B=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- src/main/java/pw/yumc/YumCore/plugin/vault/VaultChat.java | 3 +-- src/main/java/pw/yumc/YumCore/plugin/vault/VaultEconomy.java | 3 +-- .../java/pw/yumc/YumCore/plugin/vault/VaultPermission.java | 3 +-- 3 files changed, 3 insertions(+), 6 deletions(-) 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());