diff --git a/src/main/java/fr/xephi/authme/process/quit/AsyncronousQuit.java b/src/main/java/fr/xephi/authme/process/quit/AsyncronousQuit.java index 953a3c712..0bd001185 100644 --- a/src/main/java/fr/xephi/authme/process/quit/AsyncronousQuit.java +++ b/src/main/java/fr/xephi/authme/process/quit/AsyncronousQuit.java @@ -10,7 +10,6 @@ import fr.xephi.authme.AuthMe; import fr.xephi.authme.Utils; import fr.xephi.authme.cache.auth.PlayerAuth; import fr.xephi.authme.cache.auth.PlayerCache; -import fr.xephi.authme.cache.backup.FileCache; import fr.xephi.authme.cache.limbo.LimboCache; import fr.xephi.authme.cache.limbo.LimboPlayer; import fr.xephi.authme.datasource.DataSource; @@ -25,7 +24,6 @@ public class AsyncronousQuit { protected Player p; protected Utils utils = Utils.getInstance(); private String name; - private FileCache playerBackup; private ItemStack[] armor = null; private ItemStack[] inv = null; private boolean isOp = false; @@ -39,7 +37,6 @@ public class AsyncronousQuit { this.plugin = plugin; this.database = database; this.name = p.getName().toLowerCase(); - this.playerBackup = new FileCache(plugin); this.isKick = isKick; } diff --git a/src/main/java/fr/xephi/authme/settings/Messages.java b/src/main/java/fr/xephi/authme/settings/Messages.java index b98bd7fc9..b7f73b11c 100644 --- a/src/main/java/fr/xephi/authme/settings/Messages.java +++ b/src/main/java/fr/xephi/authme/settings/Messages.java @@ -1,12 +1,9 @@ package fr.xephi.authme.settings; import java.io.File; -import java.io.InputStream; - import org.bukkit.command.CommandSender; import org.bukkit.configuration.file.YamlConfiguration; -import fr.xephi.authme.AuthMe; import fr.xephi.authme.ConsoleLogger; public class Messages extends CustomConfiguration { @@ -27,13 +24,11 @@ public class Messages extends CustomConfiguration { * @param filename * The filename to open */ - @SuppressWarnings("deprecation") public final void loadDefaults(File file) { - InputStream stream = AuthMe.getInstance().getResource(file.getName()); - if (stream == null) + if (file.exists()) return; - setDefaults(YamlConfiguration.loadConfiguration(stream)); + setDefaults(YamlConfiguration.loadConfiguration(file)); } /** diff --git a/src/main/java/fr/xephi/authme/settings/Settings.java b/src/main/java/fr/xephi/authme/settings/Settings.java index ae53fdace..16bd3330a 100644 --- a/src/main/java/fr/xephi/authme/settings/Settings.java +++ b/src/main/java/fr/xephi/authme/settings/Settings.java @@ -7,7 +7,6 @@ import java.io.FileNotFoundException; import java.io.FileReader; import java.io.FileWriter; import java.io.IOException; -import java.io.InputStream; import java.util.ArrayList; import java.util.Iterator; import java.util.List; @@ -102,7 +101,7 @@ public final class Settings extends YamlConfiguration { if (exists()) { load(); } else { - loadDefaults(file.getName()); + loadDefaults(file); load(); } configFile = (YamlConfiguration) plugin.getConfig(); @@ -672,7 +671,7 @@ public final class Settings extends YamlConfiguration { public final void reload() { load(); - loadDefaults(file.getName()); + loadDefaults(file); } /** @@ -704,13 +703,11 @@ public final class Settings extends YamlConfiguration { * @param filename * The filename to open */ - @SuppressWarnings("deprecation") - public final void loadDefaults(String filename) { - InputStream stream = plugin.getResource(filename); - if (stream == null) + public final void loadDefaults(File file) { + if (file.exists()) return; - setDefaults(YamlConfiguration.loadConfiguration(stream)); + setDefaults(YamlConfiguration.loadConfiguration(file)); } /**