diff options
author | Eric Stokes <fernferret@gmail.com> | 2012-01-29 10:22:45 -0700 |
---|---|---|
committer | EvilSeph <evilseph@gmail.com> | 2012-01-29 13:06:23 -0500 |
commit | 67301a1d293b6673b0bd034f9054af6410cfc6cd (patch) | |
tree | 38bff296169b9aa948af2c79a2103de957e19308 /src/main/java/org | |
parent | b4713855e208e20f1ea2eebaaa1d14b7b06cc77b (diff) | |
download | bukkit-67301a1d293b6673b0bd034f9054af6410cfc6cd.tar bukkit-67301a1d293b6673b0bd034f9054af6410cfc6cd.tar.gz bukkit-67301a1d293b6673b0bd034f9054af6410cfc6cd.tar.lz bukkit-67301a1d293b6673b0bd034f9054af6410cfc6cd.tar.xz bukkit-67301a1d293b6673b0bd034f9054af6410cfc6cd.zip |
Added 'generate-structure' setting support and WorldCreator property.
Fixes BUKKIT-655 and BUKKIT-592
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/bukkit/World.java | 7 | ||||
-rw-r--r-- | src/main/java/org/bukkit/WorldCreator.java | 21 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/World.java b/src/main/java/org/bukkit/World.java index 55d5b288..368a5e4f 100644 --- a/src/main/java/org/bukkit/World.java +++ b/src/main/java/org/bukkit/World.java @@ -762,6 +762,13 @@ public interface World extends PluginMessageRecipient { public WorldType getWorldType(); /** + * Gets whether or not structures are being generated. + * + * @return True if structures are being generated. + */ + public boolean canGenerateStructures(); + + /** * Represents various map environment types that a world may be */ public enum Environment { diff --git a/src/main/java/org/bukkit/WorldCreator.java b/src/main/java/org/bukkit/WorldCreator.java index 17f30356..b48c1ad5 100644 --- a/src/main/java/org/bukkit/WorldCreator.java +++ b/src/main/java/org/bukkit/WorldCreator.java @@ -14,6 +14,7 @@ public class WorldCreator { private World.Environment environment = World.Environment.NORMAL; private ChunkGenerator generator = null; private WorldType type = WorldType.NORMAL; + private boolean generateStructures = true; /** * Creates an empty WorldCreationOptions for the given world name @@ -202,6 +203,26 @@ public class WorldCreator { } /** + * Sets whether or not worlds created or loaded with this creator will have structures. + * + * @return This object, for chaining + */ + public WorldCreator generateStructures(boolean generate) { + this.generateStructures = generate; + + return this; + } + + /** + * Gets whether or not structures will be generated in the world. + * + * @return True if structures will be generated + */ + public boolean generateStructures() { + return generateStructures; + } + + /** * Creates a world with the specified options. * <p> * If the world already exists, it will be loaded from disk and some options |