mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-27 00:04:42 +00:00
Child lineage review fixes
- Terrain source test samples a self-cycle and a two-cycle child graph and checks every lineage link and inherited value - Shore biome lookups skip the lineage unless some policy sets a positive shoreBiomeWidth - IrisBiome.CHILD_HOPS is the one child hop limit for implosion and datapack river areas - A missing shore biome error names the biome, region or dimension that lists it
This commit is contained in:
1 parent
ff0a95a6fd
commit
f7ddd68d26
6 files changed
+178
-38
No files matched your search
@@ -92,6 +92,7 @@ import java.util.Objects;
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
public class IrisBiome extends IrisRegistrant implements Rarity {
|
||||
public static final int CHILD_HOPS = 4;
|
||||
private static final int BIOME_GENERATOR_CACHE_SIZE = 8;
|
||||
private static final int CHILDREN_SEED_SALT = 2137;
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import art.arcane.iris.generation.terrain.IrisDimension;
|
||||
import art.arcane.iris.generation.terrain.IrisRegion;
|
||||
import art.arcane.iris.pack.loading.IrisData;
|
||||
|
||||
import java.util.Collection;
|
||||
import java.util.IdentityHashMap;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -31,6 +32,23 @@ final class HydrologyShoreBiomes {
|
||||
this.seed = seed;
|
||||
}
|
||||
|
||||
static boolean banded(IrisDimension dimension, Collection<IrisRegion> regions, Collection<IrisBiome> biomes) {
|
||||
if (banded(dimension.getHydrologyPolicy())) {
|
||||
return true;
|
||||
}
|
||||
for (IrisRegion region : regions) {
|
||||
if (region != null && banded(region.getHydrologyPolicy())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
for (IrisBiome biome : biomes) {
|
||||
if (biome != null && banded(biome.getHydrologyPolicy())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
IrisBiome select(List<IrisBiome> lineage, IrisRegion region, int x, int z, int shoreDistance) {
|
||||
Policy policy = policy(lineage, region);
|
||||
IrisBiome[] biomes = policy.biomes();
|
||||
@@ -76,20 +94,38 @@ final class HydrologyShoreBiomes {
|
||||
}
|
||||
IrisBiome[] biomes = new IrisBiome[keys.size()];
|
||||
for (int index = 0; index < biomes.length; index++) {
|
||||
biomes[index] = load(keys.get(index), lineage.isEmpty() ? null : lineage.getFirst(), region).withInferredType(InferredType.SHORE);
|
||||
biomes[index] = load(keys.get(index), lineage, region).withInferredType(InferredType.SHORE);
|
||||
}
|
||||
return new Policy(biomes, width);
|
||||
}
|
||||
|
||||
private IrisBiome load(String key, IrisBiome biome, IrisRegion region) {
|
||||
private IrisBiome load(String key, List<IrisBiome> lineage, IrisRegion region) {
|
||||
IrisBiome loaded = key == null || key.isBlank() || data == null ? null : data.getBiomeLoader().load(key);
|
||||
if (loaded == null) {
|
||||
throw new IllegalStateException("Hydrology shore biome '" + key + "' for biome " + (biome == null ? "none" : biome.getLoadKey())
|
||||
+ " in region " + (region == null ? "none" : region.getLoadKey()) + " does not exist");
|
||||
throw new IllegalStateException("Hydrology shore biome '" + key + "' listed by " + listedBy(lineage, region) + " for biome "
|
||||
+ (lineage.isEmpty() ? "none" : lineage.getFirst().getLoadKey()) + " in region " + (region == null ? "none" : region.getLoadKey())
|
||||
+ " does not exist");
|
||||
}
|
||||
return loaded;
|
||||
}
|
||||
|
||||
private String listedBy(List<IrisBiome> lineage, IrisRegion region) {
|
||||
for (IrisBiome biome : lineage) {
|
||||
if (lists(biome.getHydrologyPolicy())) {
|
||||
return "biome " + biome.getLoadKey();
|
||||
}
|
||||
}
|
||||
return region != null && lists(region.getHydrologyPolicy()) ? "region " + region.getLoadKey() : "dimension " + dimension.getLoadKey();
|
||||
}
|
||||
|
||||
private static boolean lists(IrisHydrologyPolicy policy) {
|
||||
return policy != null && policy.getShoreBiomes() != null;
|
||||
}
|
||||
|
||||
private static boolean banded(IrisHydrologyPolicy policy) {
|
||||
return policy != null && policy.getShoreBiomeWidth() != null && policy.getShoreBiomeWidth() > 0;
|
||||
}
|
||||
|
||||
private record Policy(IrisBiome[] biomes, int width) {
|
||||
}
|
||||
}
|
||||
@@ -147,7 +147,6 @@ public class IrisComplex implements DataProvider {
|
||||
IrisGenerator::getLoadKey,
|
||||
Comparator.nullsFirst(Comparator.naturalOrder())
|
||||
);
|
||||
private static final int CHILD_HOPS = 4;
|
||||
private static final ThreadLocal<TerrainBatchScratch> BATCH_SCRATCH = ThreadLocal.withInitial(TerrainBatchScratch::new);
|
||||
private static final InferredType[] INFERRED_BIOME_PREPARATION_ORDER = {
|
||||
InferredType.LAND,
|
||||
@@ -281,6 +280,9 @@ public class IrisComplex implements DataProvider {
|
||||
@Getter(AccessLevel.NONE)
|
||||
@Setter(AccessLevel.NONE)
|
||||
private final transient BiomeLineages biomeLineages;
|
||||
@Getter(AccessLevel.NONE)
|
||||
@Setter(AccessLevel.NONE)
|
||||
private final transient boolean shoreBands;
|
||||
@Setter(AccessLevel.NONE)
|
||||
private final transient SubterrainPlanner subterrainPlanner;
|
||||
private transient IrisImageMapRuntime imageMapRuntime;
|
||||
@@ -502,8 +504,11 @@ public class IrisComplex implements DataProvider {
|
||||
hydrologyRuntime = HydrologyRuntime.create(engine, this);
|
||||
waterFluidStreams = hydrologyRuntime.enabled() ? createWaterFluidStreams(hydrologyRuntime.settings().fluids(), hydrologyRuntime.settings().seams().values()) : Map.of();
|
||||
pondMaterials = hydrologyRuntime.enabled() ? hydrologyRuntime.settings().ponds().materials() : null;
|
||||
KList<IrisRegion> policyRegions = hydrologyRuntime.enabled() ? engine.getDimension().getAllRegions(engine) : new KList<>();
|
||||
KList<IrisBiome> policyBiomes = hydrologyRuntime.enabled() ? engine.getDimension().getReachableBiomes(engine) : new KList<>();
|
||||
waterVegetation = hydrologyRuntime.enabled() ? HydrologyVegetationSource.create(engine.getDimension(), hydrologyRuntime.settings(), data,
|
||||
engine.getDimension().getAllRegions(engine), engine.getDimension().getReachableBiomes(engine)) : HydrologyVegetationSource.NONE;
|
||||
policyRegions, policyBiomes) : HydrologyVegetationSource.NONE;
|
||||
shoreBands = hydrologyRuntime.enabled() && HydrologyShoreBiomes.banded(engine.getDimension(), policyRegions, policyBiomes);
|
||||
heightStream = new BakedHeightStream(bakeCache, () -> terrainEngine.getPlatformHooks().isMainThread(),
|
||||
this::resolveHydrologyTerrainHeight, this::resolveHydrologyTerrainHeight);
|
||||
roundedHeighteightStream = GenerationStreams.contextInjecting(heightStream, engine, (c, x, z) -> c.getHeight().getDouble(x, z))
|
||||
@@ -1824,6 +1829,9 @@ public class IrisComplex implements DataProvider {
|
||||
|| seamWeight(blockX, blockZ) == 0D) {
|
||||
return null;
|
||||
}
|
||||
if (!shoreBands) {
|
||||
return null;
|
||||
}
|
||||
IrisBiome shore = shoreBiomes.select(baseBiomeLineage(blockX, blockZ), regionStream.get(x, z), blockX, blockZ, distance);
|
||||
return shore == null ? null : implode(shore, x, z);
|
||||
}
|
||||
@@ -2500,7 +2508,7 @@ public class IrisComplex implements DataProvider {
|
||||
return b;
|
||||
}
|
||||
|
||||
return implode(b, x, z, CHILD_HOPS - 1);
|
||||
return implode(b, x, z, IrisBiome.CHILD_HOPS - 1);
|
||||
}
|
||||
|
||||
private IrisBiome implode(IrisBiome b, double x, double z, int max) {
|
||||
@@ -2525,11 +2533,11 @@ public class IrisComplex implements DataProvider {
|
||||
}
|
||||
|
||||
private List<IrisBiome> childLineage(IrisBiome biome, int x, int z) {
|
||||
IrisBiome[] rootFirst = new IrisBiome[CHILD_HOPS + 1];
|
||||
IrisBiome[] rootFirst = new IrisBiome[IrisBiome.CHILD_HOPS + 1];
|
||||
IrisBiome current = inferredByType.get(bridgeStream.get(x, z)).get(x, z);
|
||||
rootFirst[0] = current;
|
||||
int size = 1;
|
||||
for (int hop = 0; hop < CHILD_HOPS && !current.getChildren().isEmpty(); hop++) {
|
||||
for (int hop = 0; hop < IrisBiome.CHILD_HOPS && !current.getChildren().isEmpty(); hop++) {
|
||||
IrisBiome picked = pickChild(current, x, z);
|
||||
if (picked == current) {
|
||||
break;
|
||||
|
||||
+1
-2
@@ -18,7 +18,6 @@ import java.util.TreeMap;
|
||||
|
||||
public final class RiverStage implements CompileStage {
|
||||
private static final String ESTIMATE_TAG = "estimate";
|
||||
private static final int MAX_CHILD_HOPS = 4;
|
||||
|
||||
@Override
|
||||
public String name() {
|
||||
@@ -72,7 +71,7 @@ public final class RiverStage implements CompileStage {
|
||||
for (int index = 1; index < leafFirst.size(); index++) {
|
||||
key.append('<').append(leafFirst.get(index).getLoadKey());
|
||||
}
|
||||
if (lineages.putIfAbsent(key.toString(), leafFirst) != null || leafFirst.size() > MAX_CHILD_HOPS) {
|
||||
if (lineages.putIfAbsent(key.toString(), leafFirst) != null || leafFirst.size() > IrisBiome.CHILD_HOPS) {
|
||||
return;
|
||||
}
|
||||
IrisBiome leaf = leafFirst.getFirst();
|
||||
|
||||
+97
-26
@@ -25,12 +25,14 @@ import org.junit.rules.TemporaryFolder;
|
||||
import java.nio.file.Path;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.ExecutorService;
|
||||
import java.util.concurrent.Executors;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
import static org.junit.Assert.fail;
|
||||
|
||||
@@ -180,23 +182,13 @@ public class IrisHydrologyTerrainSourceTest {
|
||||
|
||||
@Test
|
||||
public void childBiomesInheritTheParentPolicy() throws Exception {
|
||||
Path pack = EngineFixture.pack(temporaryFolder.newFolder().toPath(), false);
|
||||
EngineFixture.extend(pack, "peaks", ",\"hydrologyPolicy\":{\"pondDensity\":5,\"streams\":\"ALLOW\",\"fluid\":\"lava\"}");
|
||||
EngineFixture.extend(pack, "meadow", ",\"children\":[\"glade\"],\"childShrinkFactor\":2.5");
|
||||
EngineFixture.biome(pack, "glade", "[{\"generator\":\"plain\",\"min\":4,\"max\":10}]", "");
|
||||
int side = 96;
|
||||
int[] xs = new int[side * side];
|
||||
int[] zs = new int[side * side];
|
||||
for (int index = 0; index < xs.length; index++) {
|
||||
xs[index] = (index % side) * 9 - 432;
|
||||
zs[index] = (index / side) * 9 - 432;
|
||||
}
|
||||
Path pack = childPack("");
|
||||
int[][] grid = childGrid();
|
||||
int[] xs = grid[0];
|
||||
int[] zs = grid[1];
|
||||
pool = Executors.newFixedThreadPool(4);
|
||||
try (EngineFixture.Environment ignored = EngineFixture.environment(); EngineFixture fixture = new EngineFixture(pack)) {
|
||||
IrisHydrology config = new IrisHydrology().setEnabled(true).setPersist(false);
|
||||
config.getFluids().add(new IrisFluidProfile().setName("lava").setPalette(new IrisMaterialPalette().qclear().qadd("minecraft:lava")));
|
||||
HydrologySettings settings = HydrologySettings.compile(config, EngineFixture.SEED, fixture.dimension.getFluidHeight(), 0,
|
||||
EngineFixture.HEIGHT);
|
||||
HydrologySettings settings = lavaSettings(fixture);
|
||||
IrisHydrologyTerrainSource source = new IrisHydrologyTerrainSource(fixture.complex, fixture.dimension, settings, null, 1,
|
||||
HydrologyBinding.UNBOUND);
|
||||
HydrologySampleBuffer samples = new HydrologySampleBuffer(xs.length);
|
||||
@@ -210,17 +202,9 @@ public class IrisHydrologyTerrainSourceTest {
|
||||
int z = zs[index];
|
||||
String chain = chain(fixture, x, z);
|
||||
boolean alpha = fixture.complex.getRegionStream().get(x, z).getLoadKey().equals("alpha");
|
||||
boolean peaks = chain.contains("peaks");
|
||||
boolean meadow = chain.contains("meadow");
|
||||
String at = chain + "@" + (alpha ? "alpha" : "beta") + " " + x + "," + z;
|
||||
chains.merge(chain + "@" + (alpha ? "alpha" : "beta"), 1, Integer::sum);
|
||||
assertEquals(at, meadow ? 2f : 0.5f, samples.rainfall()[index], 0f);
|
||||
assertEquals(at, peaks ? 5f : alpha ? 3f : 1f, samples.pondDensity()[index], 0f);
|
||||
int permission = (peaks || !alpha ? HydrologySampleBuffer.ALLOW_STREAMS : 0) | (meadow ? 0 : HydrologySampleBuffer.ALLOW_PONDS);
|
||||
assertEquals(at, permission, samples.permission()[index]);
|
||||
String fluid = peaks ? "lava" : alpha ? "water" : null;
|
||||
assertEquals(at, fluid, samples.fluidProfile()[index]);
|
||||
assertEquals(at, fluid, source.channelFluid(x, z));
|
||||
assertChildPolicy(at, source, samples, new int[]{x, z, index}, alpha, chain.contains("peaks"), chain.contains("meadow"));
|
||||
}
|
||||
assertTrue("sampled chains " + chains, chains.containsKey("meadow<peaks@alpha") && chains.containsKey("glade<meadow<peaks@alpha")
|
||||
&& chains.containsKey("meadow@alpha") && chains.containsKey("meadow@beta") && chains.containsKey("glade<meadow@beta")
|
||||
@@ -228,10 +212,97 @@ public class IrisHydrologyTerrainSourceTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void childCyclesResolveTheirParentsWithoutDrift() throws Exception {
|
||||
assertCycleResolves(",\"children\":[\"glade\"]", false);
|
||||
assertCycleResolves(",\"children\":[\"meadow\"],\"childShrinkFactor\":3.5", true);
|
||||
}
|
||||
|
||||
private void assertCycleResolves(String gladeExtra, boolean repeats) throws Exception {
|
||||
Path pack = childPack(gladeExtra);
|
||||
int[][] grid = childGrid();
|
||||
int[] xs = grid[0];
|
||||
int[] zs = grid[1];
|
||||
try (EngineFixture.Environment ignored = EngineFixture.environment(); EngineFixture fixture = new EngineFixture(pack)) {
|
||||
IrisHydrologyTerrainSource source = new IrisHydrologyTerrainSource(fixture.complex, fixture.dimension, lavaSettings(fixture), null, 1,
|
||||
HydrologyBinding.UNBOUND);
|
||||
HydrologySampleBuffer samples = new HydrologySampleBuffer(xs.length);
|
||||
source.sample(xs, zs, samples, false);
|
||||
int glades = 0;
|
||||
int repeated = 0;
|
||||
for (int index = 0; index < xs.length; index++) {
|
||||
int x = xs[index];
|
||||
int z = zs[index];
|
||||
IrisBiome leaf = fixture.complex.getBaseBiomeStream().get(x, z);
|
||||
IrisBiome root = root(fixture, x, z);
|
||||
List<IrisBiome> lineage = fixture.complex.baseBiomeLineage(x, z);
|
||||
String at = gladeExtra + " " + root.getLoadKey() + ">" + leaf.getLoadKey() + " " + x + "," + z;
|
||||
assertSame(at, leaf, lineage.getFirst());
|
||||
assertSame(at, root, lineage.getLast());
|
||||
assertTrue(at, lineage.size() <= 5);
|
||||
Set<String> keys = new HashSet<>();
|
||||
for (int link = 0; link < lineage.size(); link++) {
|
||||
keys.add(lineage.get(link).getLoadKey());
|
||||
if (link > 0) {
|
||||
assertTrue(at, lineage.get(link).getChildren().contains(lineage.get(link - 1).getLoadKey()));
|
||||
assertTrue(at, lineage.get(link) != lineage.get(link - 1));
|
||||
}
|
||||
}
|
||||
repeated += keys.size() < lineage.size() ? 1 : 0;
|
||||
glades += leaf.getLoadKey().equals("glade") ? 1 : 0;
|
||||
boolean alpha = fixture.complex.getRegionStream().get(x, z).getLoadKey().equals("alpha");
|
||||
boolean meadow = leaf.getLoadKey().equals("meadow") || leaf.getLoadKey().equals("glade");
|
||||
assertChildPolicy(at, source, samples, new int[]{x, z, index}, alpha, root.getLoadKey().equals("peaks"), meadow);
|
||||
}
|
||||
assertTrue(gladeExtra + " glade columns " + glades, glades > 0);
|
||||
assertTrue(gladeExtra + " columns whose chain repeats a biome " + repeated, repeats == repeated > 0);
|
||||
}
|
||||
}
|
||||
|
||||
private static void assertChildPolicy(String at, IrisHydrologyTerrainSource source, HydrologySampleBuffer samples, int[] column, boolean alpha,
|
||||
boolean peaks, boolean meadow) {
|
||||
int index = column[2];
|
||||
assertEquals(at, meadow ? 2f : 0.5f, samples.rainfall()[index], 0f);
|
||||
assertEquals(at, peaks ? 5f : alpha ? 3f : 1f, samples.pondDensity()[index], 0f);
|
||||
int permission = (peaks || !alpha ? HydrologySampleBuffer.ALLOW_STREAMS : 0) | (meadow ? 0 : HydrologySampleBuffer.ALLOW_PONDS);
|
||||
assertEquals(at, permission, samples.permission()[index]);
|
||||
String fluid = peaks ? "lava" : alpha ? "water" : null;
|
||||
assertEquals(at, fluid, samples.fluidProfile()[index]);
|
||||
assertEquals(at, fluid, source.channelFluid(column[0], column[1]));
|
||||
}
|
||||
|
||||
private Path childPack(String gladeExtra) throws Exception {
|
||||
Path pack = EngineFixture.pack(temporaryFolder.newFolder().toPath(), false);
|
||||
EngineFixture.extend(pack, "peaks", ",\"hydrologyPolicy\":{\"pondDensity\":5,\"streams\":\"ALLOW\",\"fluid\":\"lava\"}");
|
||||
EngineFixture.extend(pack, "meadow", ",\"children\":[\"glade\"],\"childShrinkFactor\":2.5");
|
||||
EngineFixture.biome(pack, "glade", "[{\"generator\":\"plain\",\"min\":4,\"max\":10}]", gladeExtra);
|
||||
return pack;
|
||||
}
|
||||
|
||||
private static int[][] childGrid() {
|
||||
int side = 96;
|
||||
int[][] grid = new int[2][side * side];
|
||||
for (int index = 0; index < side * side; index++) {
|
||||
grid[0][index] = (index % side) * 9 - 432;
|
||||
grid[1][index] = (index / side) * 9 - 432;
|
||||
}
|
||||
return grid;
|
||||
}
|
||||
|
||||
private static HydrologySettings lavaSettings(EngineFixture fixture) {
|
||||
IrisHydrology config = new IrisHydrology().setEnabled(true).setPersist(false);
|
||||
config.getFluids().add(new IrisFluidProfile().setName("lava").setPalette(new IrisMaterialPalette().qclear().qadd("minecraft:lava")));
|
||||
return HydrologySettings.compile(config, EngineFixture.SEED, fixture.dimension.getFluidHeight(), 0, EngineFixture.HEIGHT);
|
||||
}
|
||||
|
||||
private static IrisBiome root(EngineFixture fixture, int x, int z) {
|
||||
boolean sea = fixture.complex.getBridgeStream().get(x, z) == InferredType.SEA;
|
||||
return (sea ? fixture.complex.getSeaBiomeStream() : fixture.complex.getLandBiomeStream()).get(x, z);
|
||||
}
|
||||
|
||||
private static String chain(EngineFixture fixture, int x, int z) {
|
||||
IrisBiome leaf = fixture.complex.getBaseBiomeStream().get(x, z);
|
||||
boolean sea = fixture.complex.getBridgeStream().get(x, z) == InferredType.SEA;
|
||||
IrisBiome root = (sea ? fixture.complex.getSeaBiomeStream() : fixture.complex.getLandBiomeStream()).get(x, z);
|
||||
IrisBiome root = root(fixture, x, z);
|
||||
String pair = root.getLoadKey() + ">" + leaf.getLoadKey();
|
||||
return switch (pair) {
|
||||
case "peaks>meadow" -> "meadow<peaks";
|
||||
|
||||
+26
-1
@@ -31,6 +31,7 @@ import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertFalse;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.junit.Assert.assertThrows;
|
||||
@@ -189,7 +190,31 @@ public class IrisComplexSurfaceBiomeTest {
|
||||
ShorePolicyPack pack = new ShorePolicyPack();
|
||||
pack.region.setHydrologyPolicy(new IrisHydrologyPolicy().setShoreBiomes(new KList<>("ghost")));
|
||||
IllegalStateException failure = assertThrows(IllegalStateException.class, () -> shoreSelect(pack, 1));
|
||||
assertTrue(failure.getMessage(), failure.getMessage().contains("'ghost'") && failure.getMessage().contains("coast"));
|
||||
assertTrue(failure.getMessage(), failure.getMessage().contains("'ghost' listed by region coast for biome plain in region coast"));
|
||||
IrisBiome parent = pack.biome("highland");
|
||||
parent.setHydrologyPolicy(new IrisHydrologyPolicy().setShoreBiomes(new KList<>("phantom")));
|
||||
failure = assertThrows(IllegalStateException.class, () -> shoreSelect(pack, List.of(pack.inland, parent), 1));
|
||||
assertTrue(failure.getMessage(), failure.getMessage().contains("'phantom' listed by biome highland for biome plain in region coast"));
|
||||
pack.region.setHydrologyPolicy(null);
|
||||
pack.dimension.getHydrologyPolicy().setShoreBiomes(new KList<>("wraith"));
|
||||
failure = assertThrows(IllegalStateException.class, () -> shoreSelect(pack, 1));
|
||||
assertTrue(failure.getMessage(), failure.getMessage().contains("'wraith' listed by dimension "));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shoreBandsNeedAPositiveWidthAtSomeScope() {
|
||||
IrisDimension dimension = new IrisDimension().setHydrologyPolicy(new IrisHydrologyPolicy().setShoreBiomes(new KList<>("dune")));
|
||||
IrisRegion region = new IrisRegion().setHydrologyPolicy(new IrisHydrologyPolicy().setShoreBiomeWidth(0));
|
||||
IrisBiome biome = new IrisBiome();
|
||||
assertFalse(HydrologyShoreBiomes.banded(dimension, List.of(region), List.of(biome)));
|
||||
biome.setHydrologyPolicy(new IrisHydrologyPolicy().setShoreBiomeWidth(3));
|
||||
assertTrue(HydrologyShoreBiomes.banded(dimension, List.of(region), List.of(biome)));
|
||||
biome.setHydrologyPolicy(null);
|
||||
region.getHydrologyPolicy().setShoreBiomeWidth(2);
|
||||
assertTrue(HydrologyShoreBiomes.banded(dimension, List.of(region), List.of(biome)));
|
||||
region.setHydrologyPolicy(null);
|
||||
dimension.getHydrologyPolicy().setShoreBiomeWidth(1);
|
||||
assertTrue(HydrologyShoreBiomes.banded(dimension, List.of(region), List.of(biome)));
|
||||
}
|
||||
|
||||
private static IrisBiome shoreSelect(ShorePolicyPack pack, int distance) {
|
||||
|
||||
Reference in new issue
Block a user