diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-16 21:43:43 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-16 21:43:43 +0000 |
commit | dd1def68670e038c06601aa4815d035a323acd65 (patch) | |
tree | b8325e4da28e4772d8603e907990ac8dc19fa5c6 | |
parent | 4ecce3fb040687555b31f4632cfab259663478da (diff) | |
download | Essentials-dd1def68670e038c06601aa4815d035a323acd65.tar Essentials-dd1def68670e038c06601aa4815d035a323acd65.tar.gz Essentials-dd1def68670e038c06601aa4815d035a323acd65.tar.lz Essentials-dd1def68670e038c06601aa4815d035a323acd65.tar.xz Essentials-dd1def68670e038c06601aa4815d035a323acd65.zip |
Only update config, if there are worth values.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1504 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 31efc87fa..60d27d6e6 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -42,16 +42,21 @@ public class EssentialsUpgrade EssentialsConf conf = new EssentialsConf(configFile); conf.load(); Worth w = new Worth(ess.getDataFolder()); + boolean found = false; for (Material mat : Material.values()) { int id = mat.getId(); double value = conf.getDouble("worth-" + id, Double.NaN); if (!Double.isNaN(value)) { + found = true; w.setPrice(new ItemStack(mat, 1, (short)0, (byte)0), value); } } - removeLinesFromConfig(configFile, "\\s*#?\\s*worth-[0-9]+.*", "# Worth values have been moved to worth.yml"); + if (found) + { + removeLinesFromConfig(configFile, "\\s*#?\\s*worth-[0-9]+.*", "# Worth values have been moved to worth.yml"); + } } catch (Throwable e) { |