remove GenerationSettings

This commit is contained in:
dfsek
2021-12-04 18:49:43 -07:00
parent ca84628eb9
commit 3da2565f57
4 changed files with 2 additions and 132 deletions

View File

@@ -22,12 +22,6 @@ public class BiomeFactory implements ConfigFactory<BiomeTemplate, Biome> {
@Override
public Biome build(BiomeTemplate template, Platform platform) {
UserDefinedGenerationSettings generator = new UserDefinedGenerationSettings(template.getNoiseEquation(),
template.getElevationEquation(),
template.getCarvingEquation(), template.getBiomeNoise(),
template.getElevationWeight(),
template.getBlendDistance(), template.getBlendStep(),
template.getBlendWeight());
return new UserDefinedBiome(template.getVanilla(), generator, template);
return new UserDefinedBiome(template.getVanilla(), template);
}
}

View File

@@ -18,7 +18,6 @@ import com.dfsek.terra.api.world.biome.PlatformBiome;
* Class representing a config-defined biome
*/
public class UserDefinedBiome implements Biome {
private final UserDefinedGenerationSettings gen;
private final PlatformBiome vanilla;
private final String id;
private final BiomeTemplate config;
@@ -27,9 +26,8 @@ public class UserDefinedBiome implements Biome {
private final Context context = new Context();
public UserDefinedBiome(PlatformBiome vanilla, UserDefinedGenerationSettings gen, BiomeTemplate config) {
public UserDefinedBiome(PlatformBiome vanilla, BiomeTemplate config) {
this.vanilla = vanilla;
this.gen = gen;
this.id = config.getID();
this.config = config;
this.color = config.getColor();

View File

@@ -1,78 +0,0 @@
/*
* Copyright (c) 2020-2021 Polyhedral Development
*
* The Terra Core Addons are licensed under the terms of the MIT License. For more details,
* reference the LICENSE file in this module's root directory.
*/
package com.dfsek.terra.addons.biome;
import com.dfsek.terra.api.noise.NoiseSampler;
import com.dfsek.terra.api.world.biome.GenerationSettings;
public class UserDefinedGenerationSettings implements GenerationSettings {
private final NoiseSampler noise;
private final NoiseSampler elevation;
private final NoiseSampler carving;
private final NoiseSampler biomeNoise;
private final double elevationWeight;
private final int blendDistance;
private final int blendStep;
private final double blendWeight;
public UserDefinedGenerationSettings(NoiseSampler noise, NoiseSampler elevation, NoiseSampler carving, NoiseSampler biomeNoise,
double elevationWeight, int blendDistance, int blendStep, double blendWeight) {
this.noise = noise;
this.elevation = elevation;
this.carving = carving;
this.biomeNoise = biomeNoise;
this.elevationWeight = elevationWeight;
this.blendDistance = blendDistance;
this.blendStep = blendStep;
this.blendWeight = blendWeight;
}
@Override
public NoiseSampler getBaseSampler() {
return noise;
}
@Override
public NoiseSampler getElevationSampler() {
return elevation;
}
@Override
public NoiseSampler getCarver() {
return carving;
}
@Override
public int getBlendDistance() {
return blendDistance;
}
@Override
public double getWeight() {
return blendWeight;
}
@Override
public NoiseSampler getBiomeNoise() {
return biomeNoise;
}
@Override
public double getElevationWeight() {
return elevationWeight;
}
@Override
public int getBlendStep() {
return blendStep;
}
}

View File

@@ -1,44 +0,0 @@
/*
* Copyright (c) 2020-2021 Polyhedral Development
*
* The Terra API is licensed under the terms of the MIT License. For more details,
* reference the LICENSE file in the common/api directory.
*/
package com.dfsek.terra.api.world.biome;
import com.dfsek.terra.api.noise.NoiseSampler;
public interface GenerationSettings {
/**
* Gets the noise sampler instance to use for base terrain.
*
* @return NoiseSampler for terrain
*/
NoiseSampler getBaseSampler();
/**
* Gets the noise sampler to use for elevation
*
* @return NoiseSampler for elevation.
*/
NoiseSampler getElevationSampler();
/**
* Gets the noise sampler to use for carving.
*
* @return NoiseSampler for carving.
*/
NoiseSampler getCarver();
int getBlendDistance();
double getWeight();
NoiseSampler getBiomeNoise();
double getElevationWeight();
int getBlendStep();
}