Skip to content

Commit

Permalink
Added support for custom river biomes in our regions, renamed Snowy O…
Browse files Browse the repository at this point in the history
…rigin Valley to Wintry Origin Valley
  • Loading branch information
Forstride committed Nov 26, 2023
1 parent 017e427 commit 886eb3a
Show file tree
Hide file tree
Showing 16 changed files with 105 additions and 65 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// 1.20.2 2023-11-26T16:02:56.6910887 Registries
// 1.20.2 2023-11-26T17:50:48.2431845 Registries
a09ddf53150a7fcf8767a311dd5cf040fa2e9221 data/biomesoplenty/damage_type/bramble.json
2d0eab2cc85c4c6397fdc41dd0cedefbc4a7a150 data/biomesoplenty/damage_type/fumarole.json
b8dc803c8b669f1676bca4cf741dd201cf95119e data/biomesoplenty/worldgen/biome/aspen_forest.json
Expand Down Expand Up @@ -53,7 +53,6 @@ c8fa4838e950832b19ba66266866ea61b005223f data/biomesoplenty/worldgen/biome/snowb
da1e2ca3e9713a52d9ed243d551fd3d7c40c7ab1 data/biomesoplenty/worldgen/biome/snowy_coniferous_forest.json
b3b83857ff6b14727aa1601f28548eebdc7d4c74 data/biomesoplenty/worldgen/biome/snowy_fir_clearing.json
395105efa433bd42df952ed7ad1a22947f90a65b data/biomesoplenty/worldgen/biome/snowy_maple_woods.json
0a702d4b7e9b0ddbb6a52b528141cec3b077c93e data/biomesoplenty/worldgen/biome/snowy_origin_valley.json
82f90b4ed424d588a7af087fa323a82f71f3bb08 data/biomesoplenty/worldgen/biome/spider_nest.json
02be395480aaa328ec75b2adc7df1692cd2d13a4 data/biomesoplenty/worldgen/biome/tropics.json
89b2556e41798476db1a083ad49d046d3dd2babf data/biomesoplenty/worldgen/biome/tundra.json
Expand All @@ -64,6 +63,7 @@ b3b83857ff6b14727aa1601f28548eebdc7d4c74 data/biomesoplenty/worldgen/biome/snowy
660cd9538a3ed2b681731e238d4742fb6cc9d96a data/biomesoplenty/worldgen/biome/wasteland.json
24dce7dbd2a39b6aa990fe00ddba94576849144d data/biomesoplenty/worldgen/biome/wasteland_steppe.json
60881c39a86b83d0a6bec725bff78f3cd43b1b3a data/biomesoplenty/worldgen/biome/wetland.json
0a702d4b7e9b0ddbb6a52b528141cec3b077c93e data/biomesoplenty/worldgen/biome/wintry_origin_valley.json
37400e95af1d490848d4ddd1ac2744f75615938e data/biomesoplenty/worldgen/biome/withered_abyss.json
42b8a814841ea7cda61ec115c8264ca9322fc060 data/biomesoplenty/worldgen/biome/woodland.json
a4d5101a19a38da4f42164b672b74766edb26bc9 data/biomesoplenty/worldgen/configured_carver/origin_cave.json
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/biomesoplenty/api/biome/BOPBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ public class BOPBiomes
public static final ResourceKey<Biome> SNOWY_CONIFEROUS_FOREST = registerOverworld("snowy_coniferous_forest");
public static final ResourceKey<Biome> SNOWY_FIR_CLEARING = registerOverworld("snowy_fir_clearing");
public static final ResourceKey<Biome> SNOWY_MAPLE_WOODS = registerOverworld("snowy_maple_woods");
public static final ResourceKey<Biome> SNOWY_ORIGIN_VALLEY = registerOverworld("snowy_origin_valley");
public static final ResourceKey<Biome> SPIDER_NEST = register("spider_nest");
public static final ResourceKey<Biome> TROPICS = registerOverworld("tropics");
public static final ResourceKey<Biome> TUNDRA = registerOverworld("tundra");
Expand All @@ -82,6 +81,7 @@ public class BOPBiomes
public static final ResourceKey<Biome> WASTELAND = registerOverworld("wasteland");
public static final ResourceKey<Biome> WASTELAND_STEPPE = registerOverworld("wasteland_steppe");
public static final ResourceKey<Biome> WETLAND = registerOverworld("wetland");
public static final ResourceKey<Biome> WINTRY_ORIGIN_VALLEY = registerOverworld("wintry_origin_valley");
public static final ResourceKey<Biome> WITHERED_ABYSS = register("withered_abyss");
public static final ResourceKey<Biome> WOODLAND = registerOverworld("woodland");

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,20 @@ public class BOPOverworldBiomeBuilder
{Biomes.FROZEN_OCEAN, Biomes.COLD_OCEAN, Biomes.OCEAN, Biomes.LUKEWARM_OCEAN, Biomes.WARM_OCEAN}
};

