mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-08 09:17:36 +01:00
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:
parent
378815c162
commit
b4c3ba3d33
@ -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
|
||||
*/
|
||||
|
@ -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>
|
||||
|
Loading…
Reference in New Issue
Block a user