From 3c270657f8d5499854c6d065c2865e225e013d52 Mon Sep 17 00:00:00 2001 From: 502647092 Date: Fri, 3 Feb 2017 01:27:01 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=93=E5=BA=93?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E8=AF=BB=E5=8F=96=E9=94=99=E8=AF=AF=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 502647092 --- pom.xml | 20 ++++++------------- .../yumc/Yum/managers/RepositoryManager.java | 3 --- .../java/pw/yumc/Yum/models/PluginInfo.java | 4 ++-- .../java/pw/yumc/Yum/models/RepoCache.java | 20 ++++++++++--------- src/main/resources/plugin.yml | 10 +++++----- 5 files changed, 24 insertions(+), 33 deletions(-) diff --git a/pom.xml b/pom.xml index 8f506fc..a7b4147 100644 --- a/pom.xml +++ b/pom.xml @@ -3,11 +3,10 @@ 4.0.0 pw.yumc Yum - 2.7.8 - Yum + 2.7.9 Minecraft 服务器插件管理系统 - ${project.name} + ${project.artifactId} src/main/resources @@ -43,14 +42,6 @@ - - org.apache.maven.plugins - maven-compiler-plugin - - 1.7 - 1.7 - - @@ -60,8 +51,9 @@ §a补丁包 2.7.9 版本 + §6- §cfix: §7修复仓库数据读取错误的问题; §6- §cfix: §7修复一个tab补全产生的错误; - §6- §btip: §a本插件最后一次更新 2.7.8 版本 + §6- §btip: §a本插件最后一次更新 2.7.8 版本; §6- §afeat: §7线程中断只显示一次调试信息; §6- §afeat: §7更新线程检查 添加调试; §6- §afeat: §7修改显示前缀; @@ -74,7 +66,7 @@ §6- §cfix: §7修复lasterror命令显示问题; §6- §afeat: §7使用SimpleJson解析仓库数据; §6- §afeat: §7使用新的类库处理Tellraw; - §6- §cfix: §7当仓库未找到插件时没有提示的BUG; + §6- §cfix: §7当仓库未找到插件时没有提示的BUG DEV UTF-8 @@ -99,7 +91,7 @@ pw.yumc YumCore jar - 1.5 + 1.6 pw.yumc diff --git a/src/main/java/pw/yumc/Yum/managers/RepositoryManager.java b/src/main/java/pw/yumc/Yum/managers/RepositoryManager.java index 30c3545..a3fd9c8 100644 --- a/src/main/java/pw/yumc/Yum/managers/RepositoryManager.java +++ b/src/main/java/pw/yumc/Yum/managers/RepositoryManager.java @@ -1,6 +1,3 @@ -/** - * - */ package pw.yumc.Yum.managers; import java.util.ArrayList; diff --git a/src/main/java/pw/yumc/Yum/models/PluginInfo.java b/src/main/java/pw/yumc/Yum/models/PluginInfo.java index 481e8c8..4dc0812 100644 --- a/src/main/java/pw/yumc/Yum/models/PluginInfo.java +++ b/src/main/java/pw/yumc/Yum/models/PluginInfo.java @@ -20,7 +20,7 @@ public class PluginInfo implements Serializable { try { NMSVersion = Bukkit.getServer().getClass().getPackage().getName().split("\\.")[3]; } catch (Exception e) { - Log.warning("服务器NMS解析失败: " + Bukkit.getServer().getClass().getPackage().getName()); + Log.w("服务器NMS解析失败: " + Bukkit.getServer().getClass().getPackage().getName()); NMSVersion = "NONMS"; } } @@ -91,7 +91,7 @@ public class PluginInfo implements Serializable { String ver = version; if (ver == null) { if (plugin.tags != null) { - Log.debug("发现存在TAG标签 开始检索: " + NMSVersion); + Log.d("发现存在TAG标签 开始检索: " + NMSVersion); for (TagInfo tagInfo : plugin.tags) { if (tagInfo.tag.equalsIgnoreCase(NMSVersion)) { sender.sendMessage("§6版本: §b从Tag标签中获取 §e" + NMSVersion + " §b的最新版本..."); diff --git a/src/main/java/pw/yumc/Yum/models/RepoCache.java b/src/main/java/pw/yumc/Yum/models/RepoCache.java index d347b51..0d8000e 100644 --- a/src/main/java/pw/yumc/Yum/models/RepoCache.java +++ b/src/main/java/pw/yumc/Yum/models/RepoCache.java @@ -43,17 +43,19 @@ public class RepoCache implements Serializable { } public Repositories getRepo(String repo) { - String json = HttpKit.get(repo); - if (json.isEmpty()) { - Log.console("§c源地址获取数据为空 §b" + repo); + try { + String json = HttpKit.get(repo); + Repositories reposes = new Repositories((JSONObject) JSONValue.parse(json)); + if (reposes.repos.isEmpty()) { + Log.console("§c源地址解析Json为空 §b" + repo); + return null; + } + return reposes; + } catch (Exception e) { + Throwable ex = e.getCause(); + Log.console("§c源地址获取数据为空 §b%s §c异常: %s: %s", repo, ex.getClass().getName(), ex.getLocalizedMessage()); return null; } - Repositories reposes = new Repositories((JSONObject) JSONValue.parse(json)); - if (reposes.repos.isEmpty()) { - Log.console("§c源地址解析Json为空 §b" + repo); - return null; - } - return reposes; } public Map getRepos() { diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index c719a86..02c767a 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -9,31 +9,31 @@ commands: yum: description: MC插件仓库 aliases: [y,apt-get] - usage: §6使用§a/yum help§6查看帮助! + usage: §6使用 §a/yum help §6查看帮助! permission: yum.use permission-message: §c你没有 的权限来执行此命令! net: description: MC插件网络管理 aliases: [n] - usage: §6使用§a/net help§6查看帮助! + usage: §6使用 §a/net help §6查看帮助! permission: net.use permission-message: §c你没有 的权限来执行此命令! file: description: MC文件管理命令 aliases: [f] - usage: §6使用§a/file help§6查看帮助! + usage: §6使用 §a/file help §6查看帮助! permission: file.use permission-message: §c你没有 的权限来执行此命令! security: description: MC安全管理命令 aliases: [s] - usage: §6使用§a/security help§6查看帮助! + usage: §6使用 §a/security help §6查看帮助! permission: security.use permission-message: §c你没有 的权限来执行此命令! monitor: description: MC系统监控命令 aliases: [mi] - usage: §6使用§a/monitor help§6查看帮助! + usage: §6使用 §a/monitor help §6查看帮助! permission: monitor.use permission-message: §c你没有 的权限来执行此命令! permissions: