mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-30 09:44:24 +00:00
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:
1 parent
ed037ea40b
commit
d41cbeb6db
63 files changed
+1624
-317
No files matched your search
+1
-1
@@ -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");
|
||||
|
||||
+3
-2
@@ -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));
|
||||
|
||||
Reference in new issue
Block a user