Support weighted region and biome references

- Accept {region|biome, weight} objects as well as plain strings in regions, land/sea/shore/caveBiomes and children
- Pick from lists with an object entry by weight slots in list order, keep the rarity pick for string-only lists
- Leave the parent out of weighted child picks unless it is listed
- Describe both forms in the schema and update its digest
- Read weighted references in mod ingest
This commit is contained in:
piexel committed 2026-11-18 12:05:23 +01:00
1 parent ed037ea40b
commit d41cbeb6db
63 files changed
+1624 -317

No files matched your search

@@ -1149,7 +1149,7 @@ public final class ModdedStudioCommands {
int diameter = radius * 2;
int totalTasks = diameter * diameter;
KMap<String, AtomicInteger> counts = new KMap<>();
engine.getDimension().getRegions().forEach((String key) -> counts.put(key, new AtomicInteger(0)));
engine.getDimension().getRegionKeys().forEach((String key) -> counts.put(key, new AtomicInteger(0)));
// finally-scoped: a throw mid-scan previously leaked the sampler's whole
// ForkJoinPool (close() is the only thing that shuts it down).
MultiBurst burst = new MultiBurst("Region Sampler");
@@ -1,6 +1,7 @@
package art.arcane.iris.modded;
import art.arcane.iris.generation.biome.IrisBiome;
import art.arcane.iris.generation.biome.IrisBiomeEntry;
import art.arcane.iris.generation.runtime.Engine;
import art.arcane.iris.generation.runtime.DimensionStackLayout;
import art.arcane.iris.generation.terrain.IrisDimension;
@@ -174,9 +175,9 @@ public class ModdedBiomePolicyTest {
isles.setLoadKey("isles");
IrisBiome meadow = new IrisBiome().setDerivative("minecraft:plains");
meadow.setLoadKey("meadow");
IrisRegion main = new IrisRegion().setLandBiomes(new KList<>("meadow"));
IrisRegion main = new IrisRegion().setLandBiomes(IrisBiomeEntry.plainList("meadow"));
main.setLoadKey("main");
IrisRegion archipelago = new IrisRegion().setLandBiomes(new KList<>("isles"));
IrisRegion archipelago = new IrisRegion().setLandBiomes(IrisBiomeEntry.plainList("isles"));
archipelago.setLoadKey("archipelago");
IrisDimension dimension = mock(IrisDimension.class);
when(dimension.getReachableBiomes(any())).thenReturn(new KList<>(meadow, isles));