Use InputStreamReader when reading the default en.yml from the plugin.

This commit is contained in:
graywolf336 2014-05-30 14:03:20 -05:00
parent af1fa37470
commit 74e62be46c

View File

@ -2,6 +2,7 @@ package com.graywolf336.jail;
import java.io.File; import java.io.File;
import java.io.IOException; import java.io.IOException;
import java.io.InputStreamReader;
import java.sql.Blob; import java.sql.Blob;
import java.sql.Connection; import java.sql.Connection;
import java.sql.DriverManager; import java.sql.DriverManager;
@ -72,13 +73,13 @@ public class JailIO {
}else { }else {
pl.getLogger().severe("The language file can not be a folder."); pl.getLogger().severe("The language file can not be a folder.");
pl.getLogger().severe("As a result, we are reverting back to English as the language."); pl.getLogger().severe("As a result, we are reverting back to English as the language.");
lang = YamlConfiguration.loadConfiguration(pl.getResource("en.yml")); lang = YamlConfiguration.loadConfiguration(new InputStreamReader(pl.getResource("en.yml")));
save = true; save = true;
} }
}else { }else {
pl.getLogger().warning("Loading the default language of: en"); pl.getLogger().warning("Loading the default language of: en");
pl.getLogger().warning("If you wish to change this, please rename 'en.yml' to whatever you wish and set the config value to the name of the file."); pl.getLogger().warning("If you wish to change this, please rename 'en.yml' to whatever you wish and set the config value to the name of the file.");
lang = YamlConfiguration.loadConfiguration(pl.getResource("en.yml")); lang = YamlConfiguration.loadConfiguration(new InputStreamReader(pl.getResource("en.yml")));
save = true; save = true;
} }