From 3da2565f575c59435d188b651bf0a10ebb1117c7 Mon Sep 17 00:00:00 2001 From: dfsek Date: Sat, 4 Dec 2021 18:49:43 -0700 Subject: [PATCH] remove GenerationSettings --- .../terra/addons/biome/BiomeFactory.java | 8 +- .../terra/addons/biome/UserDefinedBiome.java | 4 +- .../biome/UserDefinedGenerationSettings.java | 78 ------------------- .../api/world/biome/GenerationSettings.java | 44 ----------- 4 files changed, 2 insertions(+), 132 deletions(-) delete mode 100644 common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedGenerationSettings.java delete mode 100644 common/api/core/src/main/java/com/dfsek/terra/api/world/biome/GenerationSettings.java diff --git a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/BiomeFactory.java b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/BiomeFactory.java index 81ff62468..0f84c609c 100644 --- a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/BiomeFactory.java +++ b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/BiomeFactory.java @@ -22,12 +22,6 @@ public class BiomeFactory implements ConfigFactory { @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); } } diff --git a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedBiome.java b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedBiome.java index 3ed957067..49943eb60 100644 --- a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedBiome.java +++ b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedBiome.java @@ -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(); diff --git a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedGenerationSettings.java b/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedGenerationSettings.java deleted file mode 100644 index 5a2afd9fb..000000000 --- a/common/addons/config-biome/src/main/java/com/dfsek/terra/addons/biome/UserDefinedGenerationSettings.java +++ /dev/null @@ -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; - } -} diff --git a/common/api/core/src/main/java/com/dfsek/terra/api/world/biome/GenerationSettings.java b/common/api/core/src/main/java/com/dfsek/terra/api/world/biome/GenerationSettings.java deleted file mode 100644 index a5a7880d0..000000000 --- a/common/api/core/src/main/java/com/dfsek/terra/api/world/biome/GenerationSettings.java +++ /dev/null @@ -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(); -}