mirror of
https://e.coding.net/circlecloud/Yum.git
synced 2024-11-22 06:18:46 +00:00
fix: 修复仓库数据读取错误的问题
Signed-off-by: 502647092 <admin@yumc.pw>
This commit is contained in:
parent
0a0e94a7fe
commit
3c270657f8
20
pom.xml
20
pom.xml
@ -3,11 +3,10 @@
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>Yum</artifactId>
|
||||
<version>2.7.8</version>
|
||||
<name>Yum</name>
|
||||
<version>2.7.9</version>
|
||||
<description>Minecraft 服务器插件管理系统</description>
|
||||
<build>
|
||||
<finalName>${project.name}</finalName>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<resources>
|
||||
<resource>
|
||||
<directory>src/main/resources</directory>
|
||||
@ -43,14 +42,6 @@
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<configuration>
|
||||
<source>1.7</source>
|
||||
<target>1.7</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
<ciManagement>
|
||||
@ -60,8 +51,9 @@
|
||||
<properties>
|
||||
<update.description>§a补丁包 2.7.9 版本</update.description>
|
||||
<update.changes>
|
||||
§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
|
||||
</update.changes>
|
||||
<env.GIT_COMMIT>DEV</env.GIT_COMMIT>
|
||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||
@ -99,7 +91,7 @@
|
||||
<groupId>pw.yumc</groupId>
|
||||
<artifactId>YumCore</artifactId>
|
||||
<type>jar</type>
|
||||
<version>1.5</version>
|
||||
<version>1.6</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>pw.yumc</groupId>
|
||||
|
@ -1,6 +1,3 @@
|
||||
/**
|
||||
*
|
||||
*/
|
||||
package pw.yumc.Yum.managers;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
@ -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的最新版本...");
|
||||
|
@ -43,17 +43,19 @@ public class RepoCache implements Serializable {
|
||||
}
|
||||
|
||||
public Repositories getRepo(String repo) {
|
||||
try {
|
||||
String json = HttpKit.get(repo);
|
||||
if (json.isEmpty()) {
|
||||
Log.console("§c源地址获取数据为空 §b" + repo);
|
||||
return null;
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
public Map<String, Repositories> getRepos() {
|
||||
|
Loading…
Reference in New Issue
Block a user