diff --git a/pom.xml b/pom.xml index 01b1255..5f3ed40 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 pw.yumc Yum - 2.7.3 + 2.7.5 Yum Minecraft 服务器插件管理系统 @@ -66,9 +66,10 @@ §a全新 2.X 版本 更多守护与优化 §c注意 §6- §aYum更新需要§d重启服务器!§c重启服务器!§4重启服务器!; + §b2.7.5 §6- §c修复§eBukkitDev§e下载为空时的异常...; + §b2.7.4 §6- §e异步记录服务器报错与耗时操作 §a性能优化...; §b2.7.3 §6- §a调整lag判断条件 减少高峰期误报...; §b2.7.2 §6- §c修复mi lag命令参数错误报错 §d百分比显示能耗...; - §b2.7.1 §6- §c修复部分BUG(load可直接载入文件)...; DEBUG UTF-8 diff --git a/src/main/java/pw/yumc/Yum/Yum.java b/src/main/java/pw/yumc/Yum/Yum.java index 008f7e3..8930011 100644 --- a/src/main/java/pw/yumc/Yum/Yum.java +++ b/src/main/java/pw/yumc/Yum/Yum.java @@ -27,6 +27,7 @@ import pw.yumc.Yum.managers.ConfigManager; import pw.yumc.Yum.managers.MonitorManager; import pw.yumc.Yum.managers.NetworkManager; import pw.yumc.Yum.runnables.MainThreadCheckTask; +import pw.yumc.YumCore.update.SubscribeTask; /** * MC插件仓库 @@ -63,6 +64,7 @@ public class Yum extends JavaPlugin { initRunnable(); MonitorManager.init(); new VersionChecker(this); + new SubscribeTask(); YumAPI.updateRepo(Bukkit.getConsoleSender()); YumAPI.updateCheck(Bukkit.getConsoleSender()); } diff --git a/src/main/java/pw/yumc/Yum/api/YumAPI.java b/src/main/java/pw/yumc/Yum/api/YumAPI.java index 23d4f3c..5e60d38 100644 --- a/src/main/java/pw/yumc/Yum/api/YumAPI.java +++ b/src/main/java/pw/yumc/Yum/api/YumAPI.java @@ -227,7 +227,7 @@ public class YumAPI { */ public static void uninject(final Plugin plugin) { CommandInjector.uninject(plugin); - // ListenerInjector.uninject(plugin); + ListenerInjector.uninject(plugin); TaskInjector.uninject(plugin); } diff --git a/src/main/java/pw/yumc/Yum/commands/YumCommand.java b/src/main/java/pw/yumc/Yum/commands/YumCommand.java index 4abd691..3474369 100644 --- a/src/main/java/pw/yumc/Yum/commands/YumCommand.java +++ b/src/main/java/pw/yumc/Yum/commands/YumCommand.java @@ -130,6 +130,7 @@ public class YumCommand implements Listener, CommandExecutor { }); break; } + case "i": case "install": { sender.sendMessage(String.format(fsearching, id)); final List lf = Files.parseList(IOUtil.getData(String.format(BukkitDev.PLUGIN, id))); diff --git a/src/main/java/pw/yumc/Yum/models/BukkitDev.java b/src/main/java/pw/yumc/Yum/models/BukkitDev.java index 014d52a..fb30935 100644 --- a/src/main/java/pw/yumc/Yum/models/BukkitDev.java +++ b/src/main/java/pw/yumc/Yum/models/BukkitDev.java @@ -9,6 +9,8 @@ import org.json.simple.JSONArray; import org.json.simple.JSONObject; import org.json.simple.JSONValue; +import cn.citycraft.PluginHelper.kit.StrKit; + public class BukkitDev implements Serializable { public static String HOST = "https://api.curseforge.com"; public static String MODULE = "/servermods"; @@ -37,6 +39,9 @@ public class BukkitDev implements Serializable { } public static List parseList(final String json) { + if (StrKit.isBlank(json) || json.equals("[]")) { + return Collections.emptyList(); + } final List temp = new ArrayList<>(); final JSONArray ja = (JSONArray) JSONValue.parse(json); for (int i = 0; i < ja.size(); i++) { @@ -61,6 +66,9 @@ public class BukkitDev implements Serializable { } public static List parseList(final String json) { + if (StrKit.isBlank(json) || json.equals("[]")) { + return Collections.emptyList(); + } final List temp = new ArrayList<>(); final JSONArray ja = (JSONArray) JSONValue.parse(json); for (int i = 0; i < ja.size(); i++) {