Skip to content

Commit

Permalink
Separated swamps for both biome regions
Browse files Browse the repository at this point in the history
  • Loading branch information
Forstride committed Nov 27, 2023
1 parent 886eb3a commit 3554804
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public class BOPOverworldBiomeBuilder
};

private final ResourceKey<Biome>[][] RIVER_BIOMES_BOP = new ResourceKey[][]{
{null, null, null, null, null},
{Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN},
Expand Down Expand Up @@ -133,10 +133,10 @@ public class BOPOverworldBiomeBuilder

private final ResourceKey<Biome>[][] SWAMP_BIOMES_BOP = new ResourceKey[][]{
{BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS},
{BOPBiomes.BOG, BOPBiomes.BOG, BOPBiomes.WETLAND, BOPBiomes.WETLAND, BOPBiomes.WETLAND},
{BOPBiomes.WETLAND, BOPBiomes.WETLAND, BOPBiomes.WETLAND, BOPBiomes.WETLAND, BOPBiomes.WETLAND},
{BOPBiomes.MARSH, BOPBiomes.MARSH, BOPBiomes.MARSH, BOPBiomes.MARSH, BOPBiomes.MARSH},
{BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN},
{BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN}
{BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN}
};

protected final ResourceKey<Biome>[][] PLATEAU_BIOMES = new ResourceKey[][]{
Expand Down Expand Up @@ -426,6 +426,7 @@ protected void addLowSlice(Registry<Biome> biomeRegistry, Consumer<Pair<Climate.

protected void addValleys(Registry<Biome> biomeRegistry, Consumer<Pair<Climate.ParameterPoint, ResourceKey<Biome>>> mapper, Climate.Parameter weirdness)
{
/* Disabled in favor of BOP rivers
this.addSurfaceBiome(mapper, this.FROZEN_RANGE, this.FULL_RANGE, this.coastContinentalness, Climate.Parameter.span(this.erosions[0], this.erosions[1]), weirdness, 0.0F, weirdness.max() < 0L ? Biomes.STONY_SHORE : Biomes.FROZEN_RIVER);
this.addSurfaceBiome(mapper, this.FROZEN_RANGE, this.FULL_RANGE, this.nearInlandContinentalness, Climate.Parameter.span(this.erosions[0], this.erosions[1]), weirdness, 0.0F, Biomes.FROZEN_RIVER);
this.addSurfaceBiome(mapper, this.FROZEN_RANGE, this.FULL_RANGE, Climate.Parameter.span(this.coastContinentalness, this.farInlandContinentalness), Climate.Parameter.span(this.erosions[2], this.erosions[5]), weirdness, 0.0F, Biomes.FROZEN_RIVER);
Expand All @@ -434,11 +435,11 @@ protected void addValleys(Registry<Biome> biomeRegistry, Consumer<Pair<Climate.P
this.addSurfaceBiome(mapper, this.FROZEN_RANGE, this.FULL_RANGE, this.coastContinentalness, this.erosions[6], weirdness, 0.0F, Biomes.FROZEN_RIVER);
// Inland watery valleys
//Disabled so the Frozen River doesn't cut into the Muskeg/Hot Springs
//this.addSurfaceBiome(mapper, this.FROZEN_RANGE, this.FULL_RANGE, Climate.Parameter.span(this.inlandContinentalness, this.farInlandContinentalness), this.erosions[6], weirdness, 0.0F, Biomes.FROZEN_RIVER);
*/

// BOP River biomes
for (int i = 1; i < this.temperatures.length; ++i)
for (int i = 0; i < this.temperatures.length; ++i)
{
Climate.Parameter temperature = this.temperatures[i];

Expand All @@ -454,6 +455,7 @@ protected void addValleys(Registry<Biome> biomeRegistry, Consumer<Pair<Climate.P
}
}

// BOP Swamp biomes
for (int i = 0; i < this.temperatures.length; ++i)
{
Climate.Parameter temperature = this.temperatures[i];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public class BOPSecondaryOverworldBiomeBuilder extends BOPOverworldBiomeBuilder

private final ResourceKey<Biome>[][] PLATEAU_BIOMES_BOP = new ResourceKey[][]{
{BOPBiomes.TUNDRA, BOPBiomes.TUNDRA, BOPBiomes.SNOWBLOSSOM_GROVE, BOPBiomes.SNOWY_MAPLE_WOODS, BOPBiomes.DEAD_FOREST},
{BOPBiomes.SEASONAL_FOREST, BOPBiomes.ASPEN_FOREST, BOPBiomes.HIGHLAND, BOPBiomes.HIGHLAND, BOPBiomes.HIGHLAND},
{BOPBiomes.SEASONAL_FOREST, BOPBiomes.ASPEN_FOREST, BOPBiomes.HIGHLAND, BOPBiomes.HIGHLAND, BOPBiomes.HIGHLAND},
{BOPBiomes.LAVENDER_FIELD, BOPBiomes.LAVENDER_FIELD, BOPBiomes.HIGHLAND, BOPBiomes.HIGHLAND, BOPBiomes.HIGHLAND},
{BOPBiomes.MEDITERRANEAN_FOREST, BOPBiomes.MEDITERRANEAN_FOREST, BOPBiomes.WOODLAND, BOPBiomes.ROCKY_RAINFOREST, BOPBiomes.VOLCANO},
{BOPBiomes.WASTELAND_STEPPE, BOPBiomes.WASTELAND_STEPPE, BOPBiomes.WASTELAND_STEPPE, BOPBiomes.WASTELAND_STEPPE, BOPBiomes.WASTELAND_STEPPE}
Expand All @@ -47,13 +47,21 @@ public class BOPSecondaryOverworldBiomeBuilder extends BOPOverworldBiomeBuilder
};

private final ResourceKey<Biome>[][] RIVER_BIOMES_BOP = new ResourceKey[][]{
{null, null, null, null, null},
{Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER, Biomes.FROZEN_RIVER, Biomes.RIVER},
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{BOPBiomes.WASTELAND, BOPBiomes.WASTELAND, BOPBiomes.WASTELAND, BOPBiomes.WASTELAND, BOPBiomes.WASTELAND}
};

private final ResourceKey<Biome>[][] SWAMP_BIOMES_BOP = new ResourceKey[][]{
{BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS, BOPBiomes.HOT_SPRINGS},
{BOPBiomes.BOG, BOPBiomes.BOG, BOPBiomes.BOG, BOPBiomes.BOG, BOPBiomes.BOG},
{BOPBiomes.MARSH, BOPBiomes.MARSH, BOPBiomes.MARSH, BOPBiomes.MARSH, BOPBiomes.MARSH},
{BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.BAYOU, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN},
{BOPBiomes.WASTELAND, BOPBiomes.WASTELAND, BOPBiomes.BAYOU, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN}
};

@Override
protected ResourceKey<Biome> pickMiddleBiomeBOP(Registry<Biome> biomeRegistry, int temperatureIndex, int humidityIndex, Climate.Parameter weirdness)
{
Expand All @@ -78,4 +86,10 @@ protected ResourceKey<Biome> pickRiverBiomeBOP(Registry<Biome> biomeRegistry, in
{
return BiomeUtil.biomeOrFallback(biomeRegistry, this.RIVER_BIOMES_BOP[temperatureIndex][humidityIndex], Biomes.RIVER);
}

@Override
protected ResourceKey<Biome> pickSwampBiomeBOP(Registry<Biome> biomeRegistry, int temperatureIndex, int humidityIndex, Climate.Parameter weirdness)
{
return BiomeUtil.biomeOrFallback(biomeRegistry, this.SWAMP_BIOMES_BOP[temperatureIndex][humidityIndex], this.pickMiddleBiomeBOP(biomeRegistry, temperatureIndex, humidityIndex, weirdness), Biomes.SWAMP);
}
}

0 comments on commit 3554804

Please sign in to comment.