diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000..9b9bcda58
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,63 @@
+[submodule "common/addons/biome-provider-image"]
+ path = common/addons/biome-provider-image
+ url = https://github.com/PolyhedralDev/Terra-biome-provider-image
+[submodule "common/addons/biome-provider-pipeline"]
+ path = common/addons/biome-provider-pipeline
+ url = https://github.com/PolyhedralDev/Terra-biome-provider-pipeline
+[submodule "common/addons/biome-provider-single"]
+ path = common/addons/biome-provider-single
+ url = https://github.com/PolyhedralDev/Terra-biome-provider-single
+[submodule "common/addons/chunk-generator-noise-3d"]
+ path = common/addons/chunk-generator-noise-3d
+ url = https://github.com/PolyhedralDev/Terra-chunk-generator-noise-3d
+[submodule "common/addons/config-biome"]
+ path = common/addons/config-biome
+ url = https://github.com/PolyhedralDev/Terra-config-biome
+[submodule "common/addons/config-carver"]
+ path = common/addons/config-carver
+ url = https://github.com/PolyhedralDev/Terra-config-carver
+[submodule "common/addons/config-distributors"]
+ path = common/addons/config-distributors
+ url = https://github.com/PolyhedralDev/Terra-config-distributors
+[submodule "common/addons/config-feature"]
+ path = common/addons/config-feature
+ url = https://github.com/PolyhedralDev/Terra-config-feature
+[submodule "common/addons/config-flora"]
+ path = common/addons/config-flora
+ url = https://github.com/PolyhedralDev/Terra-config-flora
+[submodule "common/addons/config-locators"]
+ path = common/addons/config-locators
+ url = https://github.com/PolyhedralDev/Terra-config-locators
+[submodule "common/addons/config-noise-function"]
+ path = common/addons/config-noise-function
+ url = https://github.com/PolyhedralDev/Terra-config-noise-function
+[submodule "common/addons/config-ore"]
+ path = common/addons/config-ore
+ url = https://github.com/PolyhedralDev/Terra-config-ore
+[submodule "common/addons/config-palette"]
+ path = common/addons/config-palette
+ url = https://github.com/PolyhedralDev/Terra-config-palette
+[submodule "common/addons/config-structure"]
+ path = common/addons/config-structure
+ url = https://github.com/PolyhedralDev/Terra-config-structure
+[submodule "common/addons/generation-stage-feature"]
+ path = common/addons/generation-stage-feature
+ url = https://github.com/PolyhedralDev/Terra-generation-stage-feature
+[submodule "common/addons/generation-stage-structure"]
+ path = common/addons/generation-stage-structure
+ url = https://github.com/PolyhedralDev/Terra-generation-stage-structure
+[submodule "common/addons/language-yaml"]
+ path = common/addons/language-yaml
+ url = https://github.com/PolyhedralDev/Terra-language-yaml
+[submodule "common/addons/manifest-addon-loader"]
+ path = common/addons/manifest-addon-loader
+ url = https://github.com/PolyhedralDev/Terra-manifest-addon-loader
+[submodule "common/addons/structure-sponge-loader"]
+ path = common/addons/structure-sponge-loader
+ url = https://github.com/PolyhedralDev/Terra-structure-sponge-loader
+[submodule "common/addons/structure-terrascript-loader"]
+ path = common/addons/structure-terrascript-loader
+ url = https://github.com/PolyhedralDev/Terra-structure-terrascript-loader
+[submodule "common/addons/api-addon-loader"]
+ path = common/addons/api-addon-loader
+ url = https://github.com/PolyhedralDev/Terra-api-addon-loader
diff --git a/README.md b/README.md
index 16c972468..0254fb952 100644
--- a/README.md
+++ b/README.md
@@ -1,15 +1,31 @@
+
+
+
# Terra
-Terra is an incredibly powerful free & open-source data-driven,
-platform-agnostic world generator. It allows you to create a world exactly to
-your specifications, with no knowledge of Java required.
+Terra is a modern world generation modding platform, primarily for Minecraft.
+Terra allows complete customization of world generation with an advanced API,
+tightly integrated with a powerful configuration system.
+
+Terra consists of several parts:
+
+* A voxel world generation API with emphasis on configuration and extensibility
+* Several platform implementations, the layer between the API and the platform
+ it's running on.
+* An addon loader, which allows interfacing with the Terra API in a
+ platform-agnostic setting
+* Several "core addons," which implement the "default" configurations of Terra.
+ These addons can be thought of as the config "standard library"
+
+Terra currently officially supports the Fabric mod loader and the Bukkit API
+(Paper and friends). We welcome Pull Requests implementing additional platforms!
## Downloads:
-* Paper+ servers (Paper, Tuinity, Purpur,
- etc): [SpigotMC](https://www.spigotmc.org/resources/85151/)
* Fabric: [Modrinth](https://modrinth.com/mod/terra)
/ [CurseForge](https://www.curseforge.com/minecraft/mc-mods/terra-world-generator)
+* Paper+ servers (Paper, Tuinity, Purpur,
+ etc): [SpigotMC](https://www.spigotmc.org/resources/85151/)
## Building and Running Terra
diff --git a/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt b/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt
index 9602b51f3..279dcf74a 100644
--- a/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt
+++ b/buildSrc/src/main/kotlin/com/dfsek/terra/AddonConfig.kt
@@ -5,6 +5,7 @@ import java.util.function.Predicate
import org.gradle.api.Project
import org.gradle.api.Task
import org.gradle.jvm.tasks.Jar
+import org.gradle.kotlin.dsl.extra
import kotlin.streams.asStream
@@ -23,7 +24,8 @@ fun Project.addonDir(dir: File, task: Task) {
project(":common:addons").subprojects.forEach { addonProject ->
val jar = (addonProject.tasks.named("jar").get() as Jar)
- val target = File(dir, jar.archiveFileName.get())
+ val boot = if (addonProject.project.extra.has("bootstrap") && addonProject.project.extra.get("bootstrap") as Boolean) "bootstrap/" else ""
+ val target = File(dir, boot + jar.archiveFileName.get())
val base = "${jar.archiveBaseName.get()}-${project.version}"
@@ -36,6 +38,6 @@ fun Project.addonDir(dir: File, task: Task) {
fun matchingAddons(dir: File, matcher: Predicate): Set {
val matching = HashSet()
- dir.walk().maxDepth(1).asStream().filter(matcher).forEach(matching::add)
+ dir.walk().asStream().filter(matcher).forEach(matching::add)
return matching
}
diff --git a/common/addons/api-addon-loader b/common/addons/api-addon-loader
new file mode 160000
index 000000000..ae2901876
--- /dev/null
+++ b/common/addons/api-addon-loader
@@ -0,0 +1 @@
+Subproject commit ae2901876b15f03846eabea3830d964b8bb30867
diff --git a/common/addons/biome-provider-image/README.md b/common/addons/biome-provider-image/README.md
deleted file mode 100644
index 49e9b8fdb..000000000
--- a/common/addons/biome-provider-image/README.md
+++ /dev/null
@@ -1,6 +0,0 @@
-# biome-provider-image
-
-Implements and registers the `IMAGE` biome provider, a biome provider which
-generates biomes from an image, using the `color` attribute of biomes.
-
-This addon registers the provider type, and all associated config options.
\ No newline at end of file
diff --git a/common/addons/biome-provider-image/build.gradle.kts b/common/addons/biome-provider-image/build.gradle.kts
deleted file mode 100644
index 7d82dc72f..000000000
--- a/common/addons/biome-provider-image/build.gradle.kts
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies {
-}
diff --git a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java
deleted file mode 100644
index 3ba0cb9ba..000000000
--- a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProvider.java
+++ /dev/null
@@ -1,64 +0,0 @@
-package com.dfsek.terra.addons.biome.image;
-
-import net.jafama.FastMath;
-
-import java.awt.Color;
-import java.awt.image.BufferedImage;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Set;
-
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class ImageBiomeProvider implements BiomeProvider {
- private final Map colorBiomeMap = new HashMap<>();
- private final BufferedImage image;
- private final int resolution;
- private final Align align;
-
- public ImageBiomeProvider(Set registry, BufferedImage image, int resolution, Align align) {
- this.image = image;
- this.resolution = resolution;
- this.align = align;
- registry.forEach(biome -> colorBiomeMap.put(new Color(biome.getColor()), biome));
- }
-
- private static int distance(Color a, Color b) {
- return FastMath.abs(a.getRed() - b.getRed()) + FastMath.abs(a.getGreen() - b.getGreen()) + FastMath.abs(a.getBlue() - b.getBlue());
- }
-
- @Override
- public TerraBiome getBiome(int x, int z, long seed) {
- x /= resolution;
- z /= resolution;
- Color color = align.getColor(image, x, z);
- return colorBiomeMap.get(colorBiomeMap.keySet()
- .stream()
- .reduce(colorBiomeMap.keySet().stream().findAny().orElseThrow(IllegalStateException::new),
- (running, element) -> {
- int d1 = distance(color, running);
- int d2 = distance(color, element);
- return d1 < d2 ? running : element;
- }));
- }
-
- public enum Align {
- CENTER {
- @Override
- public Color getColor(BufferedImage image, int x, int z) {
- return new Color(image.getRGB(FastMath.floorMod(x - image.getWidth() / 2, image.getWidth()),
- FastMath.floorMod(z - image.getHeight() / 2, image.getHeight())));
- }
- },
- NONE {
- @Override
- public Color getColor(BufferedImage image, int x, int z) {
- return new Color(image.getRGB(FastMath.floorMod(x, image.getWidth()), FastMath.floorMod(z, image.getHeight())));
- }
- };
-
- public abstract Color getColor(BufferedImage image, int x, int z);
- }
-}
diff --git a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java
deleted file mode 100644
index e2cf15bae..000000000
--- a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageBiomeProviderAddon.java
+++ /dev/null
@@ -1,43 +0,0 @@
-package com.dfsek.terra.addons.biome.image;
-
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import java.util.function.Supplier;
-
-import com.dfsek.terra.api.Platform;
-import com.dfsek.terra.api.addon.TerraAddon;
-import com.dfsek.terra.api.addon.annotations.Addon;
-import com.dfsek.terra.api.addon.annotations.Author;
-import com.dfsek.terra.api.addon.annotations.Version;
-import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
-import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
-import com.dfsek.terra.api.inject.annotations.Inject;
-import com.dfsek.terra.api.registry.CheckedRegistry;
-import com.dfsek.terra.api.util.reflection.TypeKey;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-@Addon("biome-provider-image")
-@Author("Terra")
-@Version("1.0.0")
-public class ImageBiomeProviderAddon extends TerraAddon {
- public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
- };
-
- @Inject
- private Platform platform;
-
- @Override
- public void initialize() {
- platform.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(
- PROVIDER_REGISTRY_KEY);
- providerRegistry.register("IMAGE", () -> new ImageProviderTemplate(event.getPack().getRegistry(TerraBiome.class)));
- })
- .failThrough();
- }
-}
diff --git a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java b/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java
deleted file mode 100644
index e82f4a004..000000000
--- a/common/addons/biome-provider-image/src/main/java/com/dfsek/terra/addons/biome/image/ImageProviderTemplate.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.dfsek.terra.addons.biome.image;
-
-import com.dfsek.tectonic.annotations.Default;
-import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import java.awt.image.BufferedImage;
-import java.util.HashSet;
-
-import com.dfsek.terra.api.registry.Registry;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class ImageProviderTemplate implements ObjectTemplate {
- private final Registry biomes;
- @Value("resolution")
- @Default
- private int resolution = 1;
- @Value("image.name")
- private BufferedImage image;
- @Value("image.align")
- private ImageBiomeProvider.Align align;
-
- public ImageProviderTemplate(Registry set) {
- this.biomes = set;
- }
-
- @Override
- public BiomeProvider get() {
- return new ImageBiomeProvider(new HashSet<>(biomes.entries()), image, resolution, align);
- }
-}
diff --git a/common/addons/biome-provider-pipeline b/common/addons/biome-provider-pipeline
new file mode 160000
index 000000000..daac9d4bb
--- /dev/null
+++ b/common/addons/biome-provider-pipeline
@@ -0,0 +1 @@
+Subproject commit daac9d4bb643c6bffa1a8afdf68b133461ced708
diff --git a/common/addons/biome-provider-pipeline/README.md b/common/addons/biome-provider-pipeline/README.md
deleted file mode 100644
index 9e55109a7..000000000
--- a/common/addons/biome-provider-pipeline/README.md
+++ /dev/null
@@ -1,7 +0,0 @@
-# biome-provider-pipeline
-
-Implements the Biome Pipeline, a procedural biome provider that uses a series
-of "stages" to apply "mutations" to a 2D grid of biomes.
-
-This addon registers the `PIPELINE` biome provider type, and all associated
-configurations.
\ No newline at end of file
diff --git a/common/addons/biome-provider-pipeline/build.gradle.kts b/common/addons/biome-provider-pipeline/build.gradle.kts
deleted file mode 100644
index 7d82dc72f..000000000
--- a/common/addons/biome-provider-pipeline/build.gradle.kts
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies {
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java
deleted file mode 100644
index b00939095..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomeHolderImpl.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeExpander;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import com.dfsek.terra.api.util.vector.Vector2;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class BiomeHolderImpl implements BiomeHolder {
- private final Vector2 origin;
- private final int width;
- private final int offset;
- private TerraBiome[][] biomes;
-
- public BiomeHolderImpl(int width, Vector2 origin) {
- width += 4;
- this.width = width;
- biomes = new TerraBiome[width][width];
- this.origin = origin;
- this.offset = 2;
- }
-
- private BiomeHolderImpl(TerraBiome[][] biomes, Vector2 origin, int width, int offset) {
- this.biomes = biomes;
- this.origin = origin;
- this.width = width;
- this.offset = 2 * offset;
- }
-
- @Override
- public BiomeHolder expand(BiomeExpander expander, long seed) {
- TerraBiome[][] old = biomes;
- int newWidth = width * 2 - 1;
-
- biomes = new TerraBiome[newWidth][newWidth];
-
- for(int x = 0; x < width; x++) {
- for(int z = 0; z < width; z++) {
- biomes[x * 2][z * 2] = old[x][z];
- if(z != width - 1)
- biomes[x * 2][z * 2 + 1] = expander.getBetween(x + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z],
- old[x][z + 1]);
- if(x != width - 1)
- biomes[x * 2 + 1][z * 2] = expander.getBetween(x + 1 + origin.getX(), z + origin.getZ(), seed, old[x][z],
- old[x + 1][z]);
- if(x != width - 1 && z != width - 1)
- biomes[x * 2 + 1][z * 2 + 1] = expander.getBetween(x + 1 + origin.getX(), z + 1 + origin.getZ(), seed, old[x][z],
- old[x + 1][z + 1], old[x][z + 1], old[x + 1][z]);
- }
- }
- return new BiomeHolderImpl(biomes, origin.setX(origin.getX() * 2 - 1).setZ(origin.getZ() * 2 - 1), newWidth, offset);
- }
-
- @Override
- public void mutate(BiomeMutator mutator, long seed) {
- for(int x = 0; x < width; x++) {
- for(int z = 0; z < width; z++) {
- BiomeMutator.ViewPoint viewPoint = new BiomeMutator.ViewPoint(this, x, z);
- biomes[x][z] = mutator.mutate(viewPoint, x + origin.getX(), z + origin.getZ(), seed);
- }
- }
- }
-
- @Override
- public void fill(BiomeSource source, long seed) {
- for(int x = 0; x < width; x++) {
- for(int z = 0; z < width; z++) {
- biomes[x][z] = source.getBiome(origin.getX() + x, origin.getZ() + z, seed);
- }
- }
- }
-
- @Override
- public TerraBiome getBiome(int x, int z) {
- x += offset;
- z += offset;
- return getBiomeRaw(x, z);
- }
-
- @Override
- public TerraBiome getBiomeRaw(int x, int z) {
- if(x >= width || z >= width || x < 0 || z < 0) return null;
- return biomes[x][z];
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java
deleted file mode 100644
index a9c013fbc..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipeline.java
+++ /dev/null
@@ -1,67 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import com.dfsek.terra.api.util.vector.Vector2;
-
-
-public class BiomePipeline {
- private final BiomeSource source;
- private final List stages;
- private final int size;
- private final int init;
-
- private BiomePipeline(BiomeSource source, List stages, int size, int init) {
- this.source = source;
- this.stages = stages;
- this.size = size;
- this.init = init;
- }
-
- /**
- * Get biomes in a chunk
- *
- * @param x Chunk X coord
- * @param z Chunk Z coord
- *
- * @return BiomeHolder containing biomes.
- */
- public BiomeHolder getBiomes(int x, int z, long seed) {
- BiomeHolder holder = new BiomeHolderImpl(init, new Vector2(x * (init - 1), z * (init - 1)));
- holder.fill(source, seed);
- for(Stage stage : stages) holder = stage.apply(holder, seed);
- return holder;
- }
-
- public int getSize() {
- return size;
- }
-
- public static final class BiomePipelineBuilder {
- private final int init;
- private final List stages = new ArrayList<>();
- private int expand;
-
- public BiomePipelineBuilder(int init) {
- this.init = init;
- expand = init;
- }
-
- public BiomePipeline build(BiomeSource source) {
- for(Stage stage : stages) {
- if(stage.isExpansion()) expand = expand * 2 - 1;
- }
-
- return new BiomePipeline(source, stages, expand, init);
- }
-
- public BiomePipelineBuilder addStage(Stage stage) {
- stages.add(stage);
- return this;
- }
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java
deleted file mode 100644
index 6b32bd6f9..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineAddon.java
+++ /dev/null
@@ -1,71 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline;
-
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import java.util.function.Supplier;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.BiomePipelineTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.NoiseSourceTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.expander.ExpanderStageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.BorderListMutatorTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.BorderMutatorTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.ReplaceListMutatorTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.ReplaceMutatorTemplate;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.mutator.SmoothMutatorTemplate;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import com.dfsek.terra.api.Platform;
-import com.dfsek.terra.api.addon.TerraAddon;
-import com.dfsek.terra.api.addon.annotations.Addon;
-import com.dfsek.terra.api.addon.annotations.Author;
-import com.dfsek.terra.api.addon.annotations.Version;
-import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
-import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
-import com.dfsek.terra.api.inject.annotations.Inject;
-import com.dfsek.terra.api.registry.CheckedRegistry;
-import com.dfsek.terra.api.util.reflection.TypeKey;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-@Addon("biome-provider-pipeline")
-@Author("Terra")
-@Version("1.0.0")
-public class BiomePipelineAddon extends TerraAddon {
-
- public static final TypeKey>> SOURCE_REGISTRY_KEY = new TypeKey<>() {
- };
-
- public static final TypeKey>> STAGE_REGISTRY_KEY = new TypeKey<>() {
- };
- public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
- };
- @Inject
- private Platform platform;
-
- @Override
- public void initialize() {
- platform.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(
- PROVIDER_REGISTRY_KEY);
- providerRegistry.register("PIPELINE", () -> new BiomePipelineTemplate(platform));
- })
- .then(event -> {
- CheckedRegistry>> sourceRegistry = event.getPack().getOrCreateRegistry(
- SOURCE_REGISTRY_KEY);
- sourceRegistry.register("NOISE", NoiseSourceTemplate::new);
- })
- .then(event -> {
- CheckedRegistry>> stageRegistry = event.getPack().getOrCreateRegistry(STAGE_REGISTRY_KEY);
- stageRegistry.register("FRACTAL_EXPAND", ExpanderStageTemplate::new);
- stageRegistry.register("SMOOTH", SmoothMutatorTemplate::new);
- stageRegistry.register("REPLACE", ReplaceMutatorTemplate::new);
- stageRegistry.register("REPLACE_LIST", ReplaceListMutatorTemplate::new);
- stageRegistry.register("BORDER", BorderMutatorTemplate::new);
- stageRegistry.register("BORDER_LIST", BorderListMutatorTemplate::new);
- })
- .failThrough();
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java
deleted file mode 100644
index 64fbeed18..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/BiomePipelineProvider.java
+++ /dev/null
@@ -1,84 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline;
-
-import com.google.common.cache.CacheBuilder;
-import com.google.common.cache.CacheLoader;
-import com.google.common.cache.LoadingCache;
-import net.jafama.FastMath;
-import org.jetbrains.annotations.NotNull;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
-import com.dfsek.terra.api.Platform;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class BiomePipelineProvider implements BiomeProvider {
- private final LoadingCache holderCache;
- private final BiomePipeline pipeline;
- private final int resolution;
- private final NoiseSampler mutator;
- private final double noiseAmp;
-
- public BiomePipelineProvider(BiomePipeline pipeline, Platform platform, int resolution, NoiseSampler mutator, double noiseAmp) {
- this.resolution = resolution;
- this.mutator = mutator;
- this.noiseAmp = noiseAmp;
- holderCache = CacheBuilder.newBuilder()
- .maximumSize(platform == null ? 32 : platform.getTerraConfig().getProviderCache())
- .build(
- new CacheLoader<>() {
- @Override
- public BiomeHolder load(@NotNull SeededVector key) {
- return pipeline.getBiomes(key.x, key.z, key.seed);
- }
- }
- );
- this.pipeline = pipeline;
- }
-
- @Override
- public TerraBiome getBiome(int x, int z, long seed) {
- x += mutator.getNoiseSeeded(seed + 1, x, z) * noiseAmp;
- z += mutator.getNoiseSeeded(seed + 2, x, z) * noiseAmp;
-
-
- x = FastMath.floorToInt(FastMath.floorDiv(x, resolution));
-
- z = FastMath.floorToInt(FastMath.floorDiv(z, resolution));
-
- int fdX = FastMath.floorDiv(x, pipeline.getSize());
- int fdZ = FastMath.floorDiv(z, pipeline.getSize());
- return holderCache.getUnchecked(new SeededVector(fdX, fdZ, seed)).getBiome(x - fdX * pipeline.getSize(),
- z - fdZ * pipeline.getSize());
- }
-
- private static final class SeededVector {
- private final int x;
- private final int z;
- private final long seed;
-
- private SeededVector(int x, int z, long seed) {
- this.x = x;
- this.z = z;
- this.seed = seed;
- }
-
- @Override
- public int hashCode() {
- int result = 0;
- result = 31 * result + ((int) (seed ^ (seed >>> 32)));
- result = 31 * result + x;
- result = 31 * result + z;
- return result;
- }
-
- @Override
- public boolean equals(Object obj) {
- if(!(obj instanceof SeededVector)) return false;
- SeededVector that = (SeededVector) obj;
-
- return this.seed == that.seed && this.x == that.x && this.z == that.z;
- }
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java
deleted file mode 100644
index 462f8ebec..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeExpander.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.api;
-
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public interface BiomeExpander {
- TerraBiome getBetween(double x, double z, long seed, TerraBiome... others);
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java
deleted file mode 100644
index bf88c46e2..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeHolder.java
+++ /dev/null
@@ -1,17 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.api;
-
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public interface BiomeHolder {
- BiomeHolder expand(BiomeExpander expander, long seed);
-
- void mutate(BiomeMutator mutator, long seed);
-
- void fill(BiomeSource source, long seed);
-
- TerraBiome getBiome(int x, int z);
-
- TerraBiome getBiomeRaw(int x, int z);
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java
deleted file mode 100644
index fab417815..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/BiomeMutator.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.api;
-
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public interface BiomeMutator {
- TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed);
-
- class ViewPoint {
- private final BiomeHolder biomes;
- private final int offX;
- private final int offZ;
-
- public ViewPoint(BiomeHolder biomes, int offX, int offZ) {
- this.biomes = biomes;
- this.offX = offX;
- this.offZ = offZ;
- }
-
-
- public TerraBiome getBiome(int x, int z) {
- return biomes.getBiomeRaw(x + offX, z + offZ);
- }
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java
deleted file mode 100644
index af00308c3..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/api/Stage.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.api;
-
-public interface Stage {
- BiomeHolder apply(BiomeHolder in, long seed);
-
- boolean isExpansion();
-
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java
deleted file mode 100644
index 84548fbef..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomePipelineTemplate.java
+++ /dev/null
@@ -1,41 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config;
-
-import com.dfsek.tectonic.annotations.Default;
-import com.dfsek.tectonic.annotations.Value;
-
-import java.util.List;
-
-import com.dfsek.terra.addons.biome.pipeline.BiomePipeline;
-import com.dfsek.terra.addons.biome.pipeline.BiomePipelineProvider;
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import com.dfsek.terra.api.Platform;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-@SuppressWarnings({ "FieldMayBeFinal", "unused" })
-public class BiomePipelineTemplate extends BiomeProviderTemplate {
- private final Platform platform;
- @Value("pipeline.initial-size")
- @Default
- private @Meta int initialSize = 2;
-
- @Value("pipeline.stages")
- private @Meta List<@Meta Stage> stages;
-
- @Value("pipeline.source")
- private @Meta BiomeSource source;
-
- public BiomePipelineTemplate(Platform platform) {
- this.platform = platform;
- }
-
- @Override
- public BiomeProvider get() {
- BiomePipeline.BiomePipelineBuilder biomePipelineBuilder = new BiomePipeline.BiomePipelineBuilder(initialSize);
- stages.forEach(biomePipelineBuilder::addStage);
- BiomePipeline pipeline = biomePipelineBuilder.build(source);
- return new BiomePipelineProvider(pipeline, platform, resolution, blend, blendAmp);
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java
deleted file mode 100644
index a254082ca..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderLoader.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config;
-
-import com.dfsek.tectonic.exception.LoadException;
-import com.dfsek.tectonic.loading.ConfigLoader;
-import com.dfsek.tectonic.loading.TypeLoader;
-
-import java.lang.reflect.AnnotatedType;
-
-import com.dfsek.terra.addons.biome.pipeline.BiomePipelineProvider;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class BiomeProviderLoader implements TypeLoader {
- @Override
- public BiomeProvider load(AnnotatedType t, Object c, ConfigLoader loader) throws LoadException {
- return loader.loadType(BiomePipelineProvider.class, c); // TODO: actually implement this lol
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java
deleted file mode 100644
index c1aa496cb..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/BiomeProviderTemplate.java
+++ /dev/null
@@ -1,22 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config;
-
-import com.dfsek.tectonic.annotations.Default;
-import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public abstract class BiomeProviderTemplate implements ObjectTemplate {
- @Value("resolution")
- @Default
- protected @Meta int resolution = 1;
- @Value("blend.noise")
- @Default
- protected @Meta NoiseSampler blend = NoiseSampler.zero();
- @Value("blend.amplitude")
- @Default
- protected @Meta double blendAmp = 0d;
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java
deleted file mode 100644
index 627146800..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/NoiseSourceTemplate.java
+++ /dev/null
@@ -1,24 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config;
-
-import com.dfsek.tectonic.annotations.Value;
-
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-import com.dfsek.terra.addons.biome.pipeline.source.NoiseSource;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class NoiseSourceTemplate extends SourceTemplate {
- @Value("noise")
- private @Meta NoiseSampler noise;
-
- @Value("biomes")
- private @Meta ProbabilityCollection<@Meta TerraBiome> biomes;
-
- @Override
- public BiomeSource get() {
- return new NoiseSource(biomes, noise);
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java
deleted file mode 100644
index 831ca3d88..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/SourceTemplate.java
+++ /dev/null
@@ -1,10 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config;
-
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import com.dfsek.terra.addons.biome.pipeline.source.BiomeSource;
-
-
-public abstract class SourceTemplate implements ObjectTemplate {
-
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java
deleted file mode 100644
index 4b491e482..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/StageTemplate.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage;
-
-import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.noise.NoiseSampler;
-
-
-public abstract class StageTemplate implements ObjectTemplate {
- @Value("noise")
- protected @Meta NoiseSampler noise;
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java
deleted file mode 100644
index ea74a303a..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/expander/ExpanderStageTemplate.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage.expander;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.expand.FractalExpander;
-import com.dfsek.terra.addons.biome.pipeline.stages.ExpanderStage;
-
-
-public class ExpanderStageTemplate extends StageTemplate {
- @Override
- public Stage get() {
- return new ExpanderStage(new FractalExpander(noise));
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java
deleted file mode 100644
index 136243bc2..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderListMutatorTemplate.java
+++ /dev/null
@@ -1,35 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
-
-import com.dfsek.tectonic.annotations.Value;
-
-import java.util.Map;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.mutator.BorderListMutator;
-import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-@SuppressWarnings("unused")
-public class BorderListMutatorTemplate extends StageTemplate {
- @Value("from")
- private @Meta String from;
-
- @Value("default-replace")
- private @Meta String defaultReplace;
-
- @Value("default-to")
- private @Meta ProbabilityCollection<@Meta TerraBiome> defaultTo;
-
- @Value("replace")
- private @Meta Map<@Meta TerraBiome, @Meta ProbabilityCollection<@Meta TerraBiome>> replace;
-
-
- @Override
- public Stage get() {
- return new MutatorStage(new BorderListMutator(replace, from, defaultReplace, noise, defaultTo));
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java
deleted file mode 100644
index 6632bf6bb..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/BorderMutatorTemplate.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
-
-import com.dfsek.tectonic.annotations.Value;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.mutator.BorderMutator;
-import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-@SuppressWarnings("unused")
-public class BorderMutatorTemplate extends StageTemplate {
- @Value("from")
- private @Meta String from;
-
- @Value("replace")
- private @Meta String replace;
-
- @Value("to")
- private @Meta ProbabilityCollection<@Meta TerraBiome> to;
-
- @Override
- public Stage get() {
- return new MutatorStage(new BorderMutator(from, replace, noise, to));
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java
deleted file mode 100644
index 5a21ec95b..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceListMutatorTemplate.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
-
-import com.dfsek.tectonic.annotations.Value;
-
-import java.util.Map;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.mutator.ReplaceListMutator;
-import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-@SuppressWarnings("unused")
-public class ReplaceListMutatorTemplate extends StageTemplate {
- @Value("default-from")
- private @Meta String defaultFrom;
-
- @Value("default-to")
- private @Meta ProbabilityCollection<@Meta TerraBiome> defaultTo;
-
- @Value("to")
- private @Meta Map<@Meta TerraBiome, @Meta ProbabilityCollection<@Meta TerraBiome>> replace;
-
- @Override
- public Stage get() {
- return new MutatorStage(new ReplaceListMutator(replace, defaultFrom, defaultTo, noise));
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java
deleted file mode 100644
index 6dd7196c2..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/ReplaceMutatorTemplate.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
-
-import com.dfsek.tectonic.annotations.Value;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.mutator.ReplaceMutator;
-import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-@SuppressWarnings("unused")
-public class ReplaceMutatorTemplate extends StageTemplate {
- @Value("from")
- private @Meta String from;
-
- @Value("to")
- private @Meta ProbabilityCollection<@Meta TerraBiome> to;
-
- @Override
- public Stage get() {
- return new MutatorStage(new ReplaceMutator(from, to, noise));
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java
deleted file mode 100644
index 400779433..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/config/stage/mutator/SmoothMutatorTemplate.java
+++ /dev/null
@@ -1,14 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.config.stage.mutator;
-
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-import com.dfsek.terra.addons.biome.pipeline.config.stage.StageTemplate;
-import com.dfsek.terra.addons.biome.pipeline.mutator.SmoothMutator;
-import com.dfsek.terra.addons.biome.pipeline.stages.MutatorStage;
-
-
-public class SmoothMutatorTemplate extends StageTemplate {
- @Override
- public Stage get() {
- return new MutatorStage(new SmoothMutator(noise));
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java
deleted file mode 100644
index 39050c873..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/expand/FractalExpander.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.expand;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeExpander;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.MathUtil;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class FractalExpander implements BiomeExpander {
- private final NoiseSampler sampler;
-
- public FractalExpander(NoiseSampler sampler) {
- this.sampler = sampler;
- }
-
- @Override
- public TerraBiome getBetween(double x, double z, long seed, TerraBiome... others) {
- return others[MathUtil.normalizeIndex(sampler.getNoiseSeeded(seed, x, z), others.length)];
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java
deleted file mode 100644
index ff8570001..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderListMutator.java
+++ /dev/null
@@ -1,49 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.mutator;
-
-import java.util.Map;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class BorderListMutator implements BiomeMutator {
- private final String border;
- private final NoiseSampler noiseSampler;
- private final ProbabilityCollection replaceDefault;
- private final String defaultReplace;
- private final Map> replace;
-
- public BorderListMutator(Map> replace, String border, String defaultReplace,
- NoiseSampler noiseSampler, ProbabilityCollection replaceDefault) {
- this.border = border;
- this.noiseSampler = noiseSampler;
- this.replaceDefault = replaceDefault;
- this.defaultReplace = defaultReplace;
- this.replace = replace;
- }
-
- @Override
- public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
- TerraBiome origin = viewPoint.getBiome(0, 0);
- if(origin.getTags().contains(defaultReplace)) {
- for(int xi = -1; xi <= 1; xi++) {
- for(int zi = -1; zi <= 1; zi++) {
- if(xi == 0 && zi == 0) continue;
- TerraBiome current = viewPoint.getBiome(xi, zi);
- if(current == null) continue;
- if(current.getTags().contains(border)) {
- if(replace.containsKey(origin)) {
- TerraBiome biome = replace.get(origin).get(noiseSampler, x, z, seed);
- return biome == null ? origin : biome;
- }
- TerraBiome biome = replaceDefault.get(noiseSampler, x, z, seed);
- return biome == null ? origin : biome;
- }
- }
- }
- }
- return origin;
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java
deleted file mode 100644
index 6bd5c39c8..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/BorderMutator.java
+++ /dev/null
@@ -1,40 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.mutator;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class BorderMutator implements BiomeMutator {
- private final String border;
- private final NoiseSampler noiseSampler;
- private final ProbabilityCollection replace;
- private final String replaceTag;
-
- public BorderMutator(String border, String replaceTag, NoiseSampler noiseSampler, ProbabilityCollection replace) {
- this.border = border;
- this.noiseSampler = noiseSampler;
- this.replace = replace;
- this.replaceTag = replaceTag;
- }
-
- @Override
- public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
- TerraBiome origin = viewPoint.getBiome(0, 0);
- if(origin.getTags().contains(replaceTag)) {
- for(int xi = -1; xi <= 1; xi++) {
- for(int zi = -1; zi <= 1; zi++) {
- if(xi == 0 && zi == 0) continue;
- TerraBiome current = viewPoint.getBiome(xi, zi);
- if(current == null) continue;
- if(current.getTags().contains(border)) {
- TerraBiome biome = replace.get(noiseSampler, x, z, seed);
- return biome == null ? origin : biome;
- }
- }
- }
- }
- return origin;
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java
deleted file mode 100644
index 4712d41a7..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceListMutator.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.mutator;
-
-import java.util.Map;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class ReplaceListMutator implements BiomeMutator {
- private final Map> replace;
- private final NoiseSampler sampler;
- private final ProbabilityCollection replaceDefault;
- private final String defaultTag;
-
- public ReplaceListMutator(Map> replace, String defaultTag,
- ProbabilityCollection replaceDefault, NoiseSampler sampler) {
- this.replace = replace;
- this.sampler = sampler;
- this.defaultTag = defaultTag;
- this.replaceDefault = replaceDefault;
- }
-
- @Override
- public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
- TerraBiome center = viewPoint.getBiome(0, 0);
- if(replace.containsKey(center)) {
- TerraBiome biome = replace.get(center).get(sampler, x, z, seed);
- return biome == null ? viewPoint.getBiome(0, 0) : biome;
- }
- if(viewPoint.getBiome(0, 0).getTags().contains(defaultTag)) {
- TerraBiome biome = replaceDefault.get(sampler, x, z, seed);
- return biome == null ? viewPoint.getBiome(0, 0) : biome;
- }
- return center;
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java
deleted file mode 100644
index df77f796d..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/ReplaceMutator.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.mutator;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class ReplaceMutator implements BiomeMutator {
- private final String replaceableTag;
- private final ProbabilityCollection replace;
- private final NoiseSampler sampler;
-
- public ReplaceMutator(String replaceable, ProbabilityCollection replace, NoiseSampler sampler) {
- this.replaceableTag = replaceable;
- this.replace = replace;
- this.sampler = sampler;
- }
-
- @Override
- public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
- if(viewPoint.getBiome(0, 0).getTags().contains(replaceableTag)) {
- TerraBiome biome = replace.get(sampler, x, z, seed);
- return biome == null ? viewPoint.getBiome(0, 0) : biome;
- }
- return viewPoint.getBiome(0, 0);
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java
deleted file mode 100644
index 3ac06370c..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/mutator/SmoothMutator.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.mutator;
-
-import java.util.Objects;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.MathUtil;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class SmoothMutator implements BiomeMutator {
-
- private final NoiseSampler sampler;
-
- public SmoothMutator(NoiseSampler sampler) {
- this.sampler = sampler;
- }
-
- @Override
- public TerraBiome mutate(ViewPoint viewPoint, double x, double z, long seed) {
- TerraBiome top = viewPoint.getBiome(1, 0);
- TerraBiome bottom = viewPoint.getBiome(-1, 0);
- TerraBiome left = viewPoint.getBiome(0, 1);
- TerraBiome right = viewPoint.getBiome(0, -1);
-
-
- boolean vert = Objects.equals(top, bottom) && top != null;
- boolean horiz = Objects.equals(left, right) && left != null;
-
- if(vert && horiz) {
- return MathUtil.normalizeIndex(sampler.getNoiseSeeded(seed, x, z), 2) == 0 ? left : top;
- }
-
- if(vert) return top;
- if(horiz) return left;
-
- return viewPoint.getBiome(0, 0);
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java
deleted file mode 100644
index 694a820cf..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/BiomeSource.java
+++ /dev/null
@@ -1,8 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.source;
-
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public interface BiomeSource {
- TerraBiome getBiome(double x, double z, long seed);
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java
deleted file mode 100644
index d7846a917..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/source/NoiseSource.java
+++ /dev/null
@@ -1,21 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.source;
-
-import com.dfsek.terra.api.noise.NoiseSampler;
-import com.dfsek.terra.api.util.collection.ProbabilityCollection;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-
-
-public class NoiseSource implements BiomeSource {
- private final ProbabilityCollection biomes;
- private final NoiseSampler sampler;
-
- public NoiseSource(ProbabilityCollection biomes, NoiseSampler sampler) {
- this.biomes = biomes;
- this.sampler = sampler;
- }
-
- @Override
- public TerraBiome getBiome(double x, double z, long seed) {
- return biomes.get(sampler, x, z, seed);
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java
deleted file mode 100644
index 6fe1eab4e..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/ExpanderStage.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.stages;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeExpander;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-
-
-public class ExpanderStage implements Stage {
- private final BiomeExpander expander;
-
- public ExpanderStage(BiomeExpander expander) {
- this.expander = expander;
- }
-
- @Override
- public BiomeHolder apply(BiomeHolder in, long seed) {
- return in.expand(expander, seed);
- }
-
- @Override
- public boolean isExpansion() {
- return true;
- }
-
- public enum Type {
- FRACTAL
- }
-}
diff --git a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java b/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java
deleted file mode 100644
index e1b42fb3c..000000000
--- a/common/addons/biome-provider-pipeline/src/main/java/com/dfsek/terra/addons/biome/pipeline/stages/MutatorStage.java
+++ /dev/null
@@ -1,33 +0,0 @@
-package com.dfsek.terra.addons.biome.pipeline.stages;
-
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeHolder;
-import com.dfsek.terra.addons.biome.pipeline.api.BiomeMutator;
-import com.dfsek.terra.addons.biome.pipeline.api.Stage;
-
-
-public class MutatorStage implements Stage {
- private final BiomeMutator mutator;
-
- public MutatorStage(BiomeMutator mutator) {
- this.mutator = mutator;
- }
-
- @Override
- public BiomeHolder apply(BiomeHolder in, long seed) {
- in.mutate(mutator, seed);
- return in;
- }
-
- @Override
- public boolean isExpansion() {
- return false;
- }
-
- public enum Type {
- REPLACE,
- REPLACE_LIST,
- BORDER,
- BORDER_LIST,
- SMOOTH
- }
-}
diff --git a/common/addons/biome-provider-single/README.md b/common/addons/biome-provider-single/README.md
deleted file mode 100644
index 3bea8cbb5..000000000
--- a/common/addons/biome-provider-single/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# biome-provider-single
-
-Registers and configures the `SINGLE` biome provider, a biome provider which
-accepts a single biome to generate continuously.
\ No newline at end of file
diff --git a/common/addons/biome-provider-single/build.gradle.kts b/common/addons/biome-provider-single/build.gradle.kts
deleted file mode 100644
index 7d82dc72f..000000000
--- a/common/addons/biome-provider-single/build.gradle.kts
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies {
-}
diff --git a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java
deleted file mode 100644
index 694da0b8d..000000000
--- a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProvider.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.dfsek.terra.addons.biome.single;
-
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class SingleBiomeProvider implements BiomeProvider {
- private final TerraBiome biome;
-
- public SingleBiomeProvider(TerraBiome biome) {
- this.biome = biome;
- }
-
- @Override
- public TerraBiome getBiome(int x, int z, long seed) {
- return biome;
- }
-}
diff --git a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java
deleted file mode 100644
index d5ea2cee7..000000000
--- a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderAddon.java
+++ /dev/null
@@ -1,42 +0,0 @@
-package com.dfsek.terra.addons.biome.single;
-
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import java.util.function.Supplier;
-
-import com.dfsek.terra.api.Platform;
-import com.dfsek.terra.api.addon.TerraAddon;
-import com.dfsek.terra.api.addon.annotations.Addon;
-import com.dfsek.terra.api.addon.annotations.Author;
-import com.dfsek.terra.api.addon.annotations.Version;
-import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
-import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
-import com.dfsek.terra.api.inject.annotations.Inject;
-import com.dfsek.terra.api.registry.CheckedRegistry;
-import com.dfsek.terra.api.util.reflection.TypeKey;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-@Addon("biome-provider-single")
-@Author("Terra")
-@Version("1.0.0")
-public class SingleBiomeProviderAddon extends TerraAddon {
- public static final TypeKey>> PROVIDER_REGISTRY_KEY = new TypeKey<>() {
- };
-
- @Inject
- private Platform platform;
-
- @Override
- public void initialize() {
- platform.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- CheckedRegistry>> providerRegistry = event.getPack().getOrCreateRegistry(
- PROVIDER_REGISTRY_KEY);
- providerRegistry.register("SINGLE", SingleBiomeProviderTemplate::new);
- })
- .failThrough();
- }
-}
diff --git a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java b/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java
deleted file mode 100644
index 034c7887b..000000000
--- a/common/addons/biome-provider-single/src/main/java/com/dfsek/terra/addons/biome/single/SingleBiomeProviderTemplate.java
+++ /dev/null
@@ -1,19 +0,0 @@
-package com.dfsek.terra.addons.biome.single;
-
-import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class SingleBiomeProviderTemplate implements ObjectTemplate {
- @Value("biome")
- private @Meta TerraBiome biome;
-
- @Override
- public BiomeProvider get() {
- return new SingleBiomeProvider(biome);
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/README.md b/common/addons/chunk-generator-noise-3d/README.md
deleted file mode 100644
index b235df2e6..000000000
--- a/common/addons/chunk-generator-noise-3d/README.md
+++ /dev/null
@@ -1,4 +0,0 @@
-# chunk-generator-noise-3d
-
-Registers the `NOISE_3D` chunk generator, a chunk generator which uses biomes'
-samplers in 3D to generate chunk data.
\ No newline at end of file
diff --git a/common/addons/chunk-generator-noise-3d/build.gradle.kts b/common/addons/chunk-generator-noise-3d/build.gradle.kts
deleted file mode 100644
index 7d82dc72f..000000000
--- a/common/addons/chunk-generator-noise-3d/build.gradle.kts
+++ /dev/null
@@ -1,2 +0,0 @@
-dependencies {
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java
deleted file mode 100644
index 037bcde3f..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/BiomePaletteTemplate.java
+++ /dev/null
@@ -1,30 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator;
-
-import com.dfsek.tectonic.annotations.Default;
-import com.dfsek.tectonic.annotations.Value;
-import com.dfsek.tectonic.loading.object.ObjectTemplate;
-
-import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
-import com.dfsek.terra.addons.chunkgenerator.palette.PaletteInfo;
-import com.dfsek.terra.addons.chunkgenerator.palette.SlantHolder;
-import com.dfsek.terra.api.config.meta.Meta;
-import com.dfsek.terra.api.world.generator.Palette;
-
-
-public class BiomePaletteTemplate implements ObjectTemplate {
- @Value("slant")
- @Default
- private @Meta SlantHolder slant;
- @Value("palette")
- private @Meta PaletteHolder palette;
- @Value("ocean.level")
- private @Meta int seaLevel;
-
- @Value("ocean.palette")
- private @Meta Palette oceanPalette;
-
- @Override
- public PaletteInfo get() {
- return new PaletteInfo(palette, slant, oceanPalette, seaLevel);
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java
deleted file mode 100644
index a488049cb..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/NoiseChunkGenerator3DAddon.java
+++ /dev/null
@@ -1,53 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator;
-
-import com.dfsek.terra.addons.chunkgenerator.generation.generators.NoiseChunkGenerator3D;
-import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolder;
-import com.dfsek.terra.addons.chunkgenerator.palette.PaletteHolderLoader;
-import com.dfsek.terra.addons.chunkgenerator.palette.SlantHolder;
-import com.dfsek.terra.addons.chunkgenerator.palette.SlantHolderLoader;
-import com.dfsek.terra.api.Platform;
-import com.dfsek.terra.api.addon.TerraAddon;
-import com.dfsek.terra.api.addon.annotations.Addon;
-import com.dfsek.terra.api.addon.annotations.Author;
-import com.dfsek.terra.api.addon.annotations.Version;
-import com.dfsek.terra.api.event.events.config.ConfigurationLoadEvent;
-import com.dfsek.terra.api.event.events.config.pack.ConfigPackPreLoadEvent;
-import com.dfsek.terra.api.event.functional.FunctionalEventHandler;
-import com.dfsek.terra.api.inject.annotations.Inject;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.generator.ChunkGeneratorProvider;
-
-
-@Addon("chunk-generator-noise-3d")
-@Author("Terra")
-@Version("1.0.0")
-public class NoiseChunkGenerator3DAddon extends TerraAddon {
- @Inject
- private Platform platform;
-
- @Override
- public void initialize() {
- platform.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigPackPreLoadEvent.class)
- .then(event -> {
- event.getPack().getOrCreateRegistry(ChunkGeneratorProvider.class).register("NOISE_3D",
- pack -> new NoiseChunkGenerator3D(pack,
- platform));
- event.getPack()
- .applyLoader(SlantHolder.class, new SlantHolderLoader())
- .applyLoader(PaletteHolder.class, new PaletteHolderLoader());
- })
- .failThrough();
-
- platform.getEventManager()
- .getHandler(FunctionalEventHandler.class)
- .register(this, ConfigurationLoadEvent.class)
- .then(event -> {
- if(event.is(TerraBiome.class)) {
- event.getLoadedObject(TerraBiome.class).getContext().put(event.load(new BiomePaletteTemplate()).get());
- }
- })
- .failThrough();
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java
deleted file mode 100644
index b7901d716..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/PaletteUtil.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator;
-
-import com.dfsek.terra.addons.chunkgenerator.palette.PaletteInfo;
-import com.dfsek.terra.addons.chunkgenerator.palette.SlantHolder;
-import com.dfsek.terra.api.util.MathUtil;
-import com.dfsek.terra.api.world.biome.GenerationSettings;
-import com.dfsek.terra.api.world.generator.Palette;
-import com.dfsek.terra.api.util.math.Sampler;
-
-
-public final class PaletteUtil {
- public static Palette getPalette(int x, int y, int z, GenerationSettings c, Sampler sampler, PaletteInfo paletteInfo) {
- SlantHolder slant = paletteInfo.getSlantHolder();
- if(slant != null) {
- double slope = MathUtil.derivative(sampler, x, y, z);
- if(slope > slant.getMinSlope()) {
- return slant.getPalette(slope).getPalette(y);
- }
- }
-
- return paletteInfo.getPaletteHolder().getPalette(y);
- }
-}
\ No newline at end of file
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java
deleted file mode 100644
index 680bb130b..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/generators/NoiseChunkGenerator3D.java
+++ /dev/null
@@ -1,197 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.generators;
-
-import com.dfsek.terra.api.Platform;
-
-import net.jafama.FastMath;
-import org.jetbrains.annotations.NotNull;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import com.dfsek.terra.addons.chunkgenerator.PaletteUtil;
-import com.dfsek.terra.addons.chunkgenerator.generation.math.samplers.Sampler3D;
-import com.dfsek.terra.addons.chunkgenerator.palette.PaletteInfo;
-import com.dfsek.terra.api.block.state.BlockState;
-import com.dfsek.terra.api.block.state.properties.base.Properties;
-import com.dfsek.terra.api.block.state.properties.enums.Direction;
-import com.dfsek.terra.api.config.ConfigPack;
-import com.dfsek.terra.api.profiler.ProfileFrame;
-import com.dfsek.terra.api.util.vector.Vector3;
-import com.dfsek.terra.api.world.BiomeGrid;
-import com.dfsek.terra.api.world.World;
-import com.dfsek.terra.api.world.biome.GenerationSettings;
-import com.dfsek.terra.api.world.biome.TerraBiome;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.dfsek.terra.api.world.generator.ChunkData;
-import com.dfsek.terra.api.world.generator.ChunkGenerator;
-import com.dfsek.terra.api.world.generator.GenerationStage;
-import com.dfsek.terra.api.world.generator.Palette;
-import com.dfsek.terra.api.util.math.Sampler;
-
-
-public class NoiseChunkGenerator3D implements ChunkGenerator {
- private static final Logger logger = LoggerFactory.getLogger(NoiseChunkGenerator3D.class);
-
- private final ConfigPack configPack;
- private final Platform platform;
- private final List generationStages = new ArrayList<>();
-
- private final BlockState air;
-
- public NoiseChunkGenerator3D(ConfigPack c, Platform platform) {
- this.configPack = c;
- this.platform = platform;
- this.air = platform.getWorldHandle().air();
- c.getStages().forEach(stage -> generationStages.add(stage.newInstance(c)));
- }
-
- @SuppressWarnings("try")
- static void biomes(@NotNull World world, int chunkX, int chunkZ, @NotNull BiomeGrid biome, Platform platform) {
- try(ProfileFrame ignore = platform.getProfiler().profile("biomes")) {
- int xOrig = (chunkX << 4);
- int zOrig = (chunkZ << 4);
- long seed = world.getSeed();
- BiomeProvider grid = world.getBiomeProvider();
- for(int x = 0; x < 4; x++) {
- for(int z = 0; z < 4; z++) {
- int cx = xOrig + (x << 2);
- int cz = zOrig + (z << 2);
- TerraBiome b = grid.getBiome(cx, cz, seed);
-
- biome.setBiome(cx, cz, b.getVanillaBiomes().get(b.getGenerator().getBiomeNoise(), cx, 0, cz, world.getSeed()));
- }
- }
- }
- }
-
- @Override
- @SuppressWarnings("try")
- public ChunkData generateChunkData(@NotNull World world, Random random, int chunkX, int chunkZ, ChunkData chunk) {
- try(ProfileFrame ignore = platform.getProfiler().profile("chunk_base_3d")) {
- BiomeProvider grid = world.getBiomeProvider();
-
- int xOrig = (chunkX << 4);
- int zOrig = (chunkZ << 4);
-
- Sampler sampler = world.getConfig().getSamplerCache().getChunk(chunkX, chunkZ);
-
- long seed = world.getSeed();
-
- for(int x = 0; x < 16; x++) {
- for(int z = 0; z < 16; z++) {
- int paletteLevel = 0;
-
- int cx = xOrig + x;
- int cz = zOrig + z;
-
- TerraBiome biome = grid.getBiome(cx, cz, seed);
-
- PaletteInfo paletteInfo = biome.getContext().get(PaletteInfo.class);
-
- if(paletteInfo == null) {
- logger.info("null palette: {}", biome.getID());
- }
-
- GenerationSettings generationSettings = biome.getGenerator();
-
- int sea = paletteInfo.getSeaLevel();
- Palette seaPalette = paletteInfo.getOcean();
-
- boolean justSet = false;
- BlockState data = null;
- for(int y = world.getMaxHeight() - 1; y >= world.getMinHeight(); y--) {
- if(sampler.sample(x, y, z) > 0) {
- justSet = true;
-
- data = PaletteUtil.getPalette(x, y, z, generationSettings, sampler, paletteInfo).get(paletteLevel, cx, y, cz,
- seed);
- chunk.setBlock(x, y, z, data);
-
- paletteLevel++;
- } else if(y <= sea) {
- chunk.setBlock(x, y, z, seaPalette.get(sea - y, x + xOrig, y, z + zOrig, seed));
-
- justSet = false;
- paletteLevel = 0;
- } else {
-
- justSet = false;
- paletteLevel = 0;
- }
- }
- }
- }
- return chunk;
- }
- }
-
- @Override
- public void generateBiomes(@NotNull World world, @NotNull Random random, int chunkX, int chunkZ, @NotNull BiomeGrid biome) {
- biomes(world, chunkX, chunkZ, biome, platform);
- }
-
- @Override
- public Sampler createSampler(int chunkX, int chunkZ, BiomeProvider provider, World world, int elevationSmooth) {
- return new Sampler3D(chunkX, chunkZ, provider, world, elevationSmooth);
- }
-
- @Override
- public ConfigPack getConfigPack() {
- return configPack;
- }
-
- @Override
- public Platform getPlatform() {
- return platform;
- }
-
- @Override
- public List getGenerationStages() {
- return generationStages;
- }
-
- @Override
- public BlockState getBlock(World world, int x, int y, int z) {
- BiomeProvider provider = world.getBiomeProvider();
- TerraBiome biome = provider.getBiome(x, z, world.getSeed());
- Sampler sampler = world.getConfig().getSamplerCache().get(x, z);
-
- PaletteInfo paletteInfo = biome.getContext().get(PaletteInfo.class);
- Palette palette = PaletteUtil.getPalette(x, y, z, biome.getGenerator(), sampler, paletteInfo);
- int fdX = FastMath.floorMod(x, 16);
- int fdZ = FastMath.floorMod(z, 16);
- double noise = sampler.sample(fdX, y, fdZ);
- if(noise > 0) {
- int level = 0;
- for(int yi = world.getMaxHeight() - 1; yi > y; yi--) {
- if(sampler.sample(fdX, yi, fdZ) > 0) level++;
- else level = 0;
- }
- return palette.get(level, x, y, z, world.getSeed());
- } else if(y <= paletteInfo.getSeaLevel()) {
- return paletteInfo.getOcean().get(paletteInfo.getSeaLevel() - y, x, y, z, world.getSeed());
- } else return air;
- }
-
- private boolean placeStair(BlockState orig, ChunkData chunk, Vector3 block, double thresh, Sampler sampler, BlockState stairNew) {
-
- if(sampler.sample(block.getBlockX() - 0.55, block.getY(), block.getZ()) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.WEST);
- } else if(sampler.sample(block.getBlockX(), block.getY(), block.getZ() - 0.55) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.NORTH);
- } else if(sampler.sample(block.getBlockX(), block.getY(), block.getZ() + 0.55) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.SOUTH);
- } else if(sampler.sample(block.getX() + 0.55, block.getY(), block.getZ()) > thresh) {
- stairNew.set(Properties.DIRECTION, Direction.EAST);
- } else stairNew = null;
- if(stairNew != null) {
- stairNew.setIfPresent(Properties.WATERLOGGED, orig.getBlockType().isWater());
- chunk.setBlock(block.getBlockX(), block.getBlockY(), block.getBlockZ(), stairNew);
- return true;
- }
- return false;
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java
deleted file mode 100644
index fb02692fd..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator2D.java
+++ /dev/null
@@ -1,97 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
-
-import net.jafama.FastMath;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.BiFunction;
-
-import com.dfsek.terra.api.util.mutable.MutableInteger;
-import com.dfsek.terra.api.util.vector.Vector3;
-import com.dfsek.terra.api.world.World;
-import com.dfsek.terra.api.world.biome.GenerationSettings;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.dfsek.terra.api.world.generator.ChunkInterpolator;
-
-
-/**
- * Class to abstract away the Interpolators needed to generate a chunk.
- * Contains method to get interpolated noise at a coordinate within the chunk.
- */
-public class ChunkInterpolator2D implements ChunkInterpolator {
- private final Interpolator[][] interpGrid = new Interpolator[4][4];
- private final BiFunction noiseGetter;
-
- /**
- * Instantiates a 3D ChunkInterpolator3D at a pair of chunk coordinates.
- *
- * @param chunkX X coordinate of the chunk.
- * @param chunkZ Z coordinate of the chunk.
- * @param provider Biome Provider to use for biome fetching.
- */
- public ChunkInterpolator2D(World w, int chunkX, int chunkZ, BiomeProvider provider,
- BiFunction noiseGetter) {
- this.noiseGetter = noiseGetter;
- int xOrigin = chunkX << 4;
- int zOrigin = chunkZ << 4;
-
- long seed = w.getSeed();
-
- double[][] noiseStorage = new double[5][5];
-
- for(int x = 0; x < 5; x++) {
- for(int z = 0; z < 5; z++) {
- GenerationSettings generationSettings = provider.getBiome(xOrigin + (x << 2), zOrigin + (z << 2), seed).getGenerator();
- Map genMap = new HashMap<>();
-
- int step = generationSettings.getBlendStep();
- int blend = generationSettings.getBlendDistance();
-
- for(int xi = -blend; xi <= blend; xi++) {
- for(int zi = -blend; zi <= blend; zi++) {
- genMap.computeIfAbsent(
- provider.getBiome(xOrigin + (x << 2) + (xi * step), zOrigin + (z << 2) + (zi * step), seed).getGenerator(),
- g -> new MutableInteger(0)).increment(); // Increment by 1
- }
- }
-
- noiseStorage[x][z] = computeNoise(genMap, (x << 2) + xOrigin, 0, (z << 2) + zOrigin);
- }
- }
-
- for(int x = 0; x < 4; x++) {
- for(int z = 0; z < 4; z++) {
- interpGrid[x][z] = new Interpolator(
- noiseStorage[x][z],
- noiseStorage[x + 1][z],
- noiseStorage[x][z + 1],
- noiseStorage[x + 1][z + 1]);
- }
- }
- }
-
- private static int reRange(int value, int high) {
- return FastMath.max(FastMath.min(value, high), 0);
- }
-
- public double computeNoise(GenerationSettings generationSettings, double x, double y, double z) {
- return noiseGetter.apply(generationSettings, new Vector3(x, y, z));
- }
-
- /**
- * Gets the noise at a pair of internal chunk coordinates.
- *
- * @param x The internal X coordinate (0-15).
- * @param z The internal Z coordinate (0-15).
- *
- * @return double - The interpolated noise at the coordinates.
- */
- @Override
- public double getNoise(double x, double y, double z) {
- return interpGrid[reRange(((int) x) / 4, 3)][reRange(((int) z) / 4, 3)].bilerp((x % 4) / 4, (z % 4) / 4);
- }
-
- public double getNoise(int x, int y, int z) {
- return interpGrid[x / 4][z / 4].bilerp((double) (x % 4) / 4, (double) (z % 4) / 4);
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java
deleted file mode 100644
index 87c96f5f6..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ChunkInterpolator3D.java
+++ /dev/null
@@ -1,118 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
-
-import net.jafama.FastMath;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.function.BiFunction;
-
-import com.dfsek.terra.api.util.mutable.MutableInteger;
-import com.dfsek.terra.api.util.vector.Vector3;
-import com.dfsek.terra.api.world.World;
-import com.dfsek.terra.api.world.biome.GenerationSettings;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.dfsek.terra.api.world.generator.ChunkInterpolator;
-
-
-/**
- * Class to abstract away the Interpolators needed to generate a chunk.
- * Contains method to get interpolated noise at a coordinate within the chunk.
- */
-public class ChunkInterpolator3D implements ChunkInterpolator {
- private final Interpolator3[][][] interpGrid;
- private final BiFunction noiseGetter;
-
- private final int min;
- private final int max;
-
- /**
- * Instantiates a 3D ChunkInterpolator3D at a pair of chunk coordinates.
- *
- * @param chunkX X coordinate of the chunk.
- * @param chunkZ Z coordinate of the chunk.
- * @param provider Biome Provider to use for biome fetching.
- */
- public ChunkInterpolator3D(World w, int chunkX, int chunkZ, BiomeProvider provider,
- BiFunction noiseGetter) {
- this.noiseGetter = noiseGetter;
- int xOrigin = chunkX << 4;
- int zOrigin = chunkZ << 4;
-
- this.max = w.getMaxHeight();
- this.min = w.getMinHeight();
- int range = max - min + 1;
-
- int size = range >> 2;
-
- interpGrid = new Interpolator3[4][size][4];
-
- double[][][] noiseStorage = new double[5][5][size + 1];
-
- long seed = w.getSeed();
-
- for(int x = 0; x < 5; x++) {
- for(int z = 0; z < 5; z++) {
- GenerationSettings generationSettings = provider.getBiome(xOrigin + (x << 2), zOrigin + (z << 2), seed).getGenerator();
- Map genMap = new HashMap<>();
-
- int step = generationSettings.getBlendStep();
- int blend = generationSettings.getBlendDistance();
-
- for(int xi = -blend; xi <= blend; xi++) {
- for(int zi = -blend; zi <= blend; zi++) {
- genMap.computeIfAbsent(
- provider.getBiome(xOrigin + (x << 2) + (xi * step), zOrigin + (z << 2) + (zi * step), seed).getGenerator(),
- g -> new MutableInteger(0)).increment(); // Increment by 1
- }
- }
-
- for(int y = 0; y < size + 1; y++) {
- noiseStorage[x][z][y] = computeNoise(genMap, (x << 2) + xOrigin, (y << 2) + min, (z << 2) + zOrigin);
- }
- }
- }
-
- for(int x = 0; x < 4; x++) {
- for(int z = 0; z < 4; z++) {
- for(int y = 0; y < size; y++) {
- interpGrid[x][y][z] = new Interpolator3(
- noiseStorage[x][z][y],
- noiseStorage[x + 1][z][y],
- noiseStorage[x][z][y + 1],
- noiseStorage[x + 1][z][y + 1],
- noiseStorage[x][z + 1][y],
- noiseStorage[x + 1][z + 1][y],
- noiseStorage[x][z + 1][y + 1],
- noiseStorage[x + 1][z + 1][y + 1]);
- }
- }
- }
- }
-
- private static int reRange(int value, int high) {
- return FastMath.max(FastMath.min(value, high), 0);
- }
-
- public double computeNoise(GenerationSettings generationSettings, double x, double y, double z) {
- return noiseGetter.apply(generationSettings, new Vector3(x, y, z));
- }
-
- /**
- * Gets the noise at a pair of internal chunk coordinates.
- *
- * @param x The internal X coordinate (0-15).
- * @param z The internal Z coordinate (0-15).
- *
- * @return double - The interpolated noise at the coordinates.
- */
- @Override
- public double getNoise(double x, double y, double z) {
- return interpGrid[reRange(((int) x) / 4, 3)][(FastMath.max(FastMath.min(((int) y), max), min) - min) / 4][reRange(((int) z) / 4,
- 3)].trilerp(
- (x % 4) / 4, (y % 4) / 4, (z % 4) / 4);
- }
-
- public double getNoise(int x, int y, int z) {
- return interpGrid[x / 4][(y - min) / 4][z / 4].trilerp((double) (x % 4) / 4, (double) (y % 4) / 4, (double) (z % 4) / 4);
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java
deleted file mode 100644
index e2b01942e..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/ElevationInterpolator.java
+++ /dev/null
@@ -1,45 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
-
-import com.dfsek.terra.api.world.World;
-import com.dfsek.terra.api.world.biome.GenerationSettings;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-
-
-public class ElevationInterpolator {
- private final double[][] values = new double[18][18];
-
- public ElevationInterpolator(World world, int chunkX, int chunkZ, BiomeProvider provider, int smooth) {
- int xOrigin = chunkX << 4;
- int zOrigin = chunkZ << 4;
-
- long seed = world.getSeed();
-
- GenerationSettings[][] gens = new GenerationSettings[18 + 2 * smooth][18 + 2 * smooth];
-
- // Precompute generators.
- for(int x = -1 - smooth; x <= 16 + smooth; x++) {
- for(int z = -1 - smooth; z <= 16 + smooth; z++) {
- gens[x + 1 + smooth][z + 1 + smooth] = provider.getBiome(xOrigin + x, zOrigin + z, seed).getGenerator();
- }
- }
-
- for(int x = -1; x <= 16; x++) {
- for(int z = -1; z <= 16; z++) {
- double noise = 0;
- double div = 0;
- for(int xi = -smooth; xi <= smooth; xi++) {
- for(int zi = -smooth; zi <= smooth; zi++) {
- GenerationSettings gen = gens[x + 1 + smooth + xi][z + 1 + smooth + zi];
- noise += gen.getElevationSampler().getNoiseSeeded(seed, xOrigin + x, zOrigin + z) * gen.getElevationWeight();
- div += gen.getElevationWeight();
- }
- }
- values[x + 1][z + 1] = noise / div;
- }
- }
- }
-
- public double getElevation(int x, int z) {
- return values[x + 1][z + 1];
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java
deleted file mode 100644
index d67ac6c10..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator.java
+++ /dev/null
@@ -1,50 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
-
-/**
- * Class for bilinear interpolation of values arranged on a unit square.
- */
-public class Interpolator {
- private final double v0, v1, v2, v3;
-
- /**
- * Constructs an interpolator with given values as vertices of a unit square.
- *
- * @param v0 - (0,0)
- * @param v1 - (1,0)
- * @param v2 - (0,1)
- * @param v3 - (1,1)
- */
- public Interpolator(double v0, double v1, double v2, double v3) {
- this.v0 = v0;
- this.v1 = v1;
- this.v2 = v2;
- this.v3 = v3;
- }
-
- /**
- * 1D Linear interpolation between 2 points 1 unit apart.
- *
- * @param t - Distance from v0. Total distance between v0 and v1 is 1 unit.
- * @param v0 - Value at v0.
- * @param v1 - Value at v1.
- *
- * @return double - The interpolated value.
- */
- public static double lerp(double t, double v0, double v1) {
- return v0 + t * (v1 - v0);
- }
-
- /**
- * 2D Bilinear interpolation between 4 points on a unit square.
- *
- * @param s - X value
- * @param t - Z value
- *
- * @return double - The interpolated value.
- */
- public double bilerp(double s, double t) {
- double v01 = lerp(s, v0, v1);
- double v23 = lerp(s, v2, v3);
- return lerp(t, v01, v23);
- }
-}
\ No newline at end of file
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java
deleted file mode 100644
index 1d80fb025..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/interpolation/Interpolator3.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
-
-/**
- * Class for bilinear interpolation of values arranged on a unit square.
- */
-public class Interpolator3 {
- private final Interpolator bottom;
- private final Interpolator top;
-
- /**
- * Constructs an interpolator with given values as vertices of a unit cube.
- * * @param _000 The value at (t, u, v) = (0, 0, 0).
- * * @param _100 The value at (t, u, v) = (1, 0, 0).
- * * @param _010 The value at (t, u, v) = (0, 1, 0).
- * * @param _110 The value at (t, u, v) = (1, 1, 0).
- * * @param _001 The value at (t, u, v) = (0, 0, 1).
- * * @param _101 The value at (t, u, v) = (1, 0, 1).
- * * @param _011 The value at (t, u, v) = (0, 1, 1).
- * * @param _111 The value at (t, u, v) = (1, 1, 1).
- */
- public Interpolator3(double _000, double _100,
- double _010, double _110,
- double _001, double _101,
- double _011, double _111) {
- this.top = new Interpolator(_000, _010, _001, _011);
- this.bottom = new Interpolator(_100, _110, _101, _111);
- }
-
- public double trilerp(double x, double y, double z) {
- return Interpolator.lerp(x, top.bilerp(y, z), bottom.bilerp(y, z));
- }
-}
\ No newline at end of file
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java
deleted file mode 100644
index 96c497f23..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/generation/math/samplers/Sampler3D.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.generation.math.samplers;
-
-import net.jafama.FastMath;
-
-import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.ChunkInterpolator3D;
-import com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation.ElevationInterpolator;
-import com.dfsek.terra.api.world.World;
-import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
-import com.dfsek.terra.api.util.math.Sampler;
-
-
-public class Sampler3D implements Sampler {
- private final ChunkInterpolator3D interpolator;
- private final ElevationInterpolator elevationInterpolator;
-
- public Sampler3D(int x, int z, BiomeProvider provider, World world, int elevationSmooth) {
- this.interpolator = new ChunkInterpolator3D(world, x, z, provider, (generator, coord) -> generator.getBaseSampler()
- .getNoiseSeeded(coord,
- world.getSeed()));
- this.elevationInterpolator = new ElevationInterpolator(world, x, z, provider, elevationSmooth);
- }
-
- @Override
- public double sample(double x, double y, double z) {
- return interpolator.getNoise(x, y, z) + elevationInterpolator.getElevation(FastMath.roundToInt(x), FastMath.roundToInt(z));
- }
-
- @Override
- public double sample(int x, int y, int z) {
- return interpolator.getNoise(x, y, z) + elevationInterpolator.getElevation(FastMath.roundToInt(x), FastMath.roundToInt(z));
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java
deleted file mode 100644
index 55d2a2dac..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolder.java
+++ /dev/null
@@ -1,23 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.palette;
-
-import com.dfsek.terra.api.world.generator.Palette;
-
-
-public class PaletteHolder {
- private final Palette[] palettes;
- private final int offset;
-
- protected PaletteHolder(Palette[] palettes, int offset) {
- this.palettes = palettes;
- this.offset = offset;
- }
-
- public Palette getPalette(int y) {
- int index = y + offset;
- return index >= 0
- ? index < palettes.length
- ? palettes[index]
- : palettes[palettes.length - 1]
- : palettes[0];
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java
deleted file mode 100644
index 61042145b..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderBuilder.java
+++ /dev/null
@@ -1,38 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.palette;
-
-import net.jafama.FastMath;
-
-import java.util.Map;
-import java.util.TreeMap;
-
-import com.dfsek.terra.api.world.generator.Palette;
-
-
-public class PaletteHolderBuilder {
- private final TreeMap paletteMap = new TreeMap<>();
-
- public PaletteHolderBuilder add(int y, Palette palette) {
- paletteMap.put(y, palette);
- return this;
- }
-
- public PaletteHolder build() {
-
- int min = FastMath.min(paletteMap.keySet().stream().min(Integer::compareTo).orElse(0), 0);
- int max = FastMath.max(paletteMap.keySet().stream().max(Integer::compareTo).orElse(255), 255);
-
- Palette[] palettes = new Palette[paletteMap.lastKey() + 1 - min];
- for(int y = min; y <= FastMath.max(paletteMap.lastKey(), max); y++) {
- Palette d = null;
- for(Map.Entry e : paletteMap.entrySet()) {
- if(e.getKey() >= y) {
- d = e.getValue();
- break;
- }
- }
- if(d == null) throw new IllegalArgumentException("No palette for Y=" + y);
- palettes[y - min] = d;
- }
- return new PaletteHolder(palettes, -min);
- }
-}
diff --git a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java b/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java
deleted file mode 100644
index bf0bc3bb5..000000000
--- a/common/addons/chunk-generator-noise-3d/src/main/java/com/dfsek/terra/addons/chunkgenerator/palette/PaletteHolderLoader.java
+++ /dev/null
@@ -1,27 +0,0 @@
-package com.dfsek.terra.addons.chunkgenerator.palette;
-
-import com.dfsek.tectonic.exception.LoadException;
-import com.dfsek.tectonic.loading.ConfigLoader;
-import com.dfsek.tectonic.loading.TypeLoader;
-
-import java.lang.reflect.AnnotatedType;
-import java.util.List;
-import java.util.Map;
-
-import com.dfsek.terra.api.world.generator.Palette;
-
-
-public class PaletteHolderLoader implements TypeLoader {
- @SuppressWarnings("unchecked")
- @Override
- public PaletteHolder load(AnnotatedType type, Object o, ConfigLoader configLoader) throws LoadException {
- List