mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-20 07:10:24 +00:00
begin work on automatic config docs
This commit is contained in:
@@ -11,16 +11,28 @@ import com.dfsek.terra.api.world.biome.provider.StandardBiomeProvider;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* Configures a biome pipeline.
|
||||
*/
|
||||
@SuppressWarnings({"FieldMayBeFinal", "unused"})
|
||||
public class BiomePipelineTemplate extends BiomeProviderTemplate {
|
||||
private final TerraPlugin main;
|
||||
/**
|
||||
* Initial size of biome pipeline chunks.
|
||||
*/
|
||||
@Value("pipeline.initial-size")
|
||||
@Default
|
||||
private int initialSize = 2;
|
||||
|
||||
/**
|
||||
* Mutator stages to be used in this biome pipeline.
|
||||
*/
|
||||
@Value("pipeline.stages")
|
||||
private List<StageSeeded> stages;
|
||||
|
||||
/**
|
||||
* Biome source to initialize the pipeline.
|
||||
*/
|
||||
@Value("pipeline.source")
|
||||
private SourceSeeded source;
|
||||
|
||||
|
||||
@@ -6,18 +6,35 @@ import com.dfsek.terra.api.math.noise.NoiseSampler;
|
||||
import com.dfsek.terra.api.math.noise.samplers.DomainWarpedSampler;
|
||||
import com.dfsek.terra.api.util.seeded.NoiseSeeded;
|
||||
|
||||
/**
|
||||
* Defines a domain-warped noise function.
|
||||
*/
|
||||
@SuppressWarnings({"unused", "FieldMayBeFinal"})
|
||||
public class DomainWarpTemplate extends SamplerTemplate<DomainWarpedSampler> {
|
||||
/**
|
||||
* Noise function used to warp input function.
|
||||
*/
|
||||
@Value("warp")
|
||||
private NoiseSeeded warp;
|
||||
|
||||
/**
|
||||
* Input function (function to be warped)
|
||||
*/
|
||||
@Value("function")
|
||||
private NoiseSeeded function;
|
||||
|
||||
/**
|
||||
* Salt for both warp function and
|
||||
* input function.
|
||||
*/
|
||||
@Value("salt")
|
||||
@Default
|
||||
private int salt = 0;
|
||||
|
||||
/**
|
||||
* Amplitude of warping. Values provided by
|
||||
* the warp function are multiplied by this constant.
|
||||
*/
|
||||
@Value("amplitude")
|
||||
@Default
|
||||
private double amplitude = 1;
|
||||
|
||||
@@ -10,6 +10,9 @@ import com.dfsek.terra.api.util.seeded.NoiseSeeded;
|
||||
|
||||
@SuppressWarnings("FieldMayBeFinal")
|
||||
public abstract class SamplerTemplate<T extends NoiseSampler> implements ValidatedConfigTemplate, ObjectTemplate<NoiseSeeded>, NoiseSeeded {
|
||||
/**
|
||||
* Number of dimensions for this sampler.
|
||||
*/
|
||||
@Value("dimensions")
|
||||
@Default
|
||||
private int dimensions = 2;
|
||||
|
||||
@@ -5,15 +5,27 @@ import com.dfsek.tectonic.annotations.Value;
|
||||
import com.dfsek.terra.api.math.noise.NoiseSampler;
|
||||
import com.dfsek.terra.api.math.noise.samplers.noise.GaborNoiseSampler;
|
||||
|
||||
/**
|
||||
* Defines a Gabor noise function.
|
||||
*/
|
||||
public class GaborNoiseTemplate extends NoiseTemplate<GaborNoiseSampler> {
|
||||
/**
|
||||
* Rotation to apply to noise. Only has noticeable effects in anisotropic mode.
|
||||
*/
|
||||
@Value("rotation")
|
||||
@Default
|
||||
private double rotation = 0.25;
|
||||
|
||||
/**
|
||||
* Whether to use anisotropic or isotropic algorithm.
|
||||
*/
|
||||
@Value("isotropic")
|
||||
@Default
|
||||
private boolean isotropic = true;
|
||||
|
||||
/**
|
||||
* Standard deviation of result values.
|
||||
*/
|
||||
@Value("deviation")
|
||||
@Default
|
||||
private double deviation = 1.0;
|
||||
|
||||
@@ -15,24 +15,52 @@ import java.util.Set;
|
||||
|
||||
@SuppressWarnings({"unused", "FieldMayBeFinal"})
|
||||
public class ConfigPackTemplate implements ConfigTemplate {
|
||||
|
||||
/**
|
||||
* The ID of the config pack.
|
||||
*/
|
||||
@Value("id")
|
||||
private String id;
|
||||
|
||||
/**
|
||||
* Noise functions to be made available
|
||||
* to noise equations in the config pack.
|
||||
* <p>
|
||||
* Keys are Paralithic function IDs,
|
||||
* values are noise functions.
|
||||
*/
|
||||
@Value("noise")
|
||||
private Map<String, NoiseSeeded> noiseBuilderMap;
|
||||
|
||||
/**
|
||||
* Addons this pack depends on.
|
||||
*/
|
||||
@Value("addons")
|
||||
@Default
|
||||
private Set<TerraAddon> addons = new HashSet<>();
|
||||
|
||||
/**
|
||||
* Variables to be made available
|
||||
* to noise equations in the config pack.
|
||||
* <p>
|
||||
* Keys are variable IDs,
|
||||
* values are variable values.
|
||||
*/
|
||||
@Value("variables")
|
||||
@Default
|
||||
private Map<String, Double> variables = new HashMap<>();
|
||||
|
||||
/**
|
||||
* Whether to enable beta noise
|
||||
* carvers.
|
||||
*/
|
||||
@Value("beta.carving")
|
||||
@Default
|
||||
private boolean betaCarvers = false;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Value("functions")
|
||||
@Default
|
||||
private LinkedHashMap<String, FunctionTemplate> functions = new LinkedHashMap<>();
|
||||
|
||||
@@ -32,7 +32,7 @@ public class FloraTemplate extends AbstractableTemplate {
|
||||
@Value("irrigable")
|
||||
@Abstractable
|
||||
@Default
|
||||
private MaterialSet irrigable = null;
|
||||
private MaterialSet irrigable = new MaterialSet();
|
||||
|
||||
@Value("rotatable")
|
||||
@Abstractable
|
||||
|
||||
Reference in New Issue
Block a user