diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 02:02:15 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-14 02:02:15 +0000 |
commit | 4bd6bdcc3978087d5e1ba33fc7c2f91a0b45952c (patch) | |
tree | 8b963da6d30dc92e930b0e890ec5a77e945d9d64 | |
parent | ea52e817b56c3b0df0d87007b278b60298cf6fbb (diff) | |
download | Essentials-4bd6bdcc3978087d5e1ba33fc7c2f91a0b45952c.tar Essentials-4bd6bdcc3978087d5e1ba33fc7c2f91a0b45952c.tar.gz Essentials-4bd6bdcc3978087d5e1ba33fc7c2f91a0b45952c.tar.lz Essentials-4bd6bdcc3978087d5e1ba33fc7c2f91a0b45952c.tar.xz Essentials-4bd6bdcc3978087d5e1ba33fc7c2f91a0b45952c.zip |
Don't load worlds on startup for Upgrade process, use FakeWorld instead.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1455 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r-- | Essentials/src/com/earth2me/essentials/Essentials.java | 23 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java | 16 | ||||
-rw-r--r-- | Essentials/src/com/earth2me/essentials/FakeWorld.java (renamed from Essentials/test/com/earth2me/essentials/FakeWorld.java) | 0 |
3 files changed, 13 insertions, 26 deletions
diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 053b1ab41..9895be834 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -98,18 +98,6 @@ public class Essentials extends JavaPlugin { setStatic(); EssentialsUpgrade upgrade = new EssentialsUpgrade(this.getDescription().getVersion(), this); - if (newWorldsLoaded) - { - logger.log(Level.SEVERE, Util.i18n("worldsLoadedRestartServer")); - try - { - getServer().dispatchCommand(Console.getCommandSender(getServer()), "stop"); - } - catch (Exception ex) - { - logger.log(Level.SEVERE, Util.i18n("failedStopServer"), ex); - } - } confList = new ArrayList<IConf>(); settings = new Settings(this.getDataFolder()); confList.add(settings); @@ -655,17 +643,6 @@ public class Essentials extends JavaPlugin { return w; } - File bukkitDirectory = getStatic().getDataFolder().getParentFile().getParentFile(); - File worldDirectory = new File(bukkitDirectory, name); - if (worldDirectory.exists() && worldDirectory.isDirectory()) - { - w = getServer().createWorld(name, World.Environment.NORMAL); - if (w != null) - { - newWorldsLoaded = true; - } - return w; - } return null; } diff --git a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java index 708cd1f1e..f941ba0e3 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsUpgrade.java @@ -207,7 +207,7 @@ public class EssentialsUpgrade World world = ess.getServer().getWorlds().get(0); if (vals.size() > 5) { - world = ess.getWorld((String)vals.get(5)); + world = getFakeWorld((String)vals.get(5)); } if (world != null) { @@ -258,12 +258,11 @@ public class EssentialsUpgrade break; } } - boolean forceWorldName = false; if (worldName != null) { worldName.trim(); World w1 = null; - w1 = ess.getWorld(worldName); + w1 = getFakeWorld(worldName); if (w1 != null) { w = w1; @@ -366,4 +365,15 @@ public class EssentialsUpgrade } } } + + private World getFakeWorld(String name) + { + File bukkitDirectory = ess.getDataFolder().getParentFile().getParentFile(); + File worldDirectory = new File(bukkitDirectory, name); + if (worldDirectory.exists() && worldDirectory.isDirectory()) + { + return new FakeWorld(worldDirectory.getName(), World.Environment.NORMAL); + } + return null; + } } diff --git a/Essentials/test/com/earth2me/essentials/FakeWorld.java b/Essentials/src/com/earth2me/essentials/FakeWorld.java index 16472c56c..16472c56c 100644 --- a/Essentials/test/com/earth2me/essentials/FakeWorld.java +++ b/Essentials/src/com/earth2me/essentials/FakeWorld.java |