Added 'generate-structure' setting support and WorldCreator property.

Fixes BUKKIT-655 and BUKKIT-592

By: Eric Stokes <fernferret@gmail.com>
This commit is contained in:
Bukkit/Spigot 2012-01-29 10:22:45 -07:00
parent 378815c162
commit b4c3ba3d33
2 changed files with 28 additions and 0 deletions

View File

@ -761,6 +761,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
*/

View File

@ -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
@ -201,6 +202,26 @@ public class WorldCreator {
return this;
}
/**
* 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>