diff --git a/pom.xml b/pom.xml index b9f29b9..13e9063 100644 --- a/pom.xml +++ b/pom.xml @@ -4,7 +4,7 @@ 4.0.0 pw.yumc YumCore - 1.8.1 + 1.8.2 ${project.artifactId} diff --git a/src/main/java/pw/yumc/YumCore/config/ext/RemoteConfig.java b/src/main/java/pw/yumc/YumCore/config/ext/RemoteConfig.java deleted file mode 100644 index 75a834d..0000000 --- a/src/main/java/pw/yumc/YumCore/config/ext/RemoteConfig.java +++ /dev/null @@ -1,60 +0,0 @@ -package pw.yumc.YumCore.config.ext; - -import pw.yumc.YumCore.bukkit.Log; -import pw.yumc.YumCore.config.FileConfig; - -import java.io.IOException; -import java.net.URL; - -/** - * 远程配置文件类 - * - * @since 2016年2月22日 上午8:33:51 - * @author 喵♂呜 - */ -public class RemoteConfig extends FileConfig { - public RemoteConfig(String url) throws IOException { - this(new URL(url)); - } - - public RemoteConfig(URL url) throws IOException { - super(url.openStream()); - } - - /** - * 获得配置文件(错误返回null) - * - * @param url - * 配置文件地址 - * @return {@link FileConfig} - */ - public static FileConfig getConfig(String url) { - try { - return new RemoteConfig(url); - } catch (IOException e) { - Log.d("获取远程配置文件失败!", e); - return null; - } - } - - /** - * 获得Yaml文件标签信息 - * - * @param url - * XML文件地址 - * @param tag - * 信息标签 - * @param def - * 默认值 - * @return 插件信息 - */ - public static String getYamlTag(String url, String tag, String def) { - String result = def; - FileConfig config = getConfig(url); - if (config != null) { - result = config.getString(tag); - } - return result; - } - -} diff --git a/src/main/java/pw/yumc/YumCore/config/ext/YumConfig.java b/src/main/java/pw/yumc/YumCore/config/ext/YumConfig.java index 492da22..999323e 100644 --- a/src/main/java/pw/yumc/YumCore/config/ext/YumConfig.java +++ b/src/main/java/pw/yumc/YumCore/config/ext/YumConfig.java @@ -2,6 +2,7 @@ package pw.yumc.YumCore.config.ext; import java.io.File; import java.io.IOException; +import java.net.URL; import pw.yumc.YumCore.bukkit.Log; import pw.yumc.YumCore.config.FileConfig; @@ -39,7 +40,7 @@ public class YumConfig { public static FileConfig getRemote(String configname) { FileConfig config; try { - config = new RemoteConfig(REMOTEFILECENTER + configname); + config = new FileConfig(new URL(REMOTEFILECENTER + configname).openStream()); config.save(new File(CacheFolder, configname)); Log.i(fromYumc, configname); } catch (IOException e) {