diff options
Diffstat (limited to 'src')
-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 |