Search in sources :

Example 1 with InputStreamReader

use of org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader in project EliteMobs by MagmaGuy.

the class CustomConfigLoader method reloadCustomConfig.

public void reloadCustomConfig(String configName) {
    if (customConfigFile == null) {
        customConfigFile = new File(plugin.getDataFolder(), configName);
    }
    customConfig = YamlConfiguration.loadConfiguration(customConfigFile);
    // Look for defaults in the jar
    Reader defConfigStream = null;
    try {
        defConfigStream = new InputStreamReader(plugin.getResource(configName), "UTF8");
    } catch (UnsupportedEncodingException e) {
        e.printStackTrace();
    }
    if (defConfigStream != null) {
        YamlConfiguration defConfig = YamlConfiguration.loadConfiguration(customConfigFile);
        customConfig.setDefaults(defConfig);
    }
}
Also used : InputStreamReader(org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader) InputStreamReader(org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader) Reader(java.io.Reader) UnsupportedEncodingException(java.io.UnsupportedEncodingException) YamlConfiguration(org.bukkit.configuration.file.YamlConfiguration) File(java.io.File)

Aggregations

File (java.io.File)1 Reader (java.io.Reader)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 YamlConfiguration (org.bukkit.configuration.file.YamlConfiguration)1 InputStreamReader (org.bukkit.craftbukkit.libs.jline.internal.InputStreamReader)1