mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-16 13:51:41 +00:00
configurable blend weight
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user