diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-23 10:59:26 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-23 10:59:26 +0000 |
commit | 70c84083c491dc7d84a997a8dbad99ff1c778351 (patch) | |
tree | 6c9729de5e19d1639f2d37efac51231d378f5d7e | |
parent | a7217b5f034ff7ce49ad5bd217a142c2b96c05c0 (diff) | |
download | Essentials-70c84083c491dc7d84a997a8dbad99ff1c778351.tar Essentials-70c84083c491dc7d84a997a8dbad99ff1c778351.tar.gz Essentials-70c84083c491dc7d84a997a8dbad99ff1c778351.tar.lz Essentials-70c84083c491dc7d84a997a8dbad99ff1c778351.tar.xz Essentials-70c84083c491dc7d84a997a8dbad99ff1c778351.zip |
Show file name, if there is an exception in the user upgrade code.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1533 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java | 62 |
1 files changed, 35 insertions, 27 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 60d27d6e6..59432e405 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -137,39 +137,47 @@ public class EssentialsUpgrade continue; } EssentialsConf config = new EssentialsConf(file); - config.load(); - if (config.hasProperty("home") && !config.hasProperty("home.default")) + try { - @SuppressWarnings("unchecked") - List<Object> vals = (List<Object>)config.getProperty("home"); - if (vals == null) { - continue; - } - World world = ess.getServer().getWorlds().get(0); - if (vals.size() > 5) - { - world = ess.getServer().getWorld((String)vals.get(5)); - } - if (world != null) + config.load(); + if (config.hasProperty("home") && !config.hasProperty("home.default")) { - Location loc = new Location( - world, - ((Number)vals.get(0)).doubleValue(), - ((Number)vals.get(1)).doubleValue(), - ((Number)vals.get(2)).doubleValue(), - ((Number)vals.get(3)).floatValue(), - ((Number)vals.get(4)).floatValue()); - - String worldName = world.getName().toLowerCase(); - if (worldName != null && !worldName.isEmpty()) + @SuppressWarnings("unchecked") + List<Object> vals = (List<Object>)config.getProperty("home"); + if (vals == null) { + continue; + } + World world = ess.getServer().getWorlds().get(0); + if (vals.size() > 5) { - config.removeProperty("home"); - config.setProperty("home.default", worldName); - config.setProperty("home.worlds." + worldName, loc); - config.save(); + world = ess.getServer().getWorld((String)vals.get(5)); + } + if (world != null) + { + Location loc = new Location( + world, + ((Number)vals.get(0)).doubleValue(), + ((Number)vals.get(1)).doubleValue(), + ((Number)vals.get(2)).doubleValue(), + ((Number)vals.get(3)).floatValue(), + ((Number)vals.get(4)).floatValue()); + + String worldName = world.getName().toLowerCase(); + if (worldName != null && !worldName.isEmpty()) + { + config.removeProperty("home"); + config.setProperty("home.default", worldName); + config.setProperty("home.worlds." + worldName, loc); + config.save(); + } } } } + catch (RuntimeException ex) + { + logger.log(Level.INFO, "File: "+file.toString()); + throw ex; + } } } |