Skip to content

Commit

Permalink
Merge pull request #68 from BentoBoxWorld/fewer_worlds
Browse files Browse the repository at this point in the history
Make just one seed world. Implement vanilla biomes.
  • Loading branch information
tastybento authored Mar 29, 2024
2 parents d78e412 + 8daafc0 commit 3c74d3e
Show file tree
Hide file tree
Showing 7 changed files with 1,067 additions and 105 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
<!-- Do not change unless you want different name for local builds. -->
<build.number>-LOCAL</build.number>
<!-- This allows to change between versions. -->
<build.version>2.4.0</build.version>
<build.version>2.5.0</build.version>

<sonar.projectKey>BentoBoxWorld_Boxed</sonar.projectKey>
<sonar.organization>bentobox-world</sonar.organization>
Expand Down
43 changes: 2 additions & 41 deletions src/main/java/world/bentobox/boxed/Boxed.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,15 +58,12 @@ public class Boxed extends GameModeAddon {
private static final String SEED = "seed";
private static final String NETHER = "_nether";
private static final String THE_END = "_the_end";
private static final String BASE = "_base";

// Settings
private Settings settings;
private AbstractBoxedChunkGenerator worldGen;
private AbstractBoxedChunkGenerator seedBaseGen;
private BoxedSeedChunkGenerator seedGen;
private AbstractBoxedChunkGenerator netherGen;
private AbstractBoxedChunkGenerator netherSeedBaseGen;
private BoxedSeedChunkGenerator netherSeedGen;


Expand All @@ -75,7 +72,6 @@ public class Boxed extends GameModeAddon {
private World seedWorld;
private final Map<World, ChunkGenerator> generatorMap = new HashMap<>();
private final Map<String, ChunkGenerator> generatorMaps = new HashMap<>();
//private World seedWorldEnd;
private BiomeProvider boxedBiomeProvider;

@Override
Expand Down Expand Up @@ -111,22 +107,16 @@ private boolean loadSettings() {
this.worldGen = new BoxedChunkGenerator(this);
generatorMaps.put(settings.getWorldName(), worldGen);

seedBaseGen = new BoxedSeedChunkGenerator(this, Environment.NORMAL);
generatorMaps.put(settings.getWorldName() + "/" + SEED + BASE, seedBaseGen);

seedGen = new BoxedSeedChunkGenerator(this, Environment.NORMAL,
new SeedBiomeGenerator(this, seedBaseGen));
new SeedBiomeGenerator(this));
generatorMaps.put(settings.getWorldName() + "/" + SEED, seedGen);

// Nether generators
this.netherGen = new BoxedChunkGenerator(this);
generatorMaps.put(settings.getWorldName() + NETHER, netherGen);

netherSeedBaseGen = new BoxedSeedChunkGenerator(this, Environment.NETHER);
generatorMaps.put(settings.getWorldName() + "/" + SEED + NETHER + BASE, netherSeedBaseGen); // + SEED + NETHER + BASE)

netherSeedGen = new BoxedSeedChunkGenerator(this, Environment.NETHER,
new NetherSeedBiomeGenerator(this, seedBaseGen));
new NetherSeedBiomeGenerator(this));
generatorMaps.put(settings.getWorldName() + "/" + SEED + NETHER, netherSeedGen);

return true;
Expand Down Expand Up @@ -206,20 +196,6 @@ public void createWorlds() {
private void createNether(String worldName) {
// Create vanilla seed nether world
log("Creating Boxed Seed Nether world ...");
World baseWorldNether = WorldCreator
.name(worldName + "/" + SEED + NETHER + BASE)
.generator(netherSeedBaseGen)
.environment(Environment.NETHER)
.seed(getSettings().getSeed())
.createWorld();
baseWorldNether.setDifficulty(Difficulty.PEACEFUL);
baseWorldNether.setSpawnLocation(settings.getSeedX(), 64, settings.getSeedZ());
generatorMap.put(baseWorldNether, netherSeedBaseGen);
getPlugin().getIWM().addWorld(baseWorldNether, this);
copyChunks(baseWorldNether, netherSeedBaseGen);
// Create seed world
// This copies a base world with custom biomes
log("Creating Boxed Biomed Nether world ...");
World seedWorldNether = WorldCreator
.name(worldName + "/" + SEED + NETHER)
.generator(netherSeedGen)
Expand All @@ -242,21 +218,6 @@ private void createNether(String worldName) {
private void createOverWorld(String worldName) {
// Create vanilla seed world
log("Creating Boxed Seed world ...");
// This creates a vanilla base world with biomes
World baseWorld = WorldCreator
.name(worldName + "/" + SEED + BASE)
.generator(seedBaseGen)
.environment(Environment.NORMAL)
.seed(getSettings().getSeed())
.createWorld();
baseWorld.setDifficulty(Difficulty.PEACEFUL);
baseWorld.setSpawnLocation(settings.getSeedX(), 64, settings.getSeedZ());
generatorMap.put(baseWorld, seedBaseGen);
getPlugin().getIWM().addWorld(baseWorld, this);
copyChunks(baseWorld, seedBaseGen);
// Create seed world
// This copies a base world with custom biomes
log("Creating Boxed Biomed world ...");
seedWorld = WorldCreator
.name(worldName + "/" + SEED)
.generator(seedGen)
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/world/bentobox/boxed/Settings.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public class Settings implements WorldSettings {
@ConfigEntry(path = "world.max-areas")
private int maxIslands = -1;

@ConfigComment("Area height - Lowest is 5.")
@ConfigComment("Area height")
@ConfigComment("It is the y coordinate of the bedrock block in the blueprint.")
@ConfigEntry(path = "world.area-height")
private int islandHeight = 8;
Expand Down
Loading

0 comments on commit 3c74d3e

Please sign in to comment.