summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-02-24 12:07:33 +0000
committerDinnerbone <dinnerbone@dinnerbone.com>2011-02-24 12:07:33 +0000
commit51be9e77c6853231d10965d1aa56bf54ca3c189a (patch)
tree9190fb157be91637de66834d14833ba01c6d2677 /src/main
parent5d3b8de87adee1fe42fce58fac0fc9213066865b (diff)
downloadcraftbukkit-51be9e77c6853231d10965d1aa56bf54ca3c189a.tar
craftbukkit-51be9e77c6853231d10965d1aa56bf54ca3c189a.tar.gz
craftbukkit-51be9e77c6853231d10965d1aa56bf54ca3c189a.tar.lz
craftbukkit-51be9e77c6853231d10965d1aa56bf54ca3c189a.tar.xz
craftbukkit-51be9e77c6853231d10965d1aa56bf54ca3c189a.zip
Attempt to convert multiworld worlds... world.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/bukkit/craftbukkit/CraftServer.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
index 9547ae01..28264257 100644
--- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java
+++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java
@@ -10,11 +10,14 @@ import java.util.Map;
import java.util.logging.Level;
import java.util.logging.Logger;
import net.minecraft.server.ChunkCoordinates;
+import net.minecraft.server.ConvertProgressUpdater;
+import net.minecraft.server.Convertable;
import net.minecraft.server.EntityPlayer;
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.PropertyManager;
import net.minecraft.server.ServerConfigurationManager;
import net.minecraft.server.ServerNBTManager;
+import net.minecraft.server.WorldLoaderServer;
import net.minecraft.server.WorldManager;
import net.minecraft.server.WorldServer;
import org.bukkit.*;
@@ -212,6 +215,12 @@ public final class CraftServer implements Server {
throw new IllegalArgumentException("File exists with the name '" + name + "' and isn't a folder");
}
+ Convertable converter = new WorldLoaderServer(folder);
+ if (converter.a(name)) {
+ getLogger().info("Converting world '" + name + "'");
+ converter.a(name, new ConvertProgressUpdater(console));
+ }
+
WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, environment == World.Environment.NETHER ? -1 : 0);
internal.a(new WorldManager(console, internal));