mirror of
https://github.com/VolmitSoftware/Iris.git
synced 2026-11-28 16:54:04 +00:00
Host side of the carve port: NoiseSampler signed and scaled, minHeight, cave biome of a block, MatterMantle over the invocation's mantle, CaveDressing over layers, decorators and palettes, carve leaves the compiled-in list
This commit is contained in:
1 parent
48e328baef
commit
d15c3480ab
14 files changed
+309
-12
No files matched your search
@@ -21,6 +21,7 @@ package art.arcane.iris.core.modules;
|
||||
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.modifier.CarveModule;
|
||||
import art.arcane.iris.engine.modifier.MatterModule;
|
||||
import art.arcane.iris.engine.modifier.PerfectionModule;
|
||||
import art.arcane.iris.engine.modifier.PostModule;
|
||||
@@ -51,7 +52,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());
|
||||
return List.of(new PostModule(), new PerfectionModule(), new MatterModule(), new CarveModule());
|
||||
}
|
||||
|
||||
/** Every built-in module: Iris's own and the compiled-in copies of the jar's ({@link #jarModules()}). */
|
||||
|
||||
@@ -128,6 +128,36 @@ public class IrisValuesTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void signedNoiseIsTheSignedFastReadOfTheIrisGeneratorsNoise() {
|
||||
String json = "{\"style\": \"SIMPLEX\", \"zoom\": 4, \"exponent\": 1.5, \"fracture\": {\"style\": \"PERLIN\", \"zoom\": 2, \"multiplier\": 3}}";
|
||||
IrisData data = packWithoutCustomBlocks();
|
||||
CNG iris = new Gson().fromJson(json, IrisGeneratorStyle.class).create(new RNG(1337), data);
|
||||
NoiseSampler sampler = new IrisNoiseFactory(data).sampler(new Gson().fromJson(json, NoiseStyle.class), 1337);
|
||||
|
||||
for (double[] column : COLUMNS) {
|
||||
assertEquals(iris.noiseFastSigned2D(column[0], column[1]), sampler.signed(column[0], column[1]), 0);
|
||||
assertEquals(iris.noiseFastSigned3D(column[0], 64, column[1]), sampler.signed(column[0], 64, column[1]), 0);
|
||||
assertEquals(iris.noiseFastSigned3D(column[0], 64, column[1]), sampler.signed(column[0], 64, column[1]), 0);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void scaledNoiseIsTheGeneratorWithTheScaleBakedIn() {
|
||||
String json = "{\"style\": \"CELLULAR_IRIS_DOUBLE\", \"zoom\": 1}";
|
||||
IrisData data = packWithoutCustomBlocks();
|
||||
double scale = 1.5D;
|
||||
CNG baked = new Gson().fromJson(json, IrisGeneratorStyle.class).createNoCache(new RNG(4242), data).bake().scale(scale).bake();
|
||||
NoiseSampler plain = new IrisNoiseFactory(data).sampler(new Gson().fromJson(json, NoiseStyle.class), 4242);
|
||||
NoiseSampler scaled = plain.scaled(scale);
|
||||
|
||||
for (int x = -30; x <= 30; x += 3) {
|
||||
assertEquals(baked.noiseFast2D(x, 7), scaled.sample(x, 7), 0);
|
||||
}
|
||||
assertEquals("the sampler it was made from is left as it was", new Gson().fromJson(json, IrisGeneratorStyle.class)
|
||||
.createNoCache(new RNG(4242), data).noise(9, 4), plain.sample(9, 4), 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void aStyleNameIrisDoesNotKnowIsFlat() {
|
||||
IrisData data = packWithoutCustomBlocks();
|
||||
|
||||
Reference in new issue
Block a user