From acd2da49f87122dab8728777978046e85d501a35 Mon Sep 17 00:00:00 2001 From: Andrew Date: Wed, 6 Nov 2013 06:05:10 +1300 Subject: [PATCH] Fixed comments never being visible --- src/me/libraryaddict/disguise/LibsDisguises.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/me/libraryaddict/disguise/LibsDisguises.java b/src/me/libraryaddict/disguise/LibsDisguises.java index b1573b1d..5e191c77 100644 --- a/src/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/me/libraryaddict/disguise/LibsDisguises.java @@ -65,20 +65,24 @@ public class LibsDisguises extends JavaPlugin { } saveDefaultConfig(); FileConfiguration config = YamlConfiguration.loadConfiguration(new File(getDataFolder(), "config.yml")); + boolean modified = false; try { for (String option : YamlConfiguration .loadConfiguration(this.getClassLoader().getResource("config.yml").openStream()).getKeys(false)) { if (!config.contains(option)) { config.set(option, getConfig().get(option)); + modified = true; } } } catch (IOException e) { e.printStackTrace(); } - try { - config.save(new File(getDataFolder(), "config.yml")); - } catch (IOException e) { - e.printStackTrace(); + if (modified) { + try { + config.save(new File(getDataFolder(), "config.yml")); + } catch (IOException e) { + e.printStackTrace(); + } } PacketsManager.init(this); DisguiseAPI.setSoundsEnabled(getConfig().getBoolean("DisguiseSounds"));