Parity: a biome data-pack fixture, and the chunk oracle uses a pack's level stem

This commit is contained in:
ThatCakeIsAPie committed 2026-11-02 09:10:21 -06:00
1 parent 017afee3a1
commit 6a6ef2de28
7 files changed
+202 -2

No files matched your search

@@ -223,7 +223,7 @@ public final class VanillaChunkGenerationOracle {
staticTags.forEach(Registry.PendingTags::apply);
components.forEach(net.minecraft.core.component.DataComponentInitializers.PendingComponents::apply);
RegistryAccess access = loaded.layers().compositeAccess();
var settings = world.lookupOrThrow(Registries.NOISE_SETTINGS).getOrThrow(switch (dimension) {
net.minecraft.core.Holder<NoiseGeneratorSettings> settings = world.lookupOrThrow(Registries.NOISE_SETTINGS).getOrThrow(switch (dimension) {
case "the_nether" -> NoiseGeneratorSettings.NETHER;
case "the_end" -> NoiseGeneratorSettings.END;
default -> NoiseGeneratorSettings.OVERWORLD;
@@ -234,6 +234,18 @@ public final class VanillaChunkGenerationOracle {
case "the_end" -> TheEndBiomeSource.create(world.lookupOrThrow(Registries.BIOME));
default -> MultiNoiseBiomeSource.createFromPreset(presets.getOrThrow(MultiNoiseBiomeSourceParameterLists.OVERWORLD));
};
// A pack's level stem (dimension/<id>.json) stands in for the preset's, as when a world is
// created with the pack: its generator's biome source and noise settings.
if (datapacks != null) {
var dimensionLookups = TagLoader.buildUpdatedLookups(layers.replaceFrom(RegistryLayer.WORLD, world).getAccessForLoading(RegistryLayer.DIMENSIONS), staticTags);
var dimensions = RegistryDataLoader.load(resources, dimensionLookups, RegistryDataLoader.DIMENSION_REGISTRIES, Runnable::run).join();
var stemKey = ResourceKey.create(Registries.LEVEL_STEM, net.minecraft.resources.Identifier.withDefaultNamespace(dimension));
var stem = dimensions.lookupOrThrow(Registries.LEVEL_STEM).get(stemKey);
if (stem.isPresent() && stem.get().value().generator() instanceof NoiseBasedChunkGenerator noise) {
biomeSource = noise.getBiomeSource();
settings = noise.generatorSettings();
}
}
ResourceKey<Level> levelKey = switch (dimension) {
case "the_nether" -> Level.NETHER;
case "the_end" -> Level.END;
@@ -0,0 +1,41 @@
{
"attributes": {
"minecraft:gameplay/natural_mob_spawns": {
"argument": {
"spawn_costs": {},
"spawns_by_category": {
"creature": [{ "type": "minecraft:rabbit", "count": 3, "weight": 4 }],
"monster": [{ "type": "minecraft:husk", "count": 4, "weight": 80 }]
}
},
"modifier": "overlay"
},
"minecraft:visual/ambient_particles": [
{ "particle": { "type": "minecraft:ash" }, "probability": 0.1 }
],
"minecraft:visual/fog_color": "#aa3311",
"minecraft:visual/sky_color": "#ff6633"
},
"carvers": ["minecraft:cave"],
"downfall": 0.0,
"effects": {
"foliage_color": "#ff7700",
"grass_color": "#d04010",
"water_color": "#ff5522"
},
"features": [
[],
[],
[],
[],
[],
[],
["minecraft:ore_dirt"],
[],
[],
["minecraft:patch_grass_plain"],
[]
],
"has_precipitation": false,
"temperature": 2.0
}
@@ -0,0 +1,24 @@
{
"attributes": {
"minecraft:gameplay/natural_mob_spawns": {
"argument": {
"spawn_costs": {},
"spawns_by_category": {
"monster": [{ "type": "minecraft:stray", "count": 4, "weight": 80 }]
}
},
"modifier": "overlay"
},
"minecraft:visual/sky_color": "#c8e0ff"
},
"carvers": ["minecraft:cave"],
"downfall": 0.5,
"effects": {
"foliage_color": "#6080c0",
"grass_color": "#80a0ff",
"water_color": "#3938c9"
},
"features": [[], [], [], [], [], [], [], [], [], [], ["minecraft:freeze_top_layer"]],
"has_precipitation": true,
"temperature": -0.7
}
@@ -0,0 +1,72 @@
{
"type": "minecraft:overworld",
"generator": {
"type": "minecraft:noise",
"settings": "minecraft:overworld",
"biome_source": {
"type": "minecraft:multi_noise",
"biomes": [
{
"biome": "minecraft:ocean",
"parameters": {
"temperature": [-1.0, 1.0],
"humidity": [-1.0, 1.0],
"continentalness": [-1.2, -0.19],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "horizon_test:frost_wastes",
"parameters": {
"temperature": [-1.0, -0.2],
"humidity": [-1.0, 1.0],
"continentalness": [-0.19, 1.2],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "minecraft:plains",
"parameters": {
"temperature": [-0.2, 0.15],
"humidity": [-1.0, 1.0],
"continentalness": [-0.19, 1.2],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "minecraft:glass_meadow",
"parameters": {
"temperature": [0.15, 0.45],
"humidity": [-1.0, 1.0],
"continentalness": [-0.19, 1.2],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
},
{
"biome": "horizon_test:ember_fields",
"parameters": {
"temperature": [0.45, 1.0],
"humidity": [-1.0, 1.0],
"continentalness": [-0.19, 1.2],
"erosion": [-1.0, 1.0],
"weirdness": [-1.0, 1.0],
"depth": 0.0,
"offset": 0.0
}
}
]
}
}
}
@@ -0,0 +1,44 @@
{
"attributes": {
"minecraft:gameplay/natural_mob_spawns": {
"argument": {
"spawn_costs": {},
"spawns_by_category": {
"creature": [
{ "type": "minecraft:pig", "count": 4, "weight": 10 },
{ "type": "minecraft:cow", "count": 4, "weight": 8 }
],
"monster": [
{ "type": "minecraft:zombie", "count": 4, "weight": 95 },
{ "type": "minecraft:skeleton", "count": 4, "weight": 100 }
]
}
},
"modifier": "overlay"
},
"minecraft:visual/fog_color": "#ffd0f0",
"minecraft:visual/sky_color": "#ff9ad5"
},
"carvers": ["minecraft:cave"],
"downfall": 0.8,
"effects": {
"foliage_color": "#ff40c0",
"grass_color": "#40e0ff",
"water_color": "#2ae0c8"
},
"features": [
[],
[],
[],
[],
[],
[],
["minecraft:ore_dirt", "minecraft:ore_coal_upper"],
[],
[],
["minecraft:trees_plains", "minecraft:flower_plains", "minecraft:patch_grass_plain"],
[]
],
"has_precipitation": true,
"temperature": 0.7
}
@@ -0,0 +1,7 @@
{
"pack": {
"description": "Horizon's data pack biome harness: new biomes with their own climate points",
"min_format": 121,
"max_format": 121
}
}
+1 -1
View File
@@ -27,7 +27,7 @@ except ImportError:
import test_chunk_generation_parity as chunks
# HORIZON_PARITY_DATAPACKS: another folder of packs (tools/fixtures/tall_datapacks: a 2096-high
# Overworld).
# Overworld; tools/fixtures/biome_datapacks: new and overridden biomes in a level stem).
DATAPACKS = Path(os.environ.get('HORIZON_PARITY_DATAPACKS', lab.ROOT / 'tools/fixtures/datapacks'))
SEEDS = [12345, 4242]