private final ResourceKey<Biome>[][] ISLAND_BIOMES_BOP = new ResourceKey[][]{
{BOPBiomes.SNOWY_ORIGIN_VALLEY, BOPBiomes.SNOWY_ORIGIN_VALLEY, BOPBiomes.SNOWY_ORIGIN_VALLEY, BOPBiomes.SNOWY_ORIGIN_VALLEY, BOPBiomes.SNOWY_ORIGIN_VALLEY},
{BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY},
private final ResourceKey<Biome>[][] RIVER_BIOMES_BOP = new ResourceKey[][]{
{null, null, null, null, null},
{null, null, null, null, null},
{null, null, null, null, null},
{BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS},
{BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS}
{null, null, null, BOPBiomes.FLOODPLAIN, BOPBiomes.FLOODPLAIN},
{null, null, null, null, null}
};

private final ResourceKey<Biome>[][] ISLAND_BIOMES_BOP = new ResourceKey[][]{
{BOPBiomes.WINTRY_ORIGIN_VALLEY, BOPBiomes.WINTRY_ORIGIN_VALLEY, BOPBiomes.WINTRY_ORIGIN_VALLEY, BOPBiomes.WINTRY_ORIGIN_VALLEY, BOPBiomes.WINTRY_ORIGIN_VALLEY},
{BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY, BOPBiomes.ORIGIN_VALLEY},
{null, null, null, null, null},
{BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS},
{BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS, BOPBiomes.TROPICS}
};

protected final ResourceKey<Biome>[][] MIDDLE_BIOMES = new ResourceKey[][]{
Expand Down Expand Up @@ -419,21 +427,33 @@ 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)
{
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.UNFROZEN_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.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.UNFROZEN_RANGE, this.FULL_RANGE, this.nearInlandContinentalness, Climate.Parameter.span(this.erosions[0], this.erosions[1]), weirdness, 0.0F, Biomes.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);
this.addSurfaceBiome(mapper, this.UNFROZEN_RANGE, this.FULL_RANGE, Climate.Parameter.span(this.coastContinentalness, this.farInlandContinentalness), Climate.Parameter.span(this.erosions[2], this.erosions[5]), weirdness, 0.0F, Biomes.RIVER);

// Coastal watery valleys
this.addSurfaceBiome(mapper, this.FROZEN_RANGE, this.FULL_RANGE, this.coastContinentalness, this.erosions[6], weirdness, 0.0F, Biomes.FROZEN_RIVER);
this.addSurfaceBiome(mapper, this.UNFROZEN_RANGE, this.FULL_RANGE, this.coastContinentalness, this.erosions[6], weirdness, 0.0F, Biomes.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)
{
Climate.Parameter temperature = this.temperatures[i];

for (int j = 0; j < this.humidities.length; ++j)
{
Climate.Parameter humidity = this.humidities[j];
ResourceKey<Biome> riverBiomeBOP = this.pickRiverBiomeBOP(biomeRegistry, i, j);

this.addSurfaceBiome(mapper, temperature, humidity, this.coastContinentalness, Climate.Parameter.span(this.erosions[0], this.erosions[1]), weirdness, 0.0F, weirdness.max() < 0L ? Biomes.STONY_SHORE : riverBiomeBOP);
this.addSurfaceBiome(mapper, temperature, humidity, this.nearInlandContinentalness, Climate.Parameter.span(this.erosions[0], this.erosions[1]), weirdness, 0.0F, riverBiomeBOP);
this.addSurfaceBiome(mapper, temperature, humidity, Climate.Parameter.span(this.coastContinentalness, this.farInlandContinentalness), Climate.Parameter.span(this.erosions[2], this.erosions[5]), weirdness, 0.0F, riverBiomeBOP);
this.addSurfaceBiome(mapper, temperature, humidity, this.coastContinentalness, this.erosions[6], weirdness, 0.0F, riverBiomeBOP);
}
}

for (int i = 0; i < this.temperatures.length; ++i)
{
Climate.Parameter temperature = this.temperatures[i];
Expand All @@ -458,6 +478,11 @@ protected void addUndergroundBiomes(Registry<Biome> biomeRegistry, Consumer<Pair
this.addBottomBiome(mapper, this.FULL_RANGE, this.FULL_RANGE, this.FULL_RANGE, Climate.Parameter.span(this.erosions[0], this.erosions[1]), this.FULL_RANGE, 0.0F, Biomes.DEEP_DARK);
}

protected ResourceKey<Biome> pickRiverBiomeBOP(Registry<Biome> biomeRegistry, int temperatureIndex, int humidityIndex)
{
return temperatureIndex > 0 ? BiomeUtil.biomeOrFallback(biomeRegistry, this.RIVER_BIOMES_BOP[temperatureIndex][humidityIndex], Biomes.RIVER) : Biomes.FROZEN_RIVER;
}

protected ResourceKey<Biome> pickIslandBiomeBOP(Registry<Biome> biomeRegistry, int temperatureIndex, int humidityIndex)
{
return BiomeUtil.biomeOrFallback(biomeRegistry, this.ISLAND_BIOMES_BOP[temperatureIndex][humidityIndex], Biomes.MUSHROOM_FIELDS);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import net.minecraft.core.Registry;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.level.biome.Biome;
import net.minecraft.world.level.biome.Biomes;
import net.minecraft.world.level.biome.Climate;

public class BOPSecondaryOverworldBiomeBuilder extends BOPOverworldBiomeBuilder
Expand Down Expand Up @@ -45,6 +46,14 @@ public class BOPSecondaryOverworldBiomeBuilder extends BOPOverworldBiomeBuilder
{null, null, null, null, null}
};

private final ResourceKey<Biome>[][] RIVER_BIOMES_BOP = new ResourceKey[][]{
{null, null, null, null, null},
{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}
};

@Override
protected ResourceKey<Biome> pickMiddleBiomeBOP(Registry<Biome> biomeRegistry, int temperatureIndex, int humidityIndex, Climate.Parameter weirdness)
{
Expand All @@ -63,4 +72,10 @@ protected ResourceKey<Biome> pickPlateauBiomeBOP(Registry<Biome> biomeRegistry,
if (weirdness.max() < 0L) return BiomeUtil.biomeOrFallback(biomeRegistry, this.PLATEAU_BIOMES_BOP[temperatureIndex][humidityIndex], this.PLATEAU_BIOMES[temperatureIndex][humidityIndex]);
else return BiomeUtil.biomeOrFallback(biomeRegistry, this.PLATEAU_BIOMES_VARIANT_BOP[temperatureIndex][humidityIndex], this.PLATEAU_BIOMES_BOP[temperatureIndex][humidityIndex], this.PLATEAU_BIOMES[temperatureIndex][humidityIndex]);
}

@Override
protected ResourceKey<Biome> pickRiverBiomeBOP(Registry<Biome> biomeRegistry, int temperatureIndex, int humidityIndex)
{
return BiomeUtil.biomeOrFallback(biomeRegistry, this.RIVER_BIOMES_BOP[temperatureIndex][humidityIndex], Biomes.RIVER);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -483,7 +483,7 @@ private static SurfaceRules.RuleSource makeBOPRules()
SurfaceRules.isBiome(BOPBiomes.MEDITERRANEAN_FOREST),
SurfaceRules.ifTrue(surfaceNoiseAbove(1.9D), PODZOL)
),
SurfaceRules.ifTrue(SurfaceRules.isBiome(BOPBiomes.ORIGIN_VALLEY, BOPBiomes.SNOWY_ORIGIN_VALLEY), ORIGIN_GRASS),
SurfaceRules.ifTrue(SurfaceRules.isBiome(BOPBiomes.ORIGIN_VALLEY, BOPBiomes.WINTRY_ORIGIN_VALLEY), ORIGIN_GRASS),
SurfaceRules.ifTrue(SurfaceRules.isBiome(BOPBiomes.REDWOOD_FOREST), PODZOL)
)
),
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/biomesoplenty/init/ModBiomes.java
Original file line number Diff line number Diff line change
Expand Up @@ -96,14 +96,14 @@ public static void bootstrapBiomes(BootstapContext<Biome> context)
register(context, BOPBiomes.SNOWY_CONIFEROUS_FOREST, BOPOverworldBiomes.coniferousForest(placedFeatureGetter, carverGetter, true));
register(context, BOPBiomes.SNOWY_FIR_CLEARING, BOPOverworldBiomes.firClearing(placedFeatureGetter, carverGetter, true));
register(context, BOPBiomes.SNOWY_MAPLE_WOODS, BOPOverworldBiomes.mapleWoods(placedFeatureGetter, carverGetter, true));
register(context, BOPBiomes.SNOWY_ORIGIN_VALLEY, BOPOverworldBiomes.originValley(placedFeatureGetter, carverGetter, true));
register(context, BOPBiomes.TROPICS, BOPOverworldBiomes.tropics(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.TUNDRA, BOPOverworldBiomes.tundra(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.VOLCANIC_PLAINS, BOPOverworldBiomes.volcanicPlains(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.VOLCANO, BOPOverworldBiomes.volcano(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.WASTELAND, BOPOverworldBiomes.wasteland(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.WASTELAND_STEPPE, BOPOverworldBiomes.wastelandSteppe(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.WETLAND, BOPOverworldBiomes.wetland(placedFeatureGetter, carverGetter));
register(context, BOPBiomes.WINTRY_ORIGIN_VALLEY, BOPOverworldBiomes.originValley(placedFeatureGetter, carverGetter, true));
register(context, BOPBiomes.WOODLAND, BOPOverworldBiomes.woodland(placedFeatureGetter, carverGetter, false));

// Cave biomes
Expand Down Expand Up @@ -169,14 +169,14 @@ private static void registerVillagerTypes()
registerVillagerType(BOPBiomes.SNOWY_CONIFEROUS_FOREST, VillagerType.TAIGA);
registerVillagerType(BOPBiomes.SNOWY_FIR_CLEARING, VillagerType.TAIGA);
registerVillagerType(BOPBiomes.SNOWY_MAPLE_WOODS, VillagerType.TAIGA);
registerVillagerType(BOPBiomes.SNOWY_ORIGIN_VALLEY, VillagerType.PLAINS);
registerVillagerType(BOPBiomes.TROPICS, VillagerType.JUNGLE);
registerVillagerType(BOPBiomes.TUNDRA, VillagerType.TAIGA);
registerVillagerType(BOPBiomes.VOLCANIC_PLAINS, VillagerType.PLAINS);
registerVillagerType(BOPBiomes.VOLCANO, VillagerType.PLAINS);
registerVillagerType(BOPBiomes.WASTELAND, VillagerType.DESERT);
registerVillagerType(BOPBiomes.WASTELAND_STEPPE, VillagerType.DESERT);
registerVillagerType(BOPBiomes.WETLAND, VillagerType.SWAMP);
registerVillagerType(BOPBiomes.WINTRY_ORIGIN_VALLEY, VillagerType.PLAINS);
registerVillagerType(BOPBiomes.WOODLAND, VillagerType.PLAINS);
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/biomesoplenty/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
"biome.biomesoplenty.snowy_coniferous_forest": "Snowy Coniferous Forest",
"biome.biomesoplenty.snowy_fir_clearing": "Snowy Fir Clearing",
"biome.biomesoplenty.snowy_maple_woods": "Snowy Maple Woods",
"biome.biomesoplenty.snowy_origin_valley": "Snowy Origin Valley",
"biome.biomesoplenty.spider_nest": "Spider Nest",
"biome.biomesoplenty.tropics": "Tropics",
"biome.biomesoplenty.tundra": "Tundra",
Expand All @@ -71,6 +70,7 @@
"biome.biomesoplenty.wasteland": "Wasteland",
"biome.biomesoplenty.wasteland_steppe": "Wasteland Steppe",
"biome.biomesoplenty.wetland": "Wetland",
"biome.biomesoplenty.wintry_origin_valley": "Wintry Origin Valley",
"biome.biomesoplenty.withered_abyss": "Withered Abyss",
"biome.biomesoplenty.woodland": "Woodland",

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -847,22 +847,6 @@
]
}
},
"snowy_origin_valley": {
"trigger": "minecraft:location",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"biome": "biomesoplenty:snowy_origin_valley"
}
}
}
]
}
},
"spider_nest": {
"trigger": "minecraft:location",
"conditions": {
Expand Down Expand Up @@ -1023,6 +1007,22 @@
]
}
},
"wintry_origin_valley": {
"trigger": "minecraft:location",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"biome": "biomesoplenty:wintry_origin_valley"
}
}
}
]
}
},
"withered_abyss": {
"trigger": "minecraft:location",
"conditions": {
Expand Down Expand Up @@ -1214,9 +1214,6 @@
"snowy_maple_woods"
],
[
"snowy_origin_valley"
],
[
"spider_nest"
],
[
Expand Down Expand Up @@ -1247,6 +1244,9 @@
"wetland"
],
[
"wintry_origin_valley"
],
[
"withered_abyss"
],
[
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -846,22 +846,6 @@
]
}
},
"snowy_origin_valley": {
"trigger": "minecraft:location",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"biome": "biomesoplenty:snowy_origin_valley"
}
}
}
]
}
},
"spider_nest": {
"trigger": "minecraft:location",
"conditions": {
Expand Down Expand Up @@ -1022,6 +1006,22 @@
]
}
},
"wintry_origin_valley": {
"trigger": "minecraft:location",
"conditions": {
"player": [
{
"condition": "minecraft:entity_properties",
"entity": "this",
"predicate": {
"location": {
"biome": "biomesoplenty:wintry_origin_valley"
}
}
}
]
}
},
"withered_abyss": {
"trigger": "minecraft:location",
"conditions": {
Expand Down Expand Up @@ -1109,7 +1109,6 @@
"snowy_coniferous_forest",
"snowy_fir_clearing",
"snowy_maple_woods",
"snowy_origin_valley",
"spider_nest",
"tropics",
"tundra",
Expand All @@ -1120,6 +1119,7 @@
"wasteland",
"wasteland_steppe",
"wetland",
"wintry_origin_valley",
"withered_abyss",
"woodland"
]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@
"id": "biomesoplenty:snowblossom_grove",
"required": false
},
{
"id": "biomesoplenty:snowy_origin_valley",
"required": false
},
{
"id": "biomesoplenty:tropics",
"required": false
Expand All @@ -57,6 +53,10 @@
"id": "biomesoplenty:volcano",
"required": false
},
{
"id": "biomesoplenty:wintry_origin_valley",
"required": false
},
{
"id": "biomesoplenty:glowing_grotto",
"required": false
Expand Down
Loading

0 comments on commit 886eb3a

Please sign in to comment.