mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-16 13:51:41 +00:00
cleanup
This commit is contained in:
@@ -42,6 +42,7 @@ import com.dfsek.terra.config.loaders.config.sampler.NoiseSamplerBuilderLoader;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.DomainWarpTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.FastNoiseTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.ImageSamplerTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.normalizer.ClampNormalizerTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.normalizer.LinearNormalizerTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.normalizer.NormalNormalizerTemplate;
|
||||
import com.dfsek.terra.config.loaders.palette.CarverPaletteLoader;
|
||||
@@ -82,6 +83,7 @@ public class GenericLoaders implements LoaderRegistrar {
|
||||
.registerLoader(DomainWarpTemplate.class, DomainWarpTemplate::new)
|
||||
.registerLoader(LinearNormalizerTemplate.class, LinearNormalizerTemplate::new)
|
||||
.registerLoader(NormalNormalizerTemplate.class, NormalNormalizerTemplate::new)
|
||||
.registerLoader(ClampNormalizerTemplate.class, ClampNormalizerTemplate::new)
|
||||
.registerLoader(NoiseSeeded.class, new NoiseSamplerBuilderLoader())
|
||||
.registerLoader(ReplaceMutatorTemplate.class, ReplaceMutatorTemplate::new)
|
||||
.registerLoader(ExpanderStageTemplate.class, ExpanderStageTemplate::new)
|
||||
|
||||
+5
-2
@@ -8,6 +8,7 @@ import com.dfsek.terra.api.util.seeded.NoiseSeeded;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.DomainWarpTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.FastNoiseTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.ImageSamplerTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.normalizer.ClampNormalizerTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.normalizer.LinearNormalizerTemplate;
|
||||
import com.dfsek.terra.config.loaders.config.sampler.templates.normalizer.NormalNormalizerTemplate;
|
||||
|
||||
@@ -34,9 +35,11 @@ public class NoiseSamplerBuilderLoader implements TypeLoader<NoiseSeeded> {
|
||||
Normalizer.NormalType normalType = loader.loadClass(Normalizer.NormalType.class, map.get("type"));
|
||||
switch(normalType) {
|
||||
case LINEAR:
|
||||
return loader.loadClass(LinearNormalizerTemplate.class, map).get();
|
||||
return loader.loadClass(LinearNormalizerTemplate.class, map);
|
||||
case NORMAL:
|
||||
return loader.loadClass(NormalNormalizerTemplate.class, map).get();
|
||||
return loader.loadClass(NormalNormalizerTemplate.class, map);
|
||||
case CLAMP:
|
||||
return loader.loadClass(ClampNormalizerTemplate.class, map);
|
||||
}
|
||||
case "IMAGE": {
|
||||
return loader.loadClass(ImageSamplerTemplate.class, map).get();
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
package com.dfsek.terra.config.loaders.config.sampler.templates.normalizer;
|
||||
|
||||
import com.dfsek.tectonic.annotations.Value;
|
||||
import com.dfsek.terra.api.math.noise.NoiseSampler;
|
||||
import com.dfsek.terra.api.math.noise.normalizer.ClampNormalizer;
|
||||
import com.dfsek.terra.api.math.noise.normalizer.LinearNormalizer;
|
||||
|
||||
@SuppressWarnings({"unused", "FieldMayBeFinal"})
|
||||
public class ClampNormalizerTemplate extends NormalizerTemplate<LinearNormalizer> {
|
||||
@Value("max")
|
||||
private double max;
|
||||
|
||||
@Value("min")
|
||||
private double min;
|
||||
|
||||
@Override
|
||||
public NoiseSampler apply(Long seed) {
|
||||
return new ClampNormalizer(function.apply(seed), min, max);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user