configurable blend weight

This commit is contained in:
dfsek
2021-01-21 20:29:25 -07:00
parent 708ef16a1c
commit 115bb414c0
7 changed files with 80 additions and 4 deletions
@@ -40,12 +40,18 @@ public class GeneratorBuilder {
private int blendStep;
private double blendWeight;
public WorldGenerator build(long seed) {
synchronized(gens) {
return gens.computeIfAbsent(seed, k -> new WorldGenerator(seed, noiseEquation, elevationEquation, varScope, noiseBuilderMap, palettes, slantPalettes, noise2d, base, biomeNoise.build((int) seed), elevationWeight, blendDistance, blendStep));
return gens.computeIfAbsent(seed, k -> new WorldGenerator(seed, noiseEquation, elevationEquation, varScope, noiseBuilderMap, palettes, slantPalettes, noise2d, base, biomeNoise.build((int) seed), elevationWeight, blendDistance, blendStep, blendWeight));
}
}
public void setBlendWeight(double blendWeight) {
this.blendWeight = blendWeight;
}
public void setBlendStep(int blendStep) {
this.blendStep = blendStep;
}
@@ -30,6 +30,7 @@ public class BiomeFactory implements TerraFactory<BiomeTemplate, TerraBiome> {
generatorBuilder.setBiomeNoise(template.getBiomeNoise());
generatorBuilder.setBlendDistance(template.getBlendDistance());
generatorBuilder.setBlendStep(template.getBlendStep());
generatorBuilder.setBlendWeight(template.getBlendWeight());
return new UserDefinedBiome(template.getVanilla(), generatorBuilder, template);
@@ -75,7 +75,13 @@ public class BiomeTemplate extends AbstractableTemplate implements ValidatedConf
@Default
private int blendDistance = 3;
@Value("blend.weight")
@Abstractable
@Default
private double blendWeight = 1;
@Value("blend.step")
@Abstractable
@Default
private int blendStep = 4;
@@ -170,6 +176,10 @@ public class BiomeTemplate extends AbstractableTemplate implements ValidatedConf
return tags;
}
public double getBlendWeight() {
return blendWeight;
}
public int getColor() {
return color;
}