Added settings for structures and stronghold generation.

This commit is contained in:
tastybento 2021-03-03 20:46:22 -08:00
parent e9ae0d7a98
commit 816e1e86be
2 changed files with 46 additions and 4 deletions

View File

@ -39,7 +39,7 @@ public class Boxed extends GameModeAddon {
.type(Type.PROTECTION)
.defaultRank(RanksManager.OWNER_RANK)
.build();
private static final String NETHER = "_nether";
private static final String THE_END = "_the_end";
@ -65,8 +65,12 @@ public class Boxed extends GameModeAddon {
.createCustomGenerator(wordRef, generator -> {
// Set the noise generator
generator.setBaseNoiseGenerator(new BasicWorldGenerator(this, wordRef, getSettings().getSeed()));
//generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.SURFACE_STRUCTURES);
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.STRONGHOLDS);
if (getSettings().isAllowStructures()) {
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.SURFACE_STRUCTURES);
}
if (getSettings().isAllowStrongholds()) {
generator.getWorldDecorator().withoutDefaultDecorations(DecorationType.STRONGHOLDS);
}
generator.setBiomeGenerator(new BoxedBiomeGenerator(this));
});
// Register commands
@ -110,7 +114,7 @@ public class Boxed extends GameModeAddon {
MOVE_BOX.setGameModes(Collections.singleton(this));
// Register protection flag with BentoBox
getPlugin().getFlagsManager().registerFlag(this, MOVE_BOX);
}
@Override

View File

@ -73,6 +73,16 @@ public class Settings implements WorldSettings {
@ConfigComment("Other plugins may override this setting")
@ConfigEntry(path = "world.difficulty")
private Difficulty difficulty = Difficulty.NORMAL;
@ConfigComment("Allow surface structures - villages, shipwrecks, broken portals, etc.")
@ConfigComment("These will be randomly placed, so may not be available for every player.")
@ConfigEntry(path = "world.allow-structures", needsRestart = true)
private boolean allowStructures = true;
@ConfigComment("Allow strongholds.")
@ConfigComment("These will be randomly placed, so may not be available for every player.")
@ConfigEntry(path = "world.allow-strongholds", experimental = true, needsRestart = true)
private boolean allowStrongholds = false;
@ConfigComment("Spawn limits. These override the limits set in bukkit.yml")
@ConfigComment("If set to a negative number, the server defaults will be used")
@ -1628,4 +1638,32 @@ public class Settings implements WorldSettings {
// Do not check for blocks when looking for a new island spot
return false;
}
/**
* @return the allowStructures
*/
protected boolean isAllowStructures() {
return allowStructures;
}
/**
* @param allowStructures the allowStructures to set
*/
protected void setAllowStructures(boolean allowStructures) {
this.allowStructures = allowStructures;
}
/**
* @return the allowStrongholds
*/
protected boolean isAllowStrongholds() {
return allowStrongholds;
}
/**
* @param allowStrongholds the allowStrongholds to set
*/
protected void setAllowStrongholds(boolean allowStrongholds) {
this.allowStrongholds = allowStrongholds;
}
}