From 3e22a6f6be38988f7a70b9a642cd9273f0d7309f Mon Sep 17 00:00:00 2001 From: 502647092 Date: Mon, 26 Oct 2015 17:18:37 +0800 Subject: [PATCH] fix somebug and remove supput 1.7.10 spigot unless you package up Gson.. Signed-off-by: 502647092 --- pom.xml | 4 ++-- .../citycraft/Yum/manager/RepositoryManager.java | 14 ++++++++------ 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/pom.xml b/pom.xml index 77c6b54..f370b0a 100644 --- a/pom.xml +++ b/pom.xml @@ -3,7 +3,7 @@ 4.0.0 cn.citycraft Yum - 1.7.2 + 1.7.3 Yum Minecraft 服务器插件管理系统 @@ -60,7 +60,7 @@ http://ci.citycraft.cn:8080 - 更新7老板底层Gson库 移除Plugin Metrics... + \u00A7a移除对纯净1.7.10的支持\u00A7c(去怪7老板= =) \u00A73修复一个迭代错误... UTF-8 diff --git a/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java b/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java index ba7e853..f19e17b 100644 --- a/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java +++ b/src/main/java/cn/citycraft/Yum/manager/RepositoryManager.java @@ -9,6 +9,7 @@ import java.io.InputStreamReader; import java.net.URL; import java.util.ArrayList; import java.util.HashMap; +import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Map.Entry; @@ -18,14 +19,13 @@ import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.FileConfiguration; import com.google.common.base.Charsets; +import com.google.gson.Gson; +import com.google.gson.JsonSyntaxException; +import com.google.gson.reflect.TypeToken; import cn.citycraft.Yum.manager.Repositories.PackageInfo; import cn.citycraft.Yum.manager.Repositories.Plugin; import cn.citycraft.Yum.manager.Repositories.Repository; -import cn.mcraft.gson.GsonLib; -import cn.mcraft.gson.api.Gson; -import cn.mcraft.gson.api.exception.JsonSyntaxException; -import cn.mcraft.gson.api.reflect.TypeToken;; /** * 仓库管理类 @@ -41,7 +41,7 @@ public class RepositoryManager { public RepositoryManager(final org.bukkit.plugin.Plugin plugin) { this.main = plugin; - gson = GsonLib.newGson(); + gson = new Gson(); plugins = new HashMap(); repos = new ArrayList(); } @@ -214,7 +214,9 @@ public class RepositoryManager { if (repos.isEmpty()) { repos.add("http://citycraft.cn/repo/repo.info"); } - for (final String string : repos) { + final Iterator keys = repos.iterator(); + while (keys.hasNext()) { + final String string = keys.next(); if (updateRepositories(sender, string)) { sender.sendMessage("§6源: §e" + string + " §a更新成功!"); } else {