mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 14:21:08 +00:00
remove GenerationSettings
This commit is contained in:
+1
-7
@@ -22,12 +22,6 @@ public class BiomeFactory implements ConfigFactory<BiomeTemplate, Biome> {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome build(BiomeTemplate template, Platform platform) {
|
public Biome build(BiomeTemplate template, Platform platform) {
|
||||||
UserDefinedGenerationSettings generator = new UserDefinedGenerationSettings(template.getNoiseEquation(),
|
return new UserDefinedBiome(template.getVanilla(), template);
|
||||||
template.getElevationEquation(),
|
|
||||||
template.getCarvingEquation(), template.getBiomeNoise(),
|
|
||||||
template.getElevationWeight(),
|
|
||||||
template.getBlendDistance(), template.getBlendStep(),
|
|
||||||
template.getBlendWeight());
|
|
||||||
return new UserDefinedBiome(template.getVanilla(), generator, template);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-3
@@ -18,7 +18,6 @@ import com.dfsek.terra.api.world.biome.PlatformBiome;
|
|||||||
* Class representing a config-defined biome
|
* Class representing a config-defined biome
|
||||||
*/
|
*/
|
||||||
public class UserDefinedBiome implements Biome {
|
public class UserDefinedBiome implements Biome {
|
||||||
private final UserDefinedGenerationSettings gen;
|
|
||||||
private final PlatformBiome vanilla;
|
private final PlatformBiome vanilla;
|
||||||
private final String id;
|
private final String id;
|
||||||
private final BiomeTemplate config;
|
private final BiomeTemplate config;
|
||||||
@@ -27,9 +26,8 @@ public class UserDefinedBiome implements Biome {
|
|||||||
|
|
||||||
private final Context context = new Context();
|
private final Context context = new Context();
|
||||||
|
|
||||||
public UserDefinedBiome(PlatformBiome vanilla, UserDefinedGenerationSettings gen, BiomeTemplate config) {
|
public UserDefinedBiome(PlatformBiome vanilla, BiomeTemplate config) {
|
||||||
this.vanilla = vanilla;
|
this.vanilla = vanilla;
|
||||||
this.gen = gen;
|
|
||||||
this.id = config.getID();
|
this.id = config.getID();
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.color = config.getColor();
|
this.color = config.getColor();
|
||||||
|
|||||||
-78
@@ -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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -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();
|
|
||||||
}
|
|
||||||
Reference in New Issue
Block a user