Permalink
Browse files

v1.6.2_5 デフォルト言語の読み取り方を変更 色変換コードの修正

  • Loading branch information...
hide92795
hide92795 committed Oct 22, 2013
1 parent 5693bf8 commit 280138acb169da8d50cb26be6c1eef7d25131fea
Binary file not shown.
@@ -25,18 +25,25 @@ public void reload(String lang, String default_lang) throws Exception {
config = LanguageConfiguration.loadConfiguration(configFile);
config.options().copyDefaults(true);
InputStream defConfigStream = plugin.getResource(default_lang + ".yml");
if (defConfigStream != null) {
LanguageConfiguration defConfig = LanguageConfiguration.loadConfiguration(defConfigStream);
config.setDefaults(defConfig);
} else {
plugin.getLogger().warning("Can't load Default laungage.");
try (InputStream inJarConfigStream = plugin.getResource(lang + ".yml")) {
if (inJarConfigStream != null) {
LanguageConfiguration inJarConfig = LanguageConfiguration.loadConfiguration(inJarConfigStream);
config.setDefaults(inJarConfig);
} else {
try (InputStream defConfigStream = plugin.getResource(default_lang + ".yml")) {
if (defConfigStream != null) {
LanguageConfiguration defConfig = LanguageConfiguration.loadConfiguration(defConfigStream);
config.setDefaults(defConfig);
} else {
plugin.getLogger().warning("Can't load Default laungage.");
}
}
}
}
config.save(configFile);
}
public String getString(Localizable path) {
return ChatColor.translateAlternateColorCodes('$', config.getString(path.getName()));
return ChatColor.translateAlternateColorCodes('&', config.getString(path.getName()));
}
}
@@ -1,5 +1,5 @@
name: hide92795CoreLib
main: hide92795.bukkit.plugin.corelib.CoreLib
version: 1.6.2_4
version: 1.6.2_5
description: Core Library for my plugins.
author: hide92795

0 comments on commit 280138a

Please sign in to comment.