Complete scaled biome distributions
Build / build (push) Canceled after 0s

This commit is contained in:
dnorberg committed 2026-09-22 22:08:00 -04:00
1 parent a7986001f1
commit 5336eb46b9
6 files changed
+74 -5

No files matched your search

+5
View File
@@ -345,6 +345,11 @@ Age-seeded biomes and softly bounded seeded regions. Tiny begins at Legacy's
smallest 16-block nominal scale; the serializable biome source retains its
seed, selected biomes, and scale across Age reloads.
Version 0.2.25.0 completes the scaled biome distributions. Small, Medium,
Large, and Huge reuse Tiny's seeded, softly bounded regions at nominal widths
of 32, 64, 128, and 256 blocks. Every size selects three deterministic biomes
and serializes the selection, Age seed, and scale with the runtime dimension.
Version 0.2.14.0 restores the legacy Linking and Descriptive Book artwork for
inventory items and gives each book its matching open-book texture when placed
on a Book Stand. Return Linking Books created inside another Age also retain and
+1 -1
View File
@@ -35,7 +35,7 @@ mod_name=Rivencraft
# The license of the mod. Review your options at https://choosealicense.com/. All Rights Reserved is the default.
mod_license=LGPL-3.0-or-later
# The mod version. Rivencraft uses the x.y.z.b policy documented in README.md.
mod_version=0.2.24.0
mod_version=0.2.25.0
immersive_portals_version=6.0.7
# The group ID for the mod. It is only important when publishing as an artifact to a Maven repository.
# This should match the base package used for the mod sources.
@@ -21,7 +21,7 @@ public record AgeDefinition(
public static final ResourceLocation RANDOM_VANILLA_PROFILE = ResourceLocation.fromNamespaceAndPath(
Rivencraft.MOD_ID, "random_vanilla"
);
public static final int CURRENT_GENERATION_VERSION = 12;
public static final int CURRENT_GENERATION_VERSION = 13;
public AgeDefinition {
Objects.requireNonNull(id, "id");
@@ -308,13 +308,24 @@ public final class AgeDimensionService {
: TILED_BIOME_SCALE
);
}
if (distribution == AgeTraits.BiomeDistribution.TINY && biomes.size() >= 3) {
int scaledBiomeScale = switch (distribution) {
case TINY -> 0;
case SMALL -> 1;
case MEDIUM -> 2;
case LARGE -> 3;
case HUGE -> 4;
default -> -1;
};
if (scaledBiomeScale >= 0 && biomes.size() >= 3) {
List<net.minecraft.core.Holder.Reference<Biome>> selected = new java.util.ArrayList<>(biomes);
Collections.shuffle(selected, new java.util.Random(age.seed() ^ 0x54494E5942494F4DL));
long salt = distribution == AgeTraits.BiomeDistribution.TINY
? 0x54494E5942494F4DL
: 0x5343414C45444249L;
Collections.shuffle(selected, new java.util.Random(age.seed() ^ salt));
return new ScaledBiomeSource(
HolderSet.direct(List.of(selected.get(0), selected.get(1), selected.get(2))),
age.seed(),
0
scaledBiomeScale
);
}
return MultiNoiseBiomeSource.createFromPreset(
@@ -298,6 +298,55 @@ public final class LinkingGameTests {
"The runtime dimension must apply the persisted celestial period");
}
}
AgeTraits.BiomeDistribution[] remainingScaledDistributions = {
AgeTraits.BiomeDistribution.SMALL,
AgeTraits.BiomeDistribution.MEDIUM,
AgeTraits.BiomeDistribution.LARGE,
AgeTraits.BiomeDistribution.HUGE
};
for (int scale = 1; scale <= remainingScaledDistributions.length; scale++) {
AgeTraits.BiomeDistribution distribution = remainingScaledDistributions[scale - 1];
UUID id = UUID.randomUUID();
AgeDefinition definition = new AgeDefinition(
id,
"Scaled " + distribution,
id.getMostSignificantBits(),
AgeGenerationProfiles.STANDARD,
AgeDefinition.CURRENT_GENERATION_VERSION,
helper.getLevel().getGameTime(),
net.minecraft.resources.ResourceLocation.fromNamespaceAndPath(
Rivencraft.MOD_ID, "gametest/scaled_" + distribution.name().toLowerCase() + "_" + id
),
null,
new AgeTraits(
distribution,
AgeTraits.Lighting.NORMAL,
AgeTraits.Weather.NORMAL,
1.0D,
0.0F,
0.0F
)
);
var level = AgeDimensionService.ensureLoaded(helper.getLevel().getServer(), definition);
helper.assertTrue(level != null, distribution + " Biome Distribution must load a runtime dimension");
if (level == null) {
continue;
}
var biomeSource = level.getChunkSource().getGenerator().getBiomeSource();
helper.assertTrue(biomeSource instanceof net.dnorberg.rivencraft.world.ScaledBiomeSource,
distribution + " Biome Distribution must use the serializable scaled biome source");
helper.assertValueEqual(
biomeSource.possibleBiomes().size(),
3,
distribution + " Biome Distribution must expose exactly three seeded biomes"
);
helper.assertValueEqual(
((net.dnorberg.rivencraft.world.ScaledBiomeSource)biomeSource).scale(),
scale,
distribution + " Biome Distribution must use its Legacy scale"
);
}
helper.succeed();
}
@@ -36,6 +36,10 @@ public final class ScaledBiomeSource extends BiomeSource {
this.cellWidth = 4 << scale;
}
public int scale() {
return scale;
}
@Override
protected MapCodec<? extends BiomeSource> codec() {
return CODEC;