diff options
author | ementalo <ementalodev@gmx.co.uk> | 2012-07-17 12:26:55 +0100 |
---|---|---|
committer | ementalo <ementalodev@gmx.co.uk> | 2012-07-17 14:21:03 +0100 |
commit | a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3 (patch) | |
tree | 2aa10b6300f6c8d3cb2b298c124180fade74857a /Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java | |
parent | 3c385e69271dfe8530fadc3f67e13ee495e4b0e1 (diff) | |
parent | 9f05e43ecf8e6e1a8fcaef757678e762f0d82573 (diff) | |
download | Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.gz Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.lz Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.tar.xz Essentials-a661bce7b3de3f53e2b7b79c1283f0affa6fe9c3.zip |
Merge of server-layer branch
Diffstat (limited to 'Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java')
-rw-r--r-- | Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java | 116 |
1 files changed, 64 insertions, 52 deletions
diff --git a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java index 859c08982..605262151 100644 --- a/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -387,7 +387,6 @@ public class EssentialsUpgrade * ((Number)vals.get(4)).floatValue())); } } } } usersFile.renameTo(new File(usersFile.getAbsolutePath() + ".old")); * } */ - private void convertWarps() { final File warpsFolder = new File(ess.getDataFolder(), "warps"); @@ -462,56 +461,56 @@ public class EssentialsUpgrade } /*final File warpFile = new File(ess.getDataFolder(), "warps.txt"); - if (warpFile.exists()) - { - try - { - final BufferedReader rx = new BufferedReader(new FileReader(warpFile)); - try - { - for (String[] parts = new String[0]; rx.ready(); parts = rx.readLine().split(":")) - { - if (parts.length < 6) - { - continue; - } - final String name = parts[0]; - final double x = Double.parseDouble(parts[1].trim()); - final double y = Double.parseDouble(parts[2].trim()); - final double z = Double.parseDouble(parts[3].trim()); - final float yaw = Float.parseFloat(parts[4].trim()); - final float pitch = Float.parseFloat(parts[5].trim()); - if (name.isEmpty()) - { - continue; - } - World w = null; - for (World world : ess.getServer().getWorlds()) - { - if (world.getEnvironment() != World.Environment.NETHER) - { - w = world; - break; - } - } - final Location loc = new Location(name, x, y, z, yaw, pitch); - ess.getWarps().setWarp(name, loc); - if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old"))) - { - throw new Exception(_("fileRenameError", "warps.txt")); - } - } - } - finally - { - rx.close(); - } - } - catch (Exception ex) - { - LOGGER.log(Level.SEVERE, null, ex); - } - }*/ + if (warpFile.exists()) + { + try + { + final BufferedReader rx = new BufferedReader(new FileReader(warpFile)); + try + { + for (String[] parts = new String[0]; rx.ready(); parts = rx.readLine().split(":")) + { + if (parts.length < 6) + { + continue; + } + final String name = parts[0]; + final double x = Double.parseDouble(parts[1].trim()); + final double y = Double.parseDouble(parts[2].trim()); + final double z = Double.parseDouble(parts[3].trim()); + final float yaw = Float.parseFloat(parts[4].trim()); + final float pitch = Float.parseFloat(parts[5].trim()); + if (name.isEmpty()) + { + continue; + } + World w = null; + for (World world : ess.getServer().getWorlds()) + { + if (world.getEnvironment() != World.Environment.NETHER) + { + w = world; + break; + } + } + final Location loc = new Location(name, x, y, z, yaw, pitch); + ess.getWarps().setWarp(name, loc); + if (!warpFile.renameTo(new File(ess.getDataFolder(), "warps.txt.old"))) + { + throw new Exception(_("fileRenameError", "warps.txt")); + } + } + } + finally + { + rx.close(); + } + } + catch (Exception ex) + { + LOGGER.log(Level.SEVERE, null, ex); + } + }*/ } /* @@ -533,7 +532,7 @@ public class EssentialsUpgrade * ess.getDataFolder().getParentFile().getParentFile(); final File worldDirectory = new File(bukkitDirectory, name); * if (worldDirectory.exists() && worldDirectory.isDirectory()) { return new FakeWorld(worldDirectory.getName(), * World.Environment.NORMAL); } return null; - } + } */ public StoredLocation getFakeLocation(EssentialsConf config, String path) { @@ -691,6 +690,18 @@ public class EssentialsUpgrade doneFile.save(); } + private void warnMetrics() + { + if (doneFile.getBoolean("warnMetrics", false)) + { + return; + } + //todo - metrics + // ess.getSettings().setMetricsEnabled(false); + doneFile.setProperty("warnMetrics", true); + doneFile.save(); + } + public void beforeSettings() { if (!ess.getDataFolder().exists()) @@ -714,5 +725,6 @@ public class EssentialsUpgrade deleteOldItemsCsv(); updateSpawnsToNewSpawnsConfig(); updateJailsToNewJailsConfig(); + warnMetrics(); } } |