diff options
author | Eric Stokes <fernferret@gmail.com> | 2012-01-29 10:40:45 -0700 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-01-29 13:07:44 -0500 |
commit | 3a419481ea87eaebc99cb853fca9d128dfb518c9 (patch) | |
tree | e6e80e9ec5f26013319edfc9736d53cbb17492ab /src/main/java | |
parent | f1a35effb05e06c0ae5556f76234a41e3ae3704e (diff) | |
download | craftbukkit-3a419481ea87eaebc99cb853fca9d128dfb518c9.tar craftbukkit-3a419481ea87eaebc99cb853fca9d128dfb518c9.tar.gz craftbukkit-3a419481ea87eaebc99cb853fca9d128dfb518c9.tar.lz craftbukkit-3a419481ea87eaebc99cb853fca9d128dfb518c9.tar.xz craftbukkit-3a419481ea87eaebc99cb853fca9d128dfb518c9.zip |
Added 'generate-structure' setting support and WorldCreator property.
Fixes BUKKIT-655 and BUKKIT-592
Diffstat (limited to 'src/main/java')
-rw-r--r-- | src/main/java/net/minecraft/server/MinecraftServer.java | 3 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftServer.java | 4 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 4 |
3 files changed, 9 insertions, 2 deletions
diff --git a/src/main/java/net/minecraft/server/MinecraftServer.java b/src/main/java/net/minecraft/server/MinecraftServer.java index fc844a3a..5e29a71d 100644 --- a/src/main/java/net/minecraft/server/MinecraftServer.java +++ b/src/main/java/net/minecraft/server/MinecraftServer.java @@ -217,6 +217,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe j = WorldSettings.a(j); log.info("Default game type: " + j); // CraftBukkit start (+ removed worldsettings and servernbtmanager) + boolean generateStructures = this.propertyManager.getBoolean("generate-structures", true); int worldCount = 3; for (int k = 0; k < worldCount; ++k) { @@ -244,7 +245,7 @@ public class MinecraftServer implements Runnable, ICommandListener, IMinecraftSe String name = (dimension == 0) ? s : s + "_" + worldType; ChunkGenerator gen = this.server.getGenerator(name); - WorldSettings settings = new WorldSettings(i, j, true, false, worldtype); + WorldSettings settings = new WorldSettings(i, j, generateStructures, false, worldtype); if (k == 0) { world = new WorldServer(this, new ServerNBTManager(server.getWorldContainer(), s, true), s, dimension, settings, org.bukkit.World.Environment.getEnvironment(dimension), gen); // CraftBukkit diff --git a/src/main/java/org/bukkit/craftbukkit/CraftServer.java b/src/main/java/org/bukkit/craftbukkit/CraftServer.java index a7e98d74..07ab830f 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftServer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftServer.java @@ -521,6 +521,7 @@ public final class CraftServer implements Server { File folder = new File(getWorldContainer(), name); World world = getWorld(name); WorldType type = WorldType.a(creator.type().getName()); + boolean generateStructures = creator.generateStructures(); if (world != null) { return world; @@ -552,7 +553,8 @@ public final class CraftServer implements Server { } } while(used); boolean hardcore = false; - WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), getDefaultGameMode().getValue(), true, hardcore, type), creator.environment(), generator); + + WorldServer internal = new WorldServer(console, new ServerNBTManager(getWorldContainer(), name, true), name, dimension, new WorldSettings(creator.seed(), getDefaultGameMode().getValue(), generateStructures, hardcore, type), creator.environment(), generator); if (!(worlds.containsKey(name.toLowerCase()))) { return null; diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index 969e25e9..5962004b 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -978,4 +978,8 @@ public class CraftWorld implements World { public org.bukkit.WorldType getWorldType() { return org.bukkit.WorldType.getByName(world.getWorldData().getType().name()); } + + public boolean canGenerateStructures() { + return world.getWorldData().o(); + } } |