summaryrefslogtreecommitdiffstats
path: root/Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java
diff options
context:
space:
mode:
Diffstat (limited to 'Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java')
-rw-r--r--Essentials2Compat/src/com/earth2me/essentials/EssentialsUpgrade.java116
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();
}
}