From 75d9b04deb799589784c79d6fe3e690121b79473 Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Wed, 12 Oct 2011 04:24:41 +0100 Subject: [PATCH] Added new bukkit.yml entry (settings -> world-container) to control the directory worlds are stored in --- src/main/java/net/minecraft/server/MinecraftServer.java | 4 ++-- src/main/java/org/bukkit/craftbukkit/CraftServer.java | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index 58e03167fb..347262e874 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -188,7 +188,7 @@ public class MinecraftServer implements Runnable, ICommandListener { WorldSettings settings = new WorldSettings(i, j, true); if (k == 0) { - world = new WorldServer(this, new ServerNBTManager(new File("."), s, true), s, dimension, settings, org.bukkit.World.Environment.getEnvironment(dimension), gen); // CraftBukkit + world = new WorldServer(this, new ServerNBTManager(server.getWorldContainer(), s, true), s, dimension, settings, org.bukkit.World.Environment.getEnvironment(dimension), gen); // CraftBukkit } else { String dim = "DIM-1"; @@ -218,7 +218,7 @@ public class MinecraftServer implements Runnable, ICommandListener { } } - world = new SecondaryWorldServer(this, new ServerNBTManager(new File("."), name, true), name, dimension, settings, this.worlds.get(0), org.bukkit.World.Environment.getEnvironment(dimension), gen); // CraftBukkit + world = new SecondaryWorldServer(this, new ServerNBTManager(server.getWorldContainer(), name, true), name, dimension, settings, this.worlds.get(0), org.bukkit.World.Environment.getEnvironment(dimension), gen); // CraftBukkit } if (gen != null) { diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index 37c8d96909..1fcc2aed3c 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -509,7 +509,7 @@ public final class CraftServer implements Server { } int dimension = 10 + console.worlds.size(); - WorldServer internal = new WorldServer(console, new ServerNBTManager(new File("."), name, true), name, dimension, new WorldSettings(creator.seed(), getDefaultGameMode().getValue(), true), creator.environment(), generator); + WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), getDefaultGameMode().getValue(), true), creator.environment(), generator); if (!(worlds.containsKey(name.toLowerCase()))) { return null; @@ -898,4 +898,8 @@ public final class CraftServer implements Server { } } } + + public File getWorldContainer() { + return new File(configuration.getString("settings.world-container", ".")); + } }