mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-23 16:56:31 +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
841a60ca59
commit
dfe46ed976
2 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue