diff --git a/src/main/java/pw/yumc/Yum/commands/YumCommand.java b/src/main/java/pw/yumc/Yum/commands/YumCommand.java index ceb04bc..39c0ab8 100644 --- a/src/main/java/pw/yumc/Yum/commands/YumCommand.java +++ b/src/main/java/pw/yumc/Yum/commands/YumCommand.java @@ -25,8 +25,8 @@ import cn.citycraft.PluginHelper.utils.StringUtil; import pw.yumc.Yum.Yum; import pw.yumc.Yum.api.YumAPI; import pw.yumc.Yum.manager.PluginsManager; -import pw.yumc.Yum.manager.RepositoryManager; import pw.yumc.Yum.manager.RepoSerialization.Repositories; +import pw.yumc.Yum.manager.RepositoryManager; /** * Yum命令基类 @@ -180,7 +180,7 @@ public class YumCommand implements HandlerCommands, Listener { if (plugin == null) { plugman.load(sender, pluginname); } else { - sender.sendMessage("§c错误: §b插件 " + pluginname + " §c已加载到服务器!"); + sender.sendMessage("§c错误: §a插件 §b" + pluginname + " §c已加载到服务器!"); } } diff --git a/src/main/java/pw/yumc/Yum/manager/NetworkManager.java b/src/main/java/pw/yumc/Yum/manager/NetworkManager.java index 2c7ea01..ab8e451 100644 --- a/src/main/java/pw/yumc/Yum/manager/NetworkManager.java +++ b/src/main/java/pw/yumc/Yum/manager/NetworkManager.java @@ -12,6 +12,7 @@ import org.bukkit.Bukkit; import org.bukkit.plugin.Plugin; import cn.citycraft.PluginHelper.config.FileConfig; +import cn.citycraft.PluginHelper.kit.ExceptionKit; import pw.yumc.Yum.Yum; /** @@ -21,14 +22,6 @@ import pw.yumc.Yum.Yum; * @author 喵♂呜 */ public class NetworkManager { - public static void throwException(final Throwable exception) { - NetworkManager. throwException0(exception); - } - - @SuppressWarnings("unchecked") - private static void throwException0(final Throwable exception) throws T { - throw (T) exception; - } public NetworkManager register(final Yum plugin) { Bukkit.getConsoleSender().sendMessage("§6[§bYum-网络管理§6] §a注入网络管理系统 将托管服务器网络!"); @@ -80,7 +73,7 @@ public class NetworkManager { Bukkit.getConsoleSender().sendMessage(String.format(str, plugin.getName(), urlinfo)); if (!allowPrimaryThread) { Bukkit.getConsoleSender().sendMessage("§6[§bYum-网络管理§6] §4已阻止插件 §b" + plugin.getName() + " §4在主线程访问网络!"); - throwException(new IOException("[Yum-网络管理] 已开启网络防护 不允许在主线程访问网络!")); + ExceptionKit.throwException(new IOException("[Yum-网络管理] 已开启网络防护 不允许在主线程访问网络!")); } } }