mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 00:34:19 +00:00
Host side and tests for ported terrain: batched state writes, surface biome id, the layers and palettes live in the exposed package, tests on the API
This commit is contained in:
1 parent
6c08f545df
commit
b6926d4ba4
20 files changed
+472
-290
No files matched your search
+5
-2
@@ -37,7 +37,9 @@ import art.arcane.iris.core.structure.StructureImporter;
|
||||
import art.arcane.iris.core.tools.IrisToolbelt;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.terrain.BiomeLayers;
|
||||
import art.arcane.iris.builtin.terrain.LayerLoad;
|
||||
import art.arcane.iris.builtin.terrain.LayersSettings;
|
||||
import art.arcane.iris.core.modules.IrisValues;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.platform.BukkitEntitySpawner;
|
||||
import art.arcane.iris.engine.object.terrain.IrisGenerator;
|
||||
@@ -554,7 +556,8 @@ public class CommandStudio implements DirectorExecutor {
|
||||
double score = 0;
|
||||
|
||||
int m = 0;
|
||||
for (NoiseStyle layerStyle : BiomeLayers.layerStyles(b)) {
|
||||
for (NoiseStyle layerStyle : LayerLoad.layersOf(b.getModuleSettings().find(LayersSettings.class).orElse(null)).stream()
|
||||
.map(layer -> IrisValues.generatorStyle(layer.style()).getStyle()).toList()) {
|
||||
m++;
|
||||
score += styleTimings.get(layerStyle);
|
||||
vv.add("Palette Layer " + m + ": " + styleTimings.get(layerStyle));
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
package art.arcane.iris.core.modules;
|
||||
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.actuator.TerrainModule;
|
||||
import art.arcane.iris.engine.loot.LootModule;
|
||||
import art.arcane.iris.engine.mantle.components.ObjectModule;
|
||||
import art.arcane.iris.engine.spawn.SpawnModule;
|
||||
@@ -61,7 +60,7 @@ public final class IrisModuleHost {
|
||||
* {@code IrisModule/builtin-modules.txt}) instead of being compiled into Iris. A pack loads them from its {@code modules}
|
||||
* folder, and {@link MissingBuiltInModules} warns when it loads none; a test keeps this equal to the jar's list.
|
||||
*/
|
||||
public static final List<String> JAR_MODULE_IDS = List.of("iris:post", "iris:perfection", "iris:matter", "iris:deposit", "iris:decorant");
|
||||
public static final List<String> JAR_MODULE_IDS = List.of("iris:post", "iris:perfection", "iris:matter", "iris:deposit", "iris:decorant", "iris:terrain");
|
||||
/** Iris's pack object model: built-in settings may hold these classes, which Iris reads and describes itself. */
|
||||
public static final String HOST_TYPE_PACKAGE = "art.arcane.iris.engine.object";
|
||||
private static final String[] JAR_COPY_FOLDER = {"cache", "module-jars"};
|
||||
@@ -85,7 +84,7 @@ public final class IrisModuleHost {
|
||||
}
|
||||
|
||||
private static List<IrisModule> generationModules() {
|
||||
return List.of(new TerrainModule(), new CarveModule(), new ObjectModule(), new StructureModule(),
|
||||
return List.of(new CarveModule(), new ObjectModule(), new StructureModule(),
|
||||
new FloatingModule(), new LootModule(), new SpawnModule());
|
||||
}
|
||||
|
||||
|
||||
@@ -26,6 +26,7 @@ import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.common.data.B;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.mantle.BlockBox;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.world.BiomeKind;
|
||||
import com.volmit.world.BiomeSample;
|
||||
import com.volmit.world.TerrainSample;
|
||||
@@ -104,6 +105,12 @@ final class IrisTerrainSampler implements TerrainSampler {
|
||||
cave.map(biome -> ids.of(biome.getLoadKey())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceId surfaceBiome(int worldX, int worldZ) {
|
||||
requireInside(worldX, bounds.minY(), worldZ);
|
||||
return ids.of(engine.getSurfaceBiome(worldX, worldZ).getLoadKey());
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fluidHeight() {
|
||||
return engine.getDimension().getFluidHeight();
|
||||
|
||||
@@ -49,6 +49,9 @@ public final class PlatformBlockStates {
|
||||
/** The state read last: scans over a chunk read long runs of one state, such as stone or air, so most reads hit it. */
|
||||
private PlatformBlockState lastRead;
|
||||
private BlockState lastReadAsApi;
|
||||
/** The state written last: a stage fills long runs of one block, such as rock, so most writes hit it. */
|
||||
private BlockState lastWritten;
|
||||
private PlatformBlockState lastWrittenAsPlatform;
|
||||
|
||||
/** {@code platformStates} turns a block state key into the platform's state, such as {@code B::getState}. */
|
||||
public PlatformBlockStates(Function<String, PlatformBlockState> platformStates) {
|
||||
@@ -82,11 +85,14 @@ public final class PlatformBlockStates {
|
||||
}
|
||||
|
||||
public PlatformBlockState toPlatform(BlockState state) {
|
||||
PlatformBlockState origin = origins.get(state);
|
||||
if (origin != null) {
|
||||
return origin;
|
||||
if (state == lastWritten) {
|
||||
return lastWrittenAsPlatform;
|
||||
}
|
||||
return written.computeIfAbsent(state, api -> platformStates.apply(api.key()));
|
||||
PlatformBlockState origin = origins.get(state);
|
||||
PlatformBlockState platform = origin != null ? origin : written.computeIfAbsent(state, api -> platformStates.apply(api.key()));
|
||||
lastWritten = state;
|
||||
lastWrittenAsPlatform = platform;
|
||||
return platform;
|
||||
}
|
||||
|
||||
/** {@code key} with Minecraft's namespace when it names none, as Minecraft reads such keys. */
|
||||
|
||||
@@ -37,7 +37,8 @@ final class StageMetrics implements StageTimings {
|
||||
"iris:post/smooth", EngineMetrics::getPost,
|
||||
"iris:perfection/surface", EngineMetrics::getPerfection,
|
||||
"iris:deposit/ores", EngineMetrics::getDeposit,
|
||||
"iris:decorant/decorate", EngineMetrics::getDecoration);
|
||||
"iris:decorant/decorate", EngineMetrics::getDecoration,
|
||||
"iris:terrain/shape", EngineMetrics::getTerrain);
|
||||
|
||||
private final EngineMetrics metrics;
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
package art.arcane.iris.engine.mantle;
|
||||
|
||||
|
||||
import art.arcane.iris.builtin.terrain.BedrockSettings;
|
||||
import art.arcane.iris.engine.object.noise.IrisGeneratorStyle;
|
||||
import art.arcane.iris.spi.IrisLogging;
|
||||
import art.arcane.iris.util.project.matter.TileWrapper;
|
||||
@@ -198,7 +199,7 @@ public class MantleWriter implements IObjectPlacer, AutoCloseable {
|
||||
return;
|
||||
}
|
||||
|
||||
if (y == 0 && t instanceof PlatformBlockState && engineMantle.getEngine().getDimension().isBedrock()) {
|
||||
if (y == 0 && t instanceof PlatformBlockState && engineMantle.getEngine().getDimension().getModuleSettings().find(BedrockSettings.class).map(BedrockSettings::bedrock).orElse(true)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.SeedManager;
|
||||
import art.arcane.iris.engine.actuator.DecorantModule;
|
||||
import art.arcane.iris.engine.actuator.TerrainModule;
|
||||
import art.arcane.iris.engine.modifier.DepositModule;
|
||||
import art.arcane.iris.engine.modifier.MatterModule;
|
||||
import art.arcane.iris.engine.modifier.PerfectionModule;
|
||||
@@ -53,7 +54,7 @@ public final class BuiltInPack {
|
||||
* with Iris; {@code BuiltInModulesJarTest} loads the same modules from the jar instead.
|
||||
*/
|
||||
public static List<IrisModule> jarModules() {
|
||||
return List.of(new PostModule(), new PerfectionModule(), new MatterModule(), new DepositModule(), new DecorantModule());
|
||||
return List.of(new PostModule(), new PerfectionModule(), new MatterModule(), new DepositModule(), new DecorantModule(), new TerrainModule());
|
||||
}
|
||||
|
||||
/** Every built-in module: Iris's own and the compiled-in copies of the jar's ({@link #jarModules()}). */
|
||||
|
||||
@@ -128,6 +128,23 @@ public class IrisValuesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void theIrisStyleIsTheSignatureNoiseOfTheSeedThatSetsTheThicknessOfBiomeLayers() {
|
||||
IrisNoiseFactory factory = new IrisNoiseFactory(packWithoutCustomBlocks());
|
||||
long mismatches = 0;
|
||||
for (long seed : new long[]{1, 7235, -3999281L, 1337L * 31, 987654321987L}) {
|
||||
CNG signature = CNG.signature(new RNG(seed));
|
||||
NoiseSampler sampler = factory.sampler(NoiseStyle.of("IRIS"), seed);
|
||||
for (int x = -2000; x < 2000; x += 7) {
|
||||
for (int z = -1000; z < 1000; z += 11) {
|
||||
double zoom = 5;
|
||||
mismatches += signature.noiseFast2D(x / zoom, z / zoom) == sampler.sample(x / zoom, z / zoom) ? 0 : 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
assertEquals(0, mismatches);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aStyleNameIrisDoesNotKnowIsFlat() {
|
||||
IrisData data = packWithoutCustomBlocks();
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
package art.arcane.iris.engine.actuator;
|
||||
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.SeedManager;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.world.region.IrisRegion;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.iris.builtin.terrain.OreSettings;
|
||||
import art.arcane.iris.engine.modifier.ApiChunk;
|
||||
import art.arcane.iris.engine.terrain.TestPackWorld;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.PackSettings;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -26,28 +28,36 @@ public class OreWarmUpTest {
|
||||
|
||||
@Test
|
||||
public void biomesByKeyThenRegionsByKeyThenTheDimensionWarmWithConsecutiveSeedsOfTheWorld() {
|
||||
SeedManager seeds = mock(SeedManager.class);
|
||||
when(seeds.getComponent()).thenReturn(COMPONENT_SEED);
|
||||
IrisDimension dimension = mock(IrisDimension.class);
|
||||
Engine engine = mock(Engine.class);
|
||||
when(engine.getSeedManager()).thenReturn(seeds);
|
||||
when(engine.getDimension()).thenReturn(dimension);
|
||||
TerrainOres ores = mock(TerrainOres.class);
|
||||
IrisBiome biomeB = biome("b", ores, "b0", "b1");
|
||||
IrisBiome biomeA = biome("a", ores, "a0");
|
||||
IrisRegion regionY = region("y", ores, "y0");
|
||||
IrisRegion regionX = region("x", ores, "x0", "x1");
|
||||
ResolvedOres dimensionOres = resolved("d0");
|
||||
when(ores.of(dimension)).thenReturn(dimensionOres);
|
||||
when(engine.getAllBiomes()).thenReturn(new KList<>(List.of(biomeB, biomeA)));
|
||||
when(dimension.getAllRegions(engine)).thenReturn(new KList<>(List.of(regionY, regionX)));
|
||||
List<Entry<OreSettings>> declared = new ArrayList<>();
|
||||
// The pack lists the dimension first, then regions and biomes, in no particular order.
|
||||
declared.add(entry(Target.DIMENSION, "dimension/overworld", ores, "d0"));
|
||||
declared.add(entry(Target.REGION, "region/y", ores, "y0"));
|
||||
declared.add(entry(Target.BIOME, "biome/b", ores, "b0", "b1"));
|
||||
declared.add(entry(Target.REGION, "region/x", ores, "x0", "x1"));
|
||||
declared.add(entry(Target.BIOME, "biome/a", ores, "a0"));
|
||||
PackSettings settings = new PackSettings() {
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <F extends IrisFeature> List<Entry<F>> declared(Class<F> featureType) {
|
||||
return (List<Entry<F>>) (List<?>) declared;
|
||||
}
|
||||
};
|
||||
TestPackWorld world = new TestPackWorld(new ApiChunk(0, 0, 16).resources(), settings, COMPONENT_SEED);
|
||||
|
||||
new OreWarmUp(engine, ores).warm();
|
||||
new OreWarmUp(world, ores).warm();
|
||||
|
||||
assertEquals(List.of("a0@" + ROOT_SEED, "b0@" + (ROOT_SEED + 1), "b1@" + (ROOT_SEED + 2),
|
||||
"x0@" + (ROOT_SEED + 3), "x1@" + (ROOT_SEED + 4), "y0@" + (ROOT_SEED + 5), "d0@" + (ROOT_SEED + 6)), warmed);
|
||||
}
|
||||
|
||||
private Entry<OreSettings> entry(Target level, String source, TerrainOres ores, String... oreNames) {
|
||||
OreSettings settings = new OreSettings(List.of());
|
||||
ResolvedOres declared = resolved(oreNames);
|
||||
when(ores.of(settings)).thenReturn(declared);
|
||||
return new Entry<>(level, ResourceId.parse("test:" + source), settings);
|
||||
}
|
||||
|
||||
private ResolvedOres resolved(String... names) {
|
||||
List<ResolvedOre> ores = new ArrayList<>();
|
||||
for (String name : names) {
|
||||
@@ -57,20 +67,4 @@ public class OreWarmUpTest {
|
||||
}
|
||||
return new ResolvedOres(ores);
|
||||
}
|
||||
|
||||
private IrisBiome biome(String key, TerrainOres ores, String... oreNames) {
|
||||
IrisBiome biome = mock(IrisBiome.class);
|
||||
when(biome.getLoadKey()).thenReturn(key);
|
||||
ResolvedOres declared = resolved(oreNames);
|
||||
when(ores.of(biome)).thenReturn(declared);
|
||||
return biome;
|
||||
}
|
||||
|
||||
private IrisRegion region(String key, TerrainOres ores, String... oreNames) {
|
||||
IrisRegion region = mock(IrisRegion.class);
|
||||
when(region.getLoadKey()).thenReturn(key);
|
||||
ResolvedOres declared = resolved(oreNames);
|
||||
when(ores.of(region)).thenReturn(declared);
|
||||
return region;
|
||||
}
|
||||
}
|
||||
@@ -5,16 +5,16 @@ import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.loader.ResourceLoader;
|
||||
import art.arcane.iris.core.modules.IrisPackResources;
|
||||
import art.arcane.iris.engine.UsableBlockPlatform;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.SeedManager;
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import com.google.gson.Gson;
|
||||
import com.volmit.block.BlockState;
|
||||
import com.volmit.noise.NoiseSampler;
|
||||
import com.volmit.resource.PackResources;
|
||||
import org.junit.After;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.io.File;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -48,15 +48,15 @@ public class ResolvedOreTest {
|
||||
@Test
|
||||
public void everyOreGeneratesAsIrisOreGeneratorDid() {
|
||||
UsableBlockPlatform.bind();
|
||||
Engine engine = engine();
|
||||
PackResources resources = resources();
|
||||
StringBuilder transcript = new StringBuilder();
|
||||
for (String json : ORES) {
|
||||
ResolvedOre ore = ResolvedOre.of(new Gson().fromJson(json, OreGenerator.class), engine);
|
||||
ResolvedOre ore = ResolvedOre.of(new Gson().fromJson(json, OreGenerator.class), resources, TERRAIN_SEED);
|
||||
ore.warm(WARM_SEED);
|
||||
for (int x = -30; x < 30; x += 3) {
|
||||
for (int z = -30; z < 30; z += 4) {
|
||||
for (int y = -20; y < 70; y += 5) {
|
||||
PlatformBlockState state = ore.generate(x, y, z);
|
||||
BlockState state = ore.generate(x, y, z);
|
||||
transcript.append(state == null ? "-" : state.key()).append(';');
|
||||
}
|
||||
}
|
||||
@@ -71,13 +71,12 @@ public class ResolvedOreTest {
|
||||
|
||||
@Test
|
||||
public void theNoiseKeepsTheFirstSeedItIsBuiltFrom() {
|
||||
UsableBlockPlatform.bind();
|
||||
OreGenerator settings = new Gson().fromJson(ORES[1], OreGenerator.class);
|
||||
List<Long> seeds = new ArrayList<>();
|
||||
ResolvedOre ore = new ResolvedOre(settings, (style, seed) -> {
|
||||
seeds.add(seed);
|
||||
return constant(0);
|
||||
}, null, TERRAIN_SEED, List.of(UsableBlockPlatform.block("iron_ore")));
|
||||
}, null, TERRAIN_SEED, List.of(new BlockState("minecraft:iron_ore")));
|
||||
|
||||
ore.warm(WARM_SEED);
|
||||
ore.warm(WARM_SEED + 1);
|
||||
@@ -88,13 +87,12 @@ public class ResolvedOreTest {
|
||||
|
||||
@Test
|
||||
public void anOreNothingWarmedBuildsItsNoiseFromTheTerrainSeed() {
|
||||
UsableBlockPlatform.bind();
|
||||
OreGenerator settings = new Gson().fromJson(ORES[1], OreGenerator.class);
|
||||
List<Long> seeds = new ArrayList<>();
|
||||
ResolvedOre ore = new ResolvedOre(settings, (style, seed) -> {
|
||||
seeds.add(seed);
|
||||
return constant(0);
|
||||
}, null, TERRAIN_SEED, List.of(UsableBlockPlatform.block("iron_ore")));
|
||||
}, null, TERRAIN_SEED, List.of(new BlockState("minecraft:iron_ore")));
|
||||
|
||||
ore.generate(0, 0, 0);
|
||||
ore.generate(1, 1, 1);
|
||||
@@ -104,8 +102,7 @@ public class ResolvedOreTest {
|
||||
|
||||
@Test
|
||||
public void nothingGeneratesOutsideTheBandOrWithAnEmptyPaletteOrAboveTheThreshold() {
|
||||
UsableBlockPlatform.bind();
|
||||
PlatformBlockState iron = UsableBlockPlatform.block("iron_ore");
|
||||
BlockState iron = new BlockState("minecraft:iron_ore");
|
||||
OreGenerator settings = new Gson().fromJson(ORES[1], OreGenerator.class);
|
||||
ResolvedOre atThreshold = new ResolvedOre(settings, (style, seed) -> constant(0.5), null, TERRAIN_SEED, List.of(iron));
|
||||
ResolvedOre aboveThreshold = new ResolvedOre(settings, (style, seed) -> constant(0.51), null, TERRAIN_SEED, List.of(iron));
|
||||
@@ -148,7 +145,7 @@ public class ResolvedOreTest {
|
||||
};
|
||||
}
|
||||
|
||||
private static Engine engine() {
|
||||
private static PackResources resources() {
|
||||
IrisData data = mock(IrisData.class);
|
||||
@SuppressWarnings("unchecked")
|
||||
ResourceLoader<IrisBlockData> blocks = mock(ResourceLoader.class);
|
||||
@@ -156,11 +153,6 @@ public class ResolvedOreTest {
|
||||
when(data.getDataFolder()).thenReturn(new File("pack"));
|
||||
IrisPackResources resources = new IrisPackResources(data);
|
||||
when(data.getPackResources()).thenReturn(resources);
|
||||
SeedManager seeds = mock(SeedManager.class);
|
||||
when(seeds.getTerrain()).thenReturn(TERRAIN_SEED);
|
||||
Engine engine = mock(Engine.class);
|
||||
when(engine.getData()).thenReturn(data);
|
||||
when(engine.getSeedManager()).thenReturn(seeds);
|
||||
return engine;
|
||||
return resources;
|
||||
}
|
||||
}
|
||||
@@ -3,19 +3,20 @@ package art.arcane.iris.engine.actuator;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.loader.ResourceLoader;
|
||||
import art.arcane.iris.core.modules.IrisPackResources;
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.UsableBlockPlatform;
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
import art.arcane.iris.builtin.terrain.PaletteLayer;
|
||||
import art.arcane.iris.builtin.terrain.SlabSettings;
|
||||
import art.arcane.iris.engine.terrain.BiomeLayers;
|
||||
import art.arcane.iris.engine.terrain.TestLayerBlocks;
|
||||
import art.arcane.iris.engine.terrain.ResolvedLayer;
|
||||
import art.arcane.iris.builtin.terrain.BiomeLayers;
|
||||
import art.arcane.iris.builtin.terrain.ColumnSlope;
|
||||
import art.arcane.iris.builtin.terrain.LayeredBiome;
|
||||
import art.arcane.iris.builtin.terrain.PaletteExplosion;
|
||||
import art.arcane.iris.builtin.terrain.ResolvedLayer;
|
||||
import art.arcane.iris.engine.terrain.TerrainTestSettings;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.project.stream.ProceduralStream;
|
||||
import art.arcane.iris.engine.terrain.TestLayerBlocks;
|
||||
import art.arcane.iris.engine.terrain.TestLayeredBiomes;
|
||||
import com.volmit.block.BlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.volmit.host.ModuleLogs;
|
||||
@@ -86,7 +87,7 @@ public class TerrainLayersPinTest {
|
||||
private static final String[] BIOMES = {MESA, MEADOW, OCEAN, DEFAULTS};
|
||||
|
||||
private IrisData data;
|
||||
private IrisComplex complex;
|
||||
private final ColumnSlope slope = (x, z) -> Math.abs((x * 3 + z * 5) % 11);
|
||||
|
||||
@Before
|
||||
public void bindPlatform() {
|
||||
@@ -98,8 +99,6 @@ public class TerrainLayersPinTest {
|
||||
when(data.getDataFolder()).thenReturn(new File("pack"));
|
||||
IrisPackResources resources = new IrisPackResources(data);
|
||||
when(data.getPackResources()).thenReturn(resources);
|
||||
complex = mock(IrisComplex.class);
|
||||
when(complex.getSlopeStream()).thenReturn(ProceduralStream.ofDouble((x, z) -> Math.abs((x * 3 + z * 5) % 11)));
|
||||
}
|
||||
|
||||
private static final PaletteLayer NO_LAYER = PaletteLayer.withoutBlocks();
|
||||
@@ -126,44 +125,42 @@ public class TerrainLayersPinTest {
|
||||
}
|
||||
|
||||
private void record(StringBuilder transcript, String biomeJson, boolean exploded) {
|
||||
IrisDimension dimension = new IrisDimension();
|
||||
dimension.setExplodeBiomePalettes(exploded);
|
||||
dimension.setExplodeBiomePaletteSize(2);
|
||||
PaletteExplosion explosion = new PaletteExplosion(exploded, 2);
|
||||
RNG rng = new RNG(TERRAIN_SEED);
|
||||
IrisBiome biome = new IrisBiome();
|
||||
biome.setModuleSettings(TerrainTestSettings.of(biomeJson));
|
||||
BiomeLayers layers = new BiomeLayers(TestLayerBlocks.of(data.getPackResources()), ModuleLogs.discarding());
|
||||
ModuleSettings settings = TerrainTestSettings.of(biomeJson);
|
||||
LayeredBiome biome = TestLayeredBiomes.of(settings);
|
||||
BiomeLayers layers = new BiomeLayers(TestLayerBlocks.of(data.getPackResources()), () -> data.getPackResources().noise(), ModuleLogs.discarding());
|
||||
for (int x = -COLUMN_RANGE; x < COLUMN_RANGE; x += COLUMN_STEP_X) {
|
||||
for (int z = -COLUMN_RANGE; z < COLUMN_RANGE; z += COLUMN_STEP_Z) {
|
||||
transcript.append('|').append(keys(layers.generateLayers(biome, dimension, x, z, rng, 14, 70 + Math.floorMod(x + z, 9), data, complex)));
|
||||
transcript.append('|').append(keys(layers.generateCeilingLayers(biome, dimension, x, z, rng, 12, 40, data, complex)));
|
||||
transcript.append('|').append(keys(layers.generateSeaLayers(biome, x, z, rng, 7, data)));
|
||||
transcript.append('|').append(smoothing(layers, biome, rng, x, z));
|
||||
transcript.append('|').append(keys(layers.generateLayers(biome, explosion, x, z, rng, 14, 70 + Math.floorMod(x + z, 9), slope)));
|
||||
transcript.append('|').append(keys(layers.generateCeilingLayers(biome, explosion, x, z, rng, 12)));
|
||||
transcript.append('|').append(keys(layers.generateSeaLayers(biome, x, z, rng, 7)));
|
||||
transcript.append('|').append(smoothing(layers, settings, biome, rng, x, z));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** The block a slab and a wall place in post processing at the column, as the smoothing stage asks the biome. */
|
||||
private String smoothing(BiomeLayers layers, IrisBiome biome, RNG rng, int x, int z) {
|
||||
private String smoothing(BiomeLayers layers, ModuleSettings settings, LayeredBiome biome, RNG rng, int x, int z) {
|
||||
int height = 60 + Math.floorMod(x - z, 7);
|
||||
double slope = complex.getSlopeStream().get(x, z);
|
||||
ResolvedLayer slabLayer = layers.resolve(biome.getModuleSettings().find(SlabSettings.class).map(SlabSettings::layer).orElse(NO_LAYER));
|
||||
double columnSlope = slope.at(x, z);
|
||||
ResolvedLayer slabLayer = layers.resolve(settings.find(SlabSettings.class).map(SlabSettings::layer).orElse(NO_LAYER));
|
||||
ResolvedLayer wallLayer = layers.wall(biome);
|
||||
String slab = slabLayer.slopeCondition().isValid(slope) ? key(slabLayer.get(rng, x, height, z)) : "-";
|
||||
String slab = slabLayer.slopeCondition().isValid(columnSlope) ? key(slabLayer.get(rng, x, height, z)) : "-";
|
||||
String wall = !wallLayer.hasPalette() ? "-" : key(wallLayer.get(rng, x + height, height + height, z + height));
|
||||
return slab + "," + wall;
|
||||
}
|
||||
|
||||
private static String keys(KList<PlatformBlockState> states) {
|
||||
private static String keys(KList<BlockState> states) {
|
||||
StringBuilder keys = new StringBuilder();
|
||||
for (PlatformBlockState state : states) {
|
||||
for (BlockState state : states) {
|
||||
keys.append(key(state)).append(' ');
|
||||
}
|
||||
return keys.toString();
|
||||
}
|
||||
|
||||
/** The block's key without its namespace and with its properties in name order, which is how the platform identifies a state whatever order a pack lists them in. */
|
||||
private static String key(PlatformBlockState state) {
|
||||
private static String key(BlockState state) {
|
||||
if (state == null) {
|
||||
return "null";
|
||||
}
|
||||
|
||||
@@ -1,165 +1,107 @@
|
||||
package art.arcane.iris.engine.actuator;
|
||||
|
||||
import art.arcane.iris.engine.IrisComplex;
|
||||
import art.arcane.iris.engine.UsableBlockPlatform;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.EngineMetrics;
|
||||
import art.arcane.iris.engine.framework.SeedManager;
|
||||
import art.arcane.iris.engine.image.IrisImageMapRuntime;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.object.world.region.IrisRegion;
|
||||
import art.arcane.iris.engine.terrain.BiomeLayers;
|
||||
import art.arcane.iris.engine.terrain.TerrainPalettes;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import art.arcane.iris.util.project.context.ChunkContext;
|
||||
import art.arcane.iris.util.project.context.ChunkedDataCache;
|
||||
import art.arcane.iris.util.project.hunk.Hunk;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import art.arcane.iris.builtin.terrain.BedrockSettings;
|
||||
import art.arcane.iris.builtin.terrain.HideOresSettings;
|
||||
import art.arcane.iris.core.modules.BuiltInPack;
|
||||
import org.junit.After;
|
||||
import art.arcane.iris.builtin.terrain.LayersSettings;
|
||||
import art.arcane.iris.builtin.terrain.OreSettings;
|
||||
import art.arcane.iris.engine.modifier.ApiChunk;
|
||||
import art.arcane.iris.engine.object.TestSettings;
|
||||
import com.volmit.block.BlockState;
|
||||
import org.junit.Test;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import static org.junit.Assert.assertNotNull;
|
||||
import static org.junit.Assert.assertNotSame;
|
||||
import static org.junit.Assert.assertNull;
|
||||
import static org.junit.Assert.assertSame;
|
||||
import static org.mockito.ArgumentMatchers.any;
|
||||
import static org.mockito.ArgumentMatchers.anyDouble;
|
||||
import static org.mockito.ArgumentMatchers.anyInt;
|
||||
import static org.mockito.ArgumentMatchers.eq;
|
||||
import static org.mockito.Mockito.mock;
|
||||
import static org.mockito.Mockito.when;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertNotEquals;
|
||||
|
||||
/** Terrain fills a column from bedrock to its height with the biome's layers over rock, and the fluid above it up to the fluid height. */
|
||||
public class TerrainModuleTest {
|
||||
private static final int HEIGHT = 20;
|
||||
private static final int FLUID_HEIGHT = 25;
|
||||
|
||||
private final PlatformBlockState grass = mock(PlatformBlockState.class);
|
||||
private final PlatformBlockState dirt = mock(PlatformBlockState.class);
|
||||
private final PlatformBlockState rock = mock(PlatformBlockState.class);
|
||||
private final PlatformBlockState water = mock(PlatformBlockState.class);
|
||||
|
||||
@After
|
||||
public void unbindPlatform() {
|
||||
UsableBlockPlatform.unbind();
|
||||
}
|
||||
private static final int WORLD_HEIGHT = 64;
|
||||
private static final BlockState GRASS = new BlockState("minecraft:grass_block");
|
||||
private static final BlockState DIRT = new BlockState("minecraft:dirt");
|
||||
private static final BlockState STONE = new BlockState("minecraft:stone");
|
||||
private static final BlockState WATER = new BlockState("minecraft:water");
|
||||
private static final BlockState BEDROCK = new BlockState("minecraft:bedrock");
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void aColumnIsBedrockThenRockThenLayersThenFluid() {
|
||||
UsableBlockPlatform.bind();
|
||||
IrisBiome biome = mock(IrisBiome.class);
|
||||
TerrainModule.TerrainShaper shaper = new TerrainModule.TerrainShaper(engine(true), palettes(), layersOf(biome), mock(TerrainOres.class));
|
||||
Hunk<PlatformBlockState> blocks = Hunk.newArrayHunk(16, 64, 16);
|
||||
ApiChunk chunk = world().biomeSettings(TestSettings.of(LayersSettings.class,
|
||||
"{\"layers\": [{\"palette\": [{\"block\": \"grass_block\"}]}, {\"palette\": [{\"block\": \"dirt\"}]}]}"));
|
||||
|
||||
shaper.shape(0, 0, blocks, context(biome));
|
||||
chunk.generate(new TerrainModule());
|
||||
|
||||
PlatformBlockState floor = blocks.get(3, 0, 4);
|
||||
assertNotNull("bedrock at the bottom", floor);
|
||||
assertNotSame(rock, floor);
|
||||
assertSame("rock below the layers", rock, blocks.get(3, 5, 4));
|
||||
assertSame("the second layer", dirt, blocks.get(3, HEIGHT - 1, 4));
|
||||
assertSame("the first layer is the surface", grass, blocks.get(3, HEIGHT, 4));
|
||||
assertSame("fluid above the surface", water, blocks.get(3, HEIGHT + 1, 4));
|
||||
assertSame("fluid up to the fluid height", water, blocks.get(3, FLUID_HEIGHT, 4));
|
||||
assertNull("nothing above the fluid", blocks.get(3, FLUID_HEIGHT + 1, 4));
|
||||
assertEquals("bedrock at the bottom", BEDROCK, chunk.get(3, 0, 4));
|
||||
assertEquals("rock below the layers", STONE, chunk.get(3, 5, 4));
|
||||
assertEquals("the second layer", DIRT, chunk.get(3, HEIGHT - 1, 4));
|
||||
assertEquals("the first layer is the surface", GRASS, chunk.get(3, HEIGHT, 4));
|
||||
assertEquals("fluid above the surface", WATER, chunk.get(3, HEIGHT + 1, 4));
|
||||
assertEquals("fluid up to the fluid height", WATER, chunk.get(3, FLUID_HEIGHT, 4));
|
||||
assertEquals("nothing above the fluid", ApiChunk.AIR, chunk.get(3, FLUID_HEIGHT + 1, 4));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aBiomeWithoutLayersHasOneLayerOfGrass() {
|
||||
ApiChunk chunk = world();
|
||||
|
||||
chunk.generate(new TerrainModule());
|
||||
|
||||
assertEquals(GRASS, chunk.get(3, HEIGHT, 4));
|
||||
assertEquals(STONE, chunk.get(3, HEIGHT - 1, 4));
|
||||
}
|
||||
|
||||
@Test
|
||||
@SuppressWarnings("unchecked")
|
||||
public void oresOfTheBiomeThenTheRegionThenTheDimensionReplaceTheBlocksTheirBandsReach() {
|
||||
UsableBlockPlatform.bind();
|
||||
Engine engine = engine(false);
|
||||
IrisDimension dimension = engine.getDimension();
|
||||
IrisBiome biome = mock(IrisBiome.class);
|
||||
ChunkContext context = context(biome);
|
||||
IrisRegion region = context.getRegion().get(0, 0);
|
||||
PlatformBlockState biomeOre = mock(PlatformBlockState.class);
|
||||
PlatformBlockState regionOre = mock(PlatformBlockState.class);
|
||||
PlatformBlockState dimensionOre = mock(PlatformBlockState.class);
|
||||
TerrainOres ores = mock(TerrainOres.class);
|
||||
ResolvedOres biomeOres = oresAt(2, biomeOre);
|
||||
ResolvedOres regionOres = oresAt(2, regionOre, 3, regionOre);
|
||||
ResolvedOres dimensionOres = oresAt(2, dimensionOre, 3, dimensionOre, 4, dimensionOre);
|
||||
when(ores.of(biome)).thenReturn(biomeOres);
|
||||
when(ores.of(region)).thenReturn(regionOres);
|
||||
when(ores.of(dimension)).thenReturn(dimensionOres);
|
||||
Hunk<PlatformBlockState> blocks = Hunk.newArrayHunk(16, 64, 16);
|
||||
ApiChunk chunk = world()
|
||||
.biomeSettings(ores("coal_ore", 2, 2))
|
||||
.regionSettings(ores("iron_ore", 2, 3))
|
||||
.dimensionSettings(ores("gold_ore", 2, 4));
|
||||
|
||||
new TerrainModule.TerrainShaper(engine, palettes(), layersOf(biome, new KList<>()), ores).shape(0, 0, blocks, context);
|
||||
chunk.generate(new TerrainModule());
|
||||
|
||||
assertSame("the biome's ore comes first", biomeOre, blocks.get(3, 2, 4));
|
||||
assertSame("then the region's", regionOre, blocks.get(3, 3, 4));
|
||||
assertSame("then the dimension's", dimensionOre, blocks.get(3, 4, 4));
|
||||
assertSame("rock where no ore reaches", rock, blocks.get(3, 5, 4));
|
||||
assertEquals("the biome's ore comes first", new BlockState("minecraft:coal_ore"), chunk.get(3, 2, 4));
|
||||
assertEquals("then the region's", new BlockState("minecraft:iron_ore"), chunk.get(3, 3, 4));
|
||||
assertEquals("then the dimension's", new BlockState("minecraft:gold_ore"), chunk.get(3, 4, 4));
|
||||
assertEquals("rock where no ore reaches", STONE, chunk.get(3, 5, 4));
|
||||
}
|
||||
|
||||
/** Underground ores that give {@code block} at each listed height and nothing elsewhere. */
|
||||
private static ResolvedOres oresAt(Object... heightsAndBlocks) {
|
||||
ResolvedOre ore = mock(ResolvedOre.class);
|
||||
when(ore.generatesSurface()).thenReturn(false);
|
||||
when(ore.minY()).thenReturn(0D);
|
||||
when(ore.maxY()).thenReturn(10D);
|
||||
for (int index = 0; index < heightsAndBlocks.length; index += 2) {
|
||||
when(ore.generate(anyInt(), eq((int) heightsAndBlocks[index]), anyInt())).thenReturn((PlatformBlockState) heightsAndBlocks[index + 1]);
|
||||
}
|
||||
return new ResolvedOres(List.of(ore));
|
||||
@Test
|
||||
public void aDimensionThatHidesOresPlacesNone() {
|
||||
ApiChunk chunk = world().dimensionSettings(ores("gold_ore", 2, 4), new HideOresSettings(true));
|
||||
|
||||
chunk.generate(new TerrainModule());
|
||||
|
||||
assertEquals(STONE, chunk.get(3, 3, 4));
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
private ChunkContext context(IrisBiome biome) {
|
||||
ChunkedDataCache<IrisBiome> biomes = mock(ChunkedDataCache.class);
|
||||
when(biomes.get(anyInt(), anyInt())).thenReturn(biome);
|
||||
ChunkedDataCache<IrisRegion> regions = mock(ChunkedDataCache.class);
|
||||
when(regions.get(anyInt(), anyInt())).thenReturn(mock(IrisRegion.class));
|
||||
ChunkContext context = mock(ChunkContext.class);
|
||||
when(context.getBiome()).thenReturn(biomes);
|
||||
when(context.getRegion()).thenReturn(regions);
|
||||
when(context.getRoundedHeight(anyInt(), anyInt())).thenReturn(HEIGHT);
|
||||
return context;
|
||||
@Test
|
||||
public void aDimensionWithoutBedrockHasRockAtItsBottom() {
|
||||
ApiChunk chunk = world().dimensionSettings(TestSettings.of(BedrockSettings.class, "{\"bedrock\": false}"));
|
||||
|
||||
chunk.generate(new TerrainModule());
|
||||
|
||||
assertEquals(STONE, chunk.get(3, 0, 4));
|
||||
assertNotEquals(BEDROCK, chunk.get(0, 0, 0));
|
||||
}
|
||||
|
||||
private TerrainPalettes palettes() {
|
||||
TerrainPalettes palettes = mock(TerrainPalettes.class);
|
||||
when(palettes.rockAt(anyDouble(), anyDouble())).thenReturn(rock);
|
||||
when(palettes.fluidAt(anyDouble(), anyDouble())).thenReturn(water);
|
||||
return palettes;
|
||||
@Test
|
||||
public void aDimensionStackedOnItselfHangsItsGroundFromTheTop() {
|
||||
ApiChunk chunk = new ApiChunk(0, 0, WORLD_HEIGHT).surface((x, z) -> HEIGHT).upperDimension((x, z) -> 50).stackedOnItself();
|
||||
|
||||
chunk.generate(new TerrainModule());
|
||||
|
||||
assertEquals("bedrock caps the upper ground", BEDROCK, chunk.get(3, WORLD_HEIGHT - 1, 4));
|
||||
assertEquals("rock under the upper surface", STONE, chunk.get(3, 55, 4));
|
||||
assertEquals("the upper ground's face is the biome's layer", GRASS, chunk.get(3, 50, 4));
|
||||
assertEquals("nothing between the grounds", ApiChunk.AIR, chunk.get(3, 49, 4));
|
||||
}
|
||||
|
||||
private BiomeLayers layersOf(IrisBiome biome) {
|
||||
KList<PlatformBlockState> layers = new KList<>();
|
||||
layers.add(grass, dirt);
|
||||
return layersOf(biome, layers);
|
||||
private static ApiChunk world() {
|
||||
return new ApiChunk(0, 0, WORLD_HEIGHT).surface((x, z) -> HEIGHT).fluidHeight(FLUID_HEIGHT);
|
||||
}
|
||||
|
||||
private BiomeLayers layersOf(IrisBiome biome, KList<PlatformBlockState> layers) {
|
||||
BiomeLayers biomeLayers = mock(BiomeLayers.class);
|
||||
when(biomeLayers.generateLayers(eq(biome), any(), anyDouble(), anyDouble(), any(RNG.class), anyInt(), anyInt(), any(), any())).thenReturn(layers);
|
||||
when(biomeLayers.generateSeaLayers(eq(biome), anyDouble(), anyDouble(), any(RNG.class), anyInt(), any())).thenReturn(new KList<>());
|
||||
return biomeLayers;
|
||||
}
|
||||
|
||||
private Engine engine(boolean hidesOres) {
|
||||
IrisDimension dimension = mock(IrisDimension.class);
|
||||
when(dimension.getFluidHeight()).thenReturn(FLUID_HEIGHT);
|
||||
when(dimension.isBedrock()).thenReturn(true);
|
||||
when(dimension.getModuleSettings()).thenReturn(BuiltInPack.settings(new HideOresSettings(hidesOres)));
|
||||
IrisComplex complex = mock(IrisComplex.class);
|
||||
when(complex.getImageMapRuntime()).thenReturn(mock(IrisImageMapRuntime.class));
|
||||
SeedManager seeds = mock(SeedManager.class);
|
||||
when(seeds.getTerrain()).thenReturn(1337L);
|
||||
Engine engine = mock(Engine.class);
|
||||
when(engine.getDimension()).thenReturn(dimension);
|
||||
when(engine.getComplex()).thenReturn(complex);
|
||||
when(engine.getSeedManager()).thenReturn(seeds);
|
||||
when(engine.getMetrics()).thenReturn(new EngineMetrics(16));
|
||||
return engine;
|
||||
/** Ore generators of one block that give it at every height from {@code min} to {@code max}. */
|
||||
private static OreSettings ores(String block, int min, int max) {
|
||||
return TestSettings.of(OreSettings.class, "{\"generators\": [{\"palette\": {\"palette\": [{\"block\": \"" + block
|
||||
+ "\"}]}, \"chanceStyle\": {\"style\": \"STATIC\"}, \"threshold\": 0.5, \"range\": {\"min\": " + min + ", \"max\": " + max + "}}]}");
|
||||
}
|
||||
}
|
||||
@@ -3,15 +3,15 @@ package art.arcane.iris.engine.actuator;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.loader.ResourceLoader;
|
||||
import art.arcane.iris.core.modules.IrisPackResources;
|
||||
import art.arcane.iris.engine.UpperDimensionContext;
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
import art.arcane.iris.engine.UsableBlockPlatform;
|
||||
import art.arcane.iris.engine.decorator.DecoratorTestEngines;
|
||||
import art.arcane.iris.engine.framework.Engine;
|
||||
import art.arcane.iris.engine.framework.SeedManager;
|
||||
import art.arcane.iris.engine.object.material.IrisBlockData;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.engine.terrain.TerrainPalettes;
|
||||
import art.arcane.iris.builtin.terrain.TerrainPalettes;
|
||||
import art.arcane.iris.engine.terrain.TerrainTestSettings;
|
||||
import art.arcane.iris.engine.terrain.TestPackWorld;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.world.UpperDimension;
|
||||
import org.junit.After;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
@@ -72,9 +72,9 @@ public class TerrainPalettesPinTest {
|
||||
public void rockAndFluidPickAsTheyDidInTheComplex() {
|
||||
StringBuilder transcript = new StringBuilder();
|
||||
for (String json : List.of(STYLED, DEFAULTS, SINGLE)) {
|
||||
IrisDimension dimension = dimension(json);
|
||||
record(transcript, TerrainPalettes.of(engine(dimension, COMPLEX_SEED)));
|
||||
record(transcript, TerrainPalettes.of(engine(dimension, UPPER_DIMENSION_SEED)));
|
||||
ModuleSettings dimension = TerrainTestSettings.of(json);
|
||||
record(transcript, TerrainPalettes.of(world(dimension, COMPLEX_SEED)));
|
||||
record(transcript, TerrainPalettes.of(world(dimension, UPPER_DIMENSION_SEED)));
|
||||
}
|
||||
|
||||
for (String picked : List.of("granite", "andesite", "diorite", "tuff", "lava", "packed_ice", "netherrack")) {
|
||||
@@ -86,15 +86,10 @@ public class TerrainPalettesPinTest {
|
||||
|
||||
@Test
|
||||
public void anUpperDimensionPicksItsRockFromTheSeedItDerivesFromTheWorldsAndItsOwnKey() {
|
||||
IrisDimension upperDimension = dimension(STYLED);
|
||||
upperDimension.setLoadKey(UPPER_DIMENSION_KEY);
|
||||
UpperDimensionContext upper = mock(UpperDimensionContext.class);
|
||||
when(upper.isSelfReferencing()).thenReturn(false);
|
||||
when(upper.getDimension()).thenReturn(upperDimension);
|
||||
when(upper.getData()).thenReturn(data);
|
||||
TerrainPalettes world = TerrainPalettes.of(engine(dimension(DEFAULTS), COMPLEX_SEED));
|
||||
TerrainPalettes derived = TerrainPalettes.of(engine(upperDimension, UPPER_DIMENSION_SEED));
|
||||
|
||||
ModuleSettings upperDimension = TerrainTestSettings.of(STYLED);
|
||||
UpperDimension upper = upper(false, upperDimension);
|
||||
TerrainPalettes world = TerrainPalettes.of(world(TerrainTestSettings.of(DEFAULTS), COMPLEX_SEED));
|
||||
TerrainPalettes derived = TerrainPalettes.of(world(upperDimension, UPPER_DIMENSION_SEED));
|
||||
for (int x = -COLUMN_RANGE; x < COLUMN_RANGE; x += COLUMN_STEP_X) {
|
||||
for (int z = -COLUMN_RANGE; z < COLUMN_RANGE; z += COLUMN_STEP_Z) {
|
||||
assertEquals(derived.rockAt(x, z).key(), world.upperRockAt(upper, x, z).key());
|
||||
@@ -104,28 +99,43 @@ public class TerrainPalettesPinTest {
|
||||
|
||||
@Test
|
||||
public void aDimensionThatIsItsOwnUpperDimensionSharesItsRock() {
|
||||
TerrainPalettes world = TerrainPalettes.of(engine(dimension(STYLED), COMPLEX_SEED));
|
||||
UpperDimensionContext upper = mock(UpperDimensionContext.class);
|
||||
when(upper.isSelfReferencing()).thenReturn(true);
|
||||
|
||||
TerrainPalettes world = TerrainPalettes.of(world(TerrainTestSettings.of(STYLED), COMPLEX_SEED));
|
||||
UpperDimension upper = upper(true, TerrainTestSettings.of(DEFAULTS));
|
||||
assertEquals(world.rockAt(17, -90).key(), world.upperRockAt(upper, 17, -90).key());
|
||||
}
|
||||
|
||||
private IrisDimension dimension(String json) {
|
||||
IrisDimension dimension = new IrisDimension();
|
||||
dimension.setModuleSettings(TerrainTestSettings.of(json));
|
||||
return dimension;
|
||||
private TestPackWorld world(ModuleSettings dimension, long complexSeed) {
|
||||
return new TestPackWorld(data.getPackResources(), dimension, complexSeed);
|
||||
}
|
||||
|
||||
private Engine engine(IrisDimension dimension, long complexSeed) {
|
||||
SeedManager seeds = mock(SeedManager.class);
|
||||
when(seeds.getComplex()).thenReturn(complexSeed);
|
||||
Engine engine = mock(Engine.class);
|
||||
when(engine.getDimension()).thenReturn(dimension);
|
||||
when(engine.getData()).thenReturn(data);
|
||||
when(engine.getSeedManager()).thenReturn(seeds);
|
||||
DecoratorTestEngines.withGeneration(engine);
|
||||
return engine;
|
||||
private UpperDimension upper(boolean thisDimension, ModuleSettings dimension) {
|
||||
PackResources resources = data.getPackResources();
|
||||
return new UpperDimension() {
|
||||
@Override
|
||||
public boolean isThisDimension() {
|
||||
return thisDimension;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key() {
|
||||
return UPPER_DIMENSION_KEY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureSettings settings() {
|
||||
return TestPackWorld.dimensionLevel(dimension);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackResources resources() {
|
||||
return resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public java.util.Optional<com.volmit.block.BlockState> surfaceBlock(int worldX, int worldZ) {
|
||||
return java.util.Optional.empty();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private static void record(StringBuilder transcript, TerrainPalettes palettes) {
|
||||
|
||||
@@ -72,6 +72,7 @@ import com.volmit.world.BlockPosition;
|
||||
import com.volmit.world.PackWorld;
|
||||
import com.volmit.world.TerrainSample;
|
||||
import com.volmit.world.TerrainSampler;
|
||||
import com.volmit.world.UpperDimension;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
@@ -124,6 +125,7 @@ public final class ApiChunk implements GenerationContext {
|
||||
private final List<IrisFeature> dimensionSettings = new ArrayList<>();
|
||||
private final List<IrisFeature> regionSettings = new ArrayList<>();
|
||||
private final List<IrisFeature> biomeSettings = new ArrayList<>();
|
||||
private boolean stackedOnItself;
|
||||
private BiomeSample biomeSample;
|
||||
private BiomeKind surfaceKind = BiomeKind.LAND;
|
||||
private int minWorldY;
|
||||
@@ -211,6 +213,12 @@ public final class ApiChunk implements GenerationContext {
|
||||
return new Blocks();
|
||||
}
|
||||
|
||||
/** The dimension above is this dimension itself, stacked on it (with {@link #upperDimension}). */
|
||||
public ApiChunk stackedOnItself() {
|
||||
this.stackedOnItself = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
/** A block a placement planned in the mantle, in world coordinates. */
|
||||
public ApiChunk plan(int x, int y, int z, BlockState block) {
|
||||
planned.put(new BlockPosition(x, y, z), block);
|
||||
@@ -259,7 +267,12 @@ public final class ApiChunk implements GenerationContext {
|
||||
|
||||
/** Empty stand-ins for the built-in stages the ported modules order after: terrain, carving and floating islands. */
|
||||
public static List<IrisModule> standIns() {
|
||||
return List.of(new TerrainStandIn(), new CarveStandIn(), new FloatingStandIn());
|
||||
return List.of(new CarveStandIn(), new FloatingStandIn());
|
||||
}
|
||||
|
||||
/** An empty stand-in for {@code iris:terrain}, for modules that order after the shaping of the ground. */
|
||||
public static IrisModule terrainStandIn() {
|
||||
return new TerrainStandIn();
|
||||
}
|
||||
|
||||
/** Runs {@code modules} as a pack's chunk graph, with the {@link #standIns()}. */
|
||||
@@ -306,6 +319,11 @@ public final class ApiChunk implements GenerationContext {
|
||||
addEntries(entries, featureType, Target.BIOME, BIOME, biomeSettings);
|
||||
return entries;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <F extends IrisFeature> Optional<F> declaredBy(ResourceId biome, Class<F> featureType) {
|
||||
return biomeSettings.stream().filter(featureType::isInstance).map(featureType::cast).findFirst();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -347,6 +365,34 @@ public final class ApiChunk implements GenerationContext {
|
||||
return new BlockBox(originX, 0, originZ, originX + WIDTH, blocks.getHeight(), originZ + WIDTH);
|
||||
}
|
||||
|
||||
/** The dimension above, which is the one generated. */
|
||||
private final class SelfUpper implements UpperDimension {
|
||||
@Override
|
||||
public boolean isThisDimension() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String key() {
|
||||
return "overworld";
|
||||
}
|
||||
|
||||
@Override
|
||||
public FeatureSettings settings() {
|
||||
return ApiChunk.this.settings();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackResources resources() {
|
||||
return world.resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<BlockState> surfaceBlock(int worldX, int worldZ) {
|
||||
return Optional.empty();
|
||||
}
|
||||
}
|
||||
|
||||
private final class Terrain implements TerrainSampler {
|
||||
@Override
|
||||
public BlockBox bounds() {
|
||||
@@ -380,6 +426,16 @@ public final class ApiChunk implements GenerationContext {
|
||||
return minWorldY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceId surfaceBiome(int worldX, int worldZ) {
|
||||
return biomeSample == null ? BIOME : biomeSample.surfaceBiome();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Optional<UpperDimension> upperDimension() {
|
||||
return upperDimension != null && stackedOnItself ? Optional.of(new SelfUpper()) : Optional.empty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fluidHeight() {
|
||||
return fluidHeight;
|
||||
|
||||
+4
-1
@@ -1,5 +1,6 @@
|
||||
package art.arcane.iris.engine.modifier;
|
||||
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
import art.arcane.iris.builtin.terrain.LayersSettings;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.BuiltInPack;
|
||||
@@ -64,7 +65,9 @@ public class CaveApplyingInferenceIsolationTest {
|
||||
|
||||
Engine engine = mock(Engine.class);
|
||||
doReturn(mock(IrisData.class)).when(engine).getData();
|
||||
doReturn(mock(IrisDimension.class)).when(engine).getDimension();
|
||||
IrisDimension dimension = mock(IrisDimension.class);
|
||||
doReturn(ModuleSettings.NONE).when(dimension).getModuleSettings();
|
||||
doReturn(dimension).when(engine).getDimension();
|
||||
doReturn(mock(IrisComplex.class)).when(engine).getComplex();
|
||||
doReturn(IrisWorld.builder().minHeight(-256).maxHeight(512).build()).when(engine).getWorld();
|
||||
doReturn(mock(SeedManager.class)).when(engine).getSeedManager();
|
||||
|
||||
@@ -74,7 +74,7 @@ public class DepositModuleTest {
|
||||
+ " \"varience\": 1, \"palette\": [{\"block\": \"iron_ore\"}], \"replaceableBlocks\": [\"stone\"]}"));
|
||||
chunk.set(8, 20, 8, new BlockState("minecraft:dirt"));
|
||||
|
||||
chunk.generate(new DepositModule());
|
||||
chunk.generate(ApiChunk.terrainStandIn(), new DepositModule());
|
||||
|
||||
int ores = countOf(chunk, new BlockState("minecraft:iron_ore"));
|
||||
assertTrue("some ore was placed: " + ores, ores > 0);
|
||||
@@ -97,8 +97,8 @@ public class DepositModuleTest {
|
||||
ApiChunk first = groundedChunk().dimensionSettings(deposits);
|
||||
ApiChunk second = groundedChunk().dimensionSettings(deposits);
|
||||
|
||||
first.generate(new DepositModule());
|
||||
second.generate(new DepositModule());
|
||||
first.generate(ApiChunk.terrainStandIn(), new DepositModule());
|
||||
second.generate(ApiChunk.terrainStandIn(), new DepositModule());
|
||||
|
||||
for (int x = 0; x < ApiChunk.WIDTH; x++) {
|
||||
for (int y = 0; y < HEIGHT; y++) {
|
||||
@@ -124,8 +124,8 @@ public class DepositModuleTest {
|
||||
}
|
||||
}
|
||||
|
||||
free.generate(new DepositModule());
|
||||
carved.generate(new DepositModule());
|
||||
free.generate(ApiChunk.terrainStandIn(), new DepositModule());
|
||||
carved.generate(ApiChunk.terrainStandIn(), new DepositModule());
|
||||
|
||||
assertTrue(countBetween(free, 20, 40) > 0);
|
||||
assertEquals(0, countBetween(carved, 20, 40));
|
||||
@@ -136,7 +136,7 @@ public class DepositModuleTest {
|
||||
public void aChunkWithoutDepositsAtItsCentreIsLeftAlone() {
|
||||
ApiChunk chunk = groundedChunk();
|
||||
|
||||
chunk.generate(new DepositModule());
|
||||
chunk.generate(ApiChunk.terrainStandIn(), new DepositModule());
|
||||
|
||||
assertEquals(0, countOf(chunk, new BlockState("minecraft:iron_ore")));
|
||||
}
|
||||
|
||||
+17
-19
@@ -1,13 +1,13 @@
|
||||
package art.arcane.iris.engine.terrain;
|
||||
|
||||
import art.arcane.iris.builtin.terrain.BiomeLayers;
|
||||
import art.arcane.iris.builtin.terrain.LayeredBiome;
|
||||
import art.arcane.iris.builtin.terrain.PaletteExplosion;
|
||||
import art.arcane.iris.builtin.terrain.CaveCeilingLayersSettings;
|
||||
import art.arcane.iris.builtin.terrain.LayersSettings;
|
||||
import art.arcane.iris.core.loader.IrisData;
|
||||
import art.arcane.iris.core.modules.BuiltInPack;
|
||||
import art.arcane.iris.core.modules.IrisPackResources;
|
||||
import art.arcane.iris.engine.object.world.biome.IrisBiome;
|
||||
import art.arcane.iris.engine.object.world.dimension.IrisDimension;
|
||||
import art.arcane.iris.spi.PlatformBlockState;
|
||||
import com.volmit.block.BlockState;
|
||||
import art.arcane.volmlib.util.collection.KList;
|
||||
import art.arcane.volmlib.util.math.RNG;
|
||||
import com.google.gson.Gson;
|
||||
@@ -24,13 +24,11 @@ public class BiomeLayersCeilingGuardTest {
|
||||
private static final String EMPTY_LAYER = "{\"palette\": []}";
|
||||
private static final String EMPTY_CEILING_LAYER = "{\"palette\": [], \"minHeight\": 0, \"maxHeight\": 0}";
|
||||
|
||||
private static IrisBiome biome(int layers, int ceilingLayers) {
|
||||
private static LayeredBiome biome(int layers, int ceilingLayers) {
|
||||
Gson gson = new Gson();
|
||||
IrisBiome biome = new IrisBiome();
|
||||
biome.setModuleSettings(BuiltInPack.settings(
|
||||
gson.fromJson("{\"layers\": " + layerList(EMPTY_LAYER, layers) + "}", LayersSettings.class),
|
||||
gson.fromJson("{\"layers\": " + layerList(EMPTY_CEILING_LAYER, ceilingLayers) + "}", CaveCeilingLayersSettings.class)));
|
||||
return biome;
|
||||
return new LayeredBiome(
|
||||
gson.fromJson("{\"layers\": " + layerList(EMPTY_LAYER, layers) + "}", LayersSettings.class), null,
|
||||
gson.fromJson("{\"layers\": " + layerList(EMPTY_CEILING_LAYER, ceilingLayers) + "}", CaveCeilingLayersSettings.class), null, null, null);
|
||||
}
|
||||
|
||||
private static String layerList(String layer, int count) {
|
||||
@@ -47,33 +45,33 @@ public class BiomeLayersCeilingGuardTest {
|
||||
|
||||
@Test
|
||||
public void moreCeilingLayersThanLayersMustNotThrow() {
|
||||
IrisBiome biome = biome(1, 3);
|
||||
LayeredBiome biome = biome(1, 3);
|
||||
|
||||
KList<PlatformBlockState> result = layersOf(data()).generateCeilingLayers(
|
||||
biome, new IrisDimension(), 0, 0, new RNG(1), 8, 64, data(), null);
|
||||
KList<BlockState> result = layersOf(data()).generateCeilingLayers(
|
||||
biome, PaletteExplosion.NONE, 0, 0, new RNG(1), 8);
|
||||
|
||||
assertTrue("extra ceiling layers are skipped, not crashed on", result.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void inRangeCeilingLayersKeepWorking() {
|
||||
IrisBiome biome = biome(3, 2);
|
||||
LayeredBiome biome = biome(3, 2);
|
||||
|
||||
KList<PlatformBlockState> result = layersOf(data()).generateCeilingLayers(
|
||||
biome, new IrisDimension(), 0, 0, new RNG(1), 8, 64, data(), null);
|
||||
KList<BlockState> result = layersOf(data()).generateCeilingLayers(
|
||||
biome, PaletteExplosion.NONE, 0, 0, new RNG(1), 8);
|
||||
|
||||
assertTrue("zeroed palettes with zero heights produce no blocks", result.isEmpty());
|
||||
}
|
||||
|
||||
@Test
|
||||
public void omittedCeilingLayersLeaveCavesUnchanged() {
|
||||
KList<PlatformBlockState> result = layersOf(data()).generateCeilingLayers(
|
||||
new IrisBiome(), new IrisDimension(), 0, 0, new RNG(1), 8, 64, data(), null);
|
||||
KList<BlockState> result = layersOf(data()).generateCeilingLayers(
|
||||
LayeredBiome.UNDECLARED, PaletteExplosion.NONE, 0, 0, new RNG(1), 8);
|
||||
|
||||
assertTrue(result.isEmpty());
|
||||
}
|
||||
|
||||
private static BiomeLayers layersOf(IrisData data) {
|
||||
return new BiomeLayers(TestLayerBlocks.of(data.getPackResources()), ModuleLogs.discarding());
|
||||
return new BiomeLayers(TestLayerBlocks.of(data.getPackResources()), () -> data.getPackResources().noise(), ModuleLogs.discarding());
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package art.arcane.iris.engine.terrain;
|
||||
|
||||
import art.arcane.iris.builtin.terrain.BiomeLayers;
|
||||
import art.arcane.iris.builtin.terrain.LayerBlocks;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.PackSettings;
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.terrain;
|
||||
|
||||
import art.arcane.iris.builtin.terrain.LayeredBiome;
|
||||
import art.arcane.iris.builtin.terrain.CaveCeilingLayersSettings;
|
||||
import art.arcane.iris.builtin.terrain.LayersSettings;
|
||||
import art.arcane.iris.builtin.terrain.LockLayersMaxSettings;
|
||||
import art.arcane.iris.builtin.terrain.LockLayersSettings;
|
||||
import art.arcane.iris.builtin.terrain.SeaLayersSettings;
|
||||
import art.arcane.iris.builtin.terrain.WallSettings;
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
|
||||
/** What a biome file declares about its layers, for tests that write biomes as pack JSON ({@link TerrainTestSettings}). */
|
||||
public final class TestLayeredBiomes {
|
||||
private TestLayeredBiomes() {
|
||||
}
|
||||
|
||||
public static LayeredBiome of(ModuleSettings settings) {
|
||||
return new LayeredBiome(
|
||||
settings.find(LayersSettings.class).orElse(null),
|
||||
settings.find(SeaLayersSettings.class).orElse(null),
|
||||
settings.find(CaveCeilingLayersSettings.class).orElse(null),
|
||||
settings.find(LockLayersSettings.class).orElse(null),
|
||||
settings.find(LockLayersMaxSettings.class).orElse(null),
|
||||
settings.find(WallSettings.class).orElse(null));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Iris is a World Generator for Minecraft Servers
|
||||
* Copyright (c) 2026 Arcane Arts (Volmit Software)
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package art.arcane.iris.engine.terrain;
|
||||
|
||||
import art.arcane.iris.builtin.IrisSeed;
|
||||
import art.arcane.iris.core.modules.ModuleSettings;
|
||||
import com.volmit.FeatureAttachment.Target;
|
||||
import com.volmit.IrisFeature;
|
||||
import com.volmit.ModuleLog;
|
||||
import com.volmit.config.FeatureSettings;
|
||||
import com.volmit.config.FeatureSettings.Entry;
|
||||
import com.volmit.config.PackSettings;
|
||||
import com.volmit.host.ModuleLogs;
|
||||
import com.volmit.resource.PackResources;
|
||||
import com.volmit.resource.ResourceId;
|
||||
import com.volmit.world.PackWorld;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
import java.util.function.Function;
|
||||
|
||||
/** A world of a pack's resources whose dimension declares the given settings and whose complex and terrain seeds are given, for tests of the terrain's support classes. */
|
||||
public final class TestPackWorld implements PackWorld, IrisSeed.Source {
|
||||
private static final ResourceId DIMENSION = ResourceId.parse("test:dimension/overworld");
|
||||
|
||||
private final PackResources resources;
|
||||
private final PackSettings settings;
|
||||
private final long seed;
|
||||
private final Map<Class<?>, Object> states = new HashMap<>();
|
||||
|
||||
public TestPackWorld(PackResources resources, ModuleSettings dimensionSettings, long seed) {
|
||||
this(resources, new PackSettings() {
|
||||
@Override
|
||||
public <F extends IrisFeature> List<Entry<F>> declared(Class<F> featureType) {
|
||||
Optional<F> found = dimensionSettings.find(featureType);
|
||||
return found.map(value -> List.of(new Entry<>(Target.DIMENSION, DIMENSION, value))).orElse(List.of());
|
||||
}
|
||||
}, seed);
|
||||
}
|
||||
|
||||
/** A world whose pack declares the settings {@code settings} gives, wherever it says. */
|
||||
public TestPackWorld(PackResources resources, PackSettings settings, long seed) {
|
||||
this.resources = resources;
|
||||
this.settings = settings;
|
||||
this.seed = seed;
|
||||
}
|
||||
|
||||
/** The settings the dimension declares, as a dimension in a column of a world holds them. */
|
||||
public static FeatureSettings dimensionLevel(ModuleSettings settings) {
|
||||
return new FeatureSettings() {
|
||||
@Override
|
||||
public <F extends IrisFeature> List<Entry<F>> at(Class<F> featureType, int worldX, int worldZ) {
|
||||
return settings.find(featureType).map(value -> List.of(new Entry<>(Target.DIMENSION, DIMENSION, value))).orElse(List.of());
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@Override
|
||||
public long seed() {
|
||||
return seed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public long seed(IrisSeed which) {
|
||||
return seed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackResources resources() {
|
||||
return resources;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackSettings settings() {
|
||||
return settings;
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T state(Class<T> type, Function<? super PackWorld, ? extends T> create) {
|
||||
return type.cast(states.computeIfAbsent(type, ignored -> create.apply(this)));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ModuleLog log() {
|
||||
return ModuleLogs.discarding();
|
||||
}
|
||||
|
||||
@Override
|
||||
public PackWorld withLog(ModuleLog log) {
|
||||
return this;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user