mirror of
https://github.com/garbagemule/MobArena.git
synced 2024-11-23 11:06:14 +01:00
Use Reader-based load() method on YamlConfiguration instead of the deprecated InputStream-based method. Fixes #374
This is necessary because the InputStream-based method is removed in 1.12.
This commit is contained in:
parent
1da7b564d1
commit
574a4fdb5f
@ -9,6 +9,7 @@ import org.bukkit.configuration.file.YamlConfiguration;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.InputStreamReader;
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
import java.util.Locale;
|
||||
@ -36,7 +37,7 @@ public class ConfigUtils
|
||||
private static void process(Plugin plugin, String resource, ConfigurationSection section, boolean addOnlyIfEmpty, boolean removeObsolete) {
|
||||
try {
|
||||
YamlConfiguration defaults = new YamlConfiguration();
|
||||
defaults.load(plugin.getResource("res/" + resource));
|
||||
defaults.load(new InputStreamReader(plugin.getResource("res/" + resource)));
|
||||
|
||||
process(defaults, section, addOnlyIfEmpty, removeObsolete);
|
||||
plugin.saveConfig();
|
||||
|
Loading…
Reference in New Issue
Block a user