mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
remove unused class
This commit is contained in:
@@ -1,147 +0,0 @@
|
|||||||
package com.dfsek.terra.config.builder;
|
|
||||||
|
|
||||||
import com.dfsek.paralithic.eval.parser.Scope;
|
|
||||||
import com.dfsek.paralithic.eval.tokenizer.ParseException;
|
|
||||||
import com.dfsek.terra.api.math.noise.NoiseSampler;
|
|
||||||
import com.dfsek.terra.api.math.noise.samplers.ExpressionSampler;
|
|
||||||
import com.dfsek.terra.api.math.noise.samplers.noise.ConstantSampler;
|
|
||||||
import com.dfsek.terra.api.util.seeded.NoiseSeeded;
|
|
||||||
import com.dfsek.terra.api.world.palette.holder.PaletteHolder;
|
|
||||||
import com.dfsek.terra.config.loaders.config.function.FunctionTemplate;
|
|
||||||
import com.dfsek.terra.world.generation.WorldGenerator;
|
|
||||||
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
public class GeneratorBuilder {
|
|
||||||
private final Map<Long, WorldGenerator> gens = Collections.synchronizedMap(new HashMap<>());
|
|
||||||
|
|
||||||
private String noiseEquation;
|
|
||||||
|
|
||||||
private String elevationEquation;
|
|
||||||
|
|
||||||
private String carvingEquation;
|
|
||||||
|
|
||||||
private Scope varScope;
|
|
||||||
|
|
||||||
private Map<String, NoiseSeeded> noiseBuilderMap;
|
|
||||||
|
|
||||||
private Map<String, FunctionTemplate> functionTemplateMap;
|
|
||||||
|
|
||||||
private PaletteHolder palettes;
|
|
||||||
|
|
||||||
private PaletteHolder slantPalettes;
|
|
||||||
|
|
||||||
private boolean preventInterpolation;
|
|
||||||
|
|
||||||
private boolean interpolateElevation;
|
|
||||||
|
|
||||||
private NoiseSeeded biomeNoise;
|
|
||||||
|
|
||||||
private double elevationWeight;
|
|
||||||
|
|
||||||
private int blendDistance;
|
|
||||||
|
|
||||||
private int blendStep;
|
|
||||||
|
|
||||||
private double blendWeight;
|
|
||||||
|
|
||||||
public WorldGenerator build(long seed) {
|
|
||||||
synchronized(gens) {
|
|
||||||
return gens.computeIfAbsent(seed, k -> {
|
|
||||||
NoiseSampler noise;
|
|
||||||
NoiseSampler elevation;
|
|
||||||
NoiseSampler carving;
|
|
||||||
try {
|
|
||||||
noise = new ExpressionSampler(noiseEquation, varScope, seed, noiseBuilderMap, functionTemplateMap);
|
|
||||||
elevation = elevationEquation == null ? new ConstantSampler(0) : new ExpressionSampler(elevationEquation, varScope, seed, noiseBuilderMap, functionTemplateMap);
|
|
||||||
carving = new ExpressionSampler(carvingEquation, varScope, seed, noiseBuilderMap, functionTemplateMap);
|
|
||||||
} catch(ParseException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
return new WorldGenerator(palettes, slantPalettes, noise, elevation, carving, biomeNoise.apply(seed), elevationWeight, blendDistance, blendStep, blendWeight);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlendWeight(double blendWeight) {
|
|
||||||
this.blendWeight = blendWeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setFunctionTemplateMap(Map<String, FunctionTemplate> functionTemplateMap) {
|
|
||||||
this.functionTemplateMap = functionTemplateMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlendStep(int blendStep) {
|
|
||||||
this.blendStep = blendStep;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlendDistance(int blendDistance) {
|
|
||||||
this.blendDistance = blendDistance;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBiomeNoise(NoiseSeeded biomeNoise) {
|
|
||||||
this.biomeNoise = biomeNoise;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setElevationWeight(double elevationWeight) {
|
|
||||||
this.elevationWeight = elevationWeight;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNoiseEquation(String noiseEquation) {
|
|
||||||
this.noiseEquation = noiseEquation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setElevationEquation(String elevationEquation) {
|
|
||||||
this.elevationEquation = elevationEquation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setCarvingEquation(String carvingEquation) {
|
|
||||||
this.carvingEquation = carvingEquation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public Scope getVarScope() {
|
|
||||||
return varScope;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVarScope(Scope varScope) {
|
|
||||||
this.varScope = varScope;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setNoiseBuilderMap(Map<String, NoiseSeeded> noiseBuilderMap) {
|
|
||||||
this.noiseBuilderMap = noiseBuilderMap;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PaletteHolder getPalettes() {
|
|
||||||
return palettes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPalettes(PaletteHolder palettes) {
|
|
||||||
this.palettes = palettes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public PaletteHolder getSlantPalettes() {
|
|
||||||
return slantPalettes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setSlantPalettes(PaletteHolder slantPalettes) {
|
|
||||||
this.slantPalettes = slantPalettes;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isPreventInterpolation() {
|
|
||||||
return preventInterpolation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setPreventInterpolation(boolean preventInterpolation) {
|
|
||||||
this.preventInterpolation = preventInterpolation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setInterpolateElevation(boolean interpolateElevation) {
|
|
||||||
this.interpolateElevation = interpolateElevation;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean interpolateElevation() {
|
|
||||||
return interpolateElevation;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
-3
@@ -3,12 +3,9 @@ package com.dfsek.terra.fabric.config;
|
|||||||
import com.dfsek.tectonic.annotations.Default;
|
import com.dfsek.tectonic.annotations.Default;
|
||||||
import com.dfsek.tectonic.annotations.Value;
|
import com.dfsek.tectonic.annotations.Value;
|
||||||
import com.dfsek.tectonic.config.ConfigTemplate;
|
import com.dfsek.tectonic.config.ConfigTemplate;
|
||||||
import com.dfsek.terra.config.builder.BiomeBuilder;
|
|
||||||
import net.minecraft.util.Identifier;
|
import net.minecraft.util.Identifier;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
@SuppressWarnings("FieldMayBeFinal")
|
@SuppressWarnings("FieldMayBeFinal")
|
||||||
|
|||||||
Reference in New Issue
Block a user