Permalink
Browse files

v1.6.2_4 ライセンスをAL2.0に変更、デフォルト言語を選択できるように

  • Loading branch information...
hide92795
hide92795 committed Oct 12, 2013
1 parent f366cdc commit 5693bf8f9141090f455135fb2ff7ee8679479fee
Binary file not shown.
Binary file not shown.
@@ -5,18 +5,7 @@
public class CoreLib extends JavaPlugin {
private Tool tool;
@Override
public void onEnable() {
tool = new Tool();
}
public static CoreLib getCoreLib() {
return (CoreLib) Bukkit.getServer().getPluginManager().getPlugin("hide92795CoreLib");
}
public Tool getTool() {
return tool;
}
}
@@ -2,6 +2,7 @@
import java.io.File;
import java.io.InputStream;
import org.bukkit.ChatColor;
import org.bukkit.configuration.file.FileConfiguration;
import org.bukkit.plugin.java.JavaPlugin;
@@ -15,22 +16,27 @@ public Localize(JavaPlugin plugin) {
}
public void reload(String lang) throws Exception {
reload(lang, "jp");
}
public void reload(String lang, String default_lang) throws Exception {
configFile = new File(plugin.getDataFolder(), lang + ".yml");
config = LanguageConfiguration.loadConfiguration(configFile);
config.options().copyDefaults(true);
InputStream defConfigStream = plugin.getResource("jp.yml");
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 CoreLib.getCoreLib().getTool().replaceThings(config.getString(path.getName()));
return ChatColor.translateAlternateColorCodes('$', config.getString(path.getName()));
}
}

This file was deleted.

Oops, something went wrong.
@@ -1,5 +1,5 @@
name: hide92795CoreLib
main: hide92795.bukkit.plugin.corelib.CoreLib
version: 1.6.2_2
description: Core Liblary for my plugins.
version: 1.6.2_4
description: Core Library for my plugins.
author: hide92795

0 comments on commit 5693bf8

Please sign in to comment.