diff --git a/build.gradle b/build.gradle index b1a707f..2c37d1d 100644 --- a/build.gradle +++ b/build.gradle @@ -35,6 +35,9 @@ repositories { name = 'Ladysnake Mods' url = 'https://ladysnake.jfrog.io/artifactory/mods' } + maven { + url = "https://jitpack.io" + } } dependencies { @@ -53,6 +56,10 @@ dependencies { //Modmenu modImplementation "maven.modrinth:modmenu:${project.mod_menu_version}" + + //MixinExtras + implementation("com.github.LlamaLad7:MixinExtras:0.1.1") + annotationProcessor("com.github.LlamaLad7:MixinExtras:0.1.1") } processResources { diff --git a/gradle.properties b/gradle.properties index f0a1dfd..8da15b9 100644 --- a/gradle.properties +++ b/gradle.properties @@ -9,7 +9,7 @@ yarn_mappings=1.19.2+build.28 loader_version=0.14.19 # Mod Properties -mod_version=1.0.6 +mod_version=1.1.0 maven_group=dev.sterner archives_base_name=geocluster diff --git a/src/main/java/dev/sterner/geocluster/Geocluster.java b/src/main/java/dev/sterner/geocluster/Geocluster.java index 07d6c1e..6a85eff 100644 --- a/src/main/java/dev/sterner/geocluster/Geocluster.java +++ b/src/main/java/dev/sterner/geocluster/Geocluster.java @@ -1,6 +1,5 @@ package dev.sterner.geocluster; -import dev.sterner.geocluster.api.GeoclusterAPI; import dev.sterner.geocluster.client.network.S2CProspectingPacket; import dev.sterner.geocluster.client.toast.IOreToastManager; import dev.sterner.geocluster.client.toast.OreToastManager; @@ -15,7 +14,6 @@ import net.fabricmc.fabric.api.client.rendering.v1.HudRenderCallback; import net.fabricmc.fabric.api.resource.ResourceManagerHelper; import net.minecraft.client.MinecraftClient; -import net.minecraft.client.toast.ToastManager; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemGroup; import net.minecraft.item.ItemStack; @@ -37,7 +35,6 @@ public static Identifier id(String id) { @Override public void onInitialize() { MidnightConfig.init(MODID, GeoclusterConfig.class); - GeoclusterAPI.init(); GeoclusterObjects.init(); GeoclusterWorldgenRegistry.init(); ResourceManagerHelper.get(ResourceType.SERVER_DATA).registerReloadListener(new WorldGenDataReloadListener()); diff --git a/src/main/java/dev/sterner/geocluster/GeoclusterConfig.java b/src/main/java/dev/sterner/geocluster/GeoclusterConfig.java index d5ff34b..60360fa 100644 --- a/src/main/java/dev/sterner/geocluster/GeoclusterConfig.java +++ b/src/main/java/dev/sterner/geocluster/GeoclusterConfig.java @@ -9,7 +9,10 @@ public class GeoclusterConfig extends MidnightConfig { @Entry - public static double CHUNK_SKIP_CHANCE = 0.9D; + public static final boolean REMOVE_VEINS = true; + + @Entry + public static double CHUNK_SKIP_CHANCE = 0.95D; @Entry(min = 1, max = Integer.MAX_VALUE) public static int NUMBER_CLUSTERS_PER_CHUNK = 2; @@ -18,7 +21,7 @@ public class GeoclusterConfig extends MidnightConfig { public static boolean DEBUG_WORLD_GEN = false; @Entry(min = 1, max = 256) - public static int MAX_SAMPLES_PER_CHUNK = 10; + public static int MAX_SAMPLES_PER_CHUNK = 8; @Entry public static List DEFAULT_REPLACEMENT_MATERIALS = Lists.newArrayList("minecraft:stone", "minecraft:andesite", "minecraft:diorite", "minecraft:granite", "minecraft:netherrack", "minecraft:sandstone", "minecraft:deepslate", "minecraft:tuff", "minecraft:calcite", "minecraft:dripstone_block"); diff --git a/src/main/java/dev/sterner/geocluster/api/DepositCache.java b/src/main/java/dev/sterner/geocluster/api/DepositCache.java index e15997e..ac9350e 100644 --- a/src/main/java/dev/sterner/geocluster/api/DepositCache.java +++ b/src/main/java/dev/sterner/geocluster/api/DepositCache.java @@ -8,12 +8,17 @@ import java.util.List; public class DepositCache { + private static DepositCache cache = new DepositCache(); private ArrayList deposits; public DepositCache() { this.deposits = new ArrayList<>(); } + public static DepositCache getCache(){ + return cache; + } + public void clear() { this.deposits = new ArrayList<>(); } diff --git a/src/main/java/dev/sterner/geocluster/api/DepositUtils.java b/src/main/java/dev/sterner/geocluster/api/DepositUtils.java index de34cba..d611da1 100644 --- a/src/main/java/dev/sterner/geocluster/api/DepositUtils.java +++ b/src/main/java/dev/sterner/geocluster/api/DepositUtils.java @@ -17,6 +17,13 @@ public class DepositUtils { private static HashSet defaultMatchersCached = null; + /** + * picks a choice out of a mapping between blockstate to weight + * + * @param map the map between a blockstate and its chance + * @return null if no block should be used or placed, T instanceof BlockState if + * actual block should be placed. + */ @Nullable public static BlockState pick(HashMap map, Random random) { float rng = random.nextFloat(); @@ -56,6 +63,10 @@ public static boolean addDefaultMatcher(Block block) { return false; } + /** + * Returns true if a and b are within epsilon of each other, where epsilon is the minimum + * representable value by a 32-bit floating point number. + */ public static boolean nearlyEquals(float a, float b) { return Math.abs(a - b) <= Float.MIN_VALUE; } diff --git a/src/main/java/dev/sterner/geocluster/api/GeoclusterAPI.java b/src/main/java/dev/sterner/geocluster/api/GeoclusterAPI.java deleted file mode 100644 index 30209d7..0000000 --- a/src/main/java/dev/sterner/geocluster/api/GeoclusterAPI.java +++ /dev/null @@ -1,9 +0,0 @@ -package dev.sterner.geocluster.api; - -public class GeoclusterAPI { - public static DepositCache depositCache = new DepositCache(); - - public static void init() { - - } -} diff --git a/src/main/java/dev/sterner/geocluster/api/IDeposit.java b/src/main/java/dev/sterner/geocluster/api/IDeposit.java index d670c53..3e1f9b5 100644 --- a/src/main/java/dev/sterner/geocluster/api/IDeposit.java +++ b/src/main/java/dev/sterner/geocluster/api/IDeposit.java @@ -11,8 +11,19 @@ import java.util.HashSet; public interface IDeposit { + /** + * Handles full-on generation of this type of cluster. Requires 0 arguments as + * everything is self-contained in this class + * + * @return (int) the number of cluster resource blocks placed. If 0 -- this + * should be evaluted as a false for use of Mojang's sort-of sketchy + * generation code in + */ int generate(StructureWorldAccess level, BlockPos pos, IWorldDepositComponent deposits, IWorldChunkComponent chunksGenerated); + /** + * Handles what to do after the world has generated + */ void generatePost(StructureWorldAccess level, BlockPos pos, IWorldDepositComponent deposits, IWorldChunkComponent chunksGenerated); HashSet getAllOres(); diff --git a/src/main/java/dev/sterner/geocluster/api/deposits/DenseDeposit.java b/src/main/java/dev/sterner/geocluster/api/deposits/DenseDeposit.java index 4edc243..8b441bd 100644 --- a/src/main/java/dev/sterner/geocluster/api/deposits/DenseDeposit.java +++ b/src/main/java/dev/sterner/geocluster/api/deposits/DenseDeposit.java @@ -21,6 +21,7 @@ import net.minecraft.util.math.random.Random; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.RegistryEntry; +import net.minecraft.world.Heightmap; import net.minecraft.world.StructureWorldAccess; import net.minecraft.world.biome.Biome; import org.jetbrains.annotations.Nullable; @@ -53,33 +54,7 @@ public DenseDeposit(HashMap> oreBlocks, HashM this.biomeTag = biomeTag; this.blockStateMatchers = blockStateMatchers; - // Verify that blocks.default exists. - if (!this.oreToWeightMap.containsKey("default")) { - throw new RuntimeException("Cluster blocks should always have a default key"); - } - - for (Map.Entry> i : this.oreToWeightMap.entrySet()) { - if (!this.cumulativeOreWeightMap.containsKey(i.getKey())) { - this.cumulativeOreWeightMap.put(i.getKey(), 0.0F); - } - - for (Map.Entry j : i.getValue().entrySet()) { - float v = this.cumulativeOreWeightMap.get(i.getKey()); - this.cumulativeOreWeightMap.put(i.getKey(), v + j.getValue()); - } - - if (!DepositUtils.nearlyEquals(this.cumulativeOreWeightMap.get(i.getKey()), 1.0F)) { - throw new RuntimeException("Sum of weights for cluster blocks should equal 1.0" + ", is " + this.cumulativeOreWeightMap.get(i.getKey())); - } - } - - for (Map.Entry e : this.sampleToWeightMap.entrySet()) { - this.sumWeightSamples += e.getValue(); - } - - if (!DepositUtils.nearlyEquals(sumWeightSamples, 1.0F)) { - throw new RuntimeException("Sum of weights for cluster samples should equal 1.0"); - } + validateFormat(oreToWeightMap, cumulativeOreWeightMap, sampleToWeightMap, sumWeightSamples); } @Nullable @@ -103,7 +78,9 @@ public int generate(StructureWorldAccess world, BlockPos pos, IWorldDepositCompo int totlPlaced = 0; int randY = this.yMin + world.getRandom().nextInt(this.yMax - this.yMin); - int max = GeoclusterUtils.getTopSolidBlock(world, pos).getY(); + int max; + max = GeoclusterUtils.getTopSolidBlock(world, pos).getY(); + if (randY > max) { randY = Math.max(yMin, max); } diff --git a/src/main/java/dev/sterner/geocluster/api/deposits/Deposit.java b/src/main/java/dev/sterner/geocluster/api/deposits/Deposit.java index 7ee9bfa..773fc3c 100644 --- a/src/main/java/dev/sterner/geocluster/api/deposits/Deposit.java +++ b/src/main/java/dev/sterner/geocluster/api/deposits/Deposit.java @@ -23,6 +23,35 @@ public Deposit() { } + public static void validateFormat(HashMap> oreToWeightMap, HashMap cumulativeOreWeightMap, HashMap sampleToWeightMap, float sumWeightSamples){ + if (!oreToWeightMap.containsKey("default")) { + throw new RuntimeException("Cluster blocks should always have a default key"); + } + + for (Map.Entry> i : oreToWeightMap.entrySet()) { + if (!cumulativeOreWeightMap.containsKey(i.getKey())) { + cumulativeOreWeightMap.put(i.getKey(), 0.0F); + } + + for (Map.Entry j : i.getValue().entrySet()) { + float v = cumulativeOreWeightMap.get(i.getKey()); + cumulativeOreWeightMap.put(i.getKey(), v + j.getValue()); + } + + if (!DepositUtils.nearlyEquals(cumulativeOreWeightMap.get(i.getKey()), 1.0F)) { + throw new RuntimeException("Sum of weights for cluster blocks should equal 1.0, is " + cumulativeOreWeightMap.get(i.getKey())); + } + } + + for (Map.Entry e : sampleToWeightMap.entrySet()) { + sumWeightSamples += e.getValue(); + } + + if (!DepositUtils.nearlyEquals(sumWeightSamples, 1.0F)) { + throw new RuntimeException("Sum of weights for cluster samples should equal 1.0, is " + sumWeightSamples); + } + } + public static void findAndPlaceSample(int maxSampleCnt, BlockState sampleState, StructureWorldAccess world, BlockPos pos, IWorldDepositComponent deposits, IWorldChunkComponent chunksGenerated) { for (int i = 0; i < maxSampleCnt; i++) { BlockState tmp = sampleState; diff --git a/src/main/java/dev/sterner/geocluster/api/deposits/DikeDeposit.java b/src/main/java/dev/sterner/geocluster/api/deposits/DikeDeposit.java index d1ab46b..6a4b908 100644 --- a/src/main/java/dev/sterner/geocluster/api/deposits/DikeDeposit.java +++ b/src/main/java/dev/sterner/geocluster/api/deposits/DikeDeposit.java @@ -17,6 +17,7 @@ import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; +import net.minecraft.util.math.MathHelper; import net.minecraft.util.math.random.Random; import net.minecraft.util.registry.Registry; import net.minecraft.util.registry.RegistryEntry; @@ -37,48 +38,24 @@ public class DikeDeposit extends Deposit implements IDeposit { public float sumWeightSamples = 0.0F; private final int yMin; private final int yMax; + private final int maxHeight; private final int baseRadius; private final int weight; private final HashSet blockStateMatchers; private final TagKey biomeTag; - public DikeDeposit(HashMap> oreBlocks, HashMap sampleBlocks, int yMin, int yMax, int baseRadius, int weight, TagKey biomeTag, HashSet blockStateMatchers) { + public DikeDeposit(HashMap> oreBlocks, HashMap sampleBlocks, int yMin, int yMax, int baseRadius, int maxHeight, int weight, TagKey biomeTag, HashSet blockStateMatchers) { this.oreToWeightMap = oreBlocks; this.sampleToWeightMap = sampleBlocks; this.yMin = yMin; this.yMax = yMax; + this.maxHeight = maxHeight; this.baseRadius = baseRadius; this.weight = weight; this.biomeTag = biomeTag; this.blockStateMatchers = blockStateMatchers; - // Verify that blocks.default exists. - if (!this.oreToWeightMap.containsKey("default")) { - throw new RuntimeException("Cluster blocks should always have a default key"); - } - - for (Map.Entry> i : this.oreToWeightMap.entrySet()) { - if (!this.cumulativeOreWeightMap.containsKey(i.getKey())) { - this.cumulativeOreWeightMap.put(i.getKey(), 0.0F); - } - - for (Map.Entry j : i.getValue().entrySet()) { - float v = this.cumulativeOreWeightMap.get(i.getKey()); - this.cumulativeOreWeightMap.put(i.getKey(), v + j.getValue()); - } - - if (!DepositUtils.nearlyEquals(this.cumulativeOreWeightMap.get(i.getKey()), 1.0F)) { - throw new RuntimeException("Sum of weights for cluster blocks should equal 1.0" + ", is " + i.getKey()); - } - } - - for (Map.Entry e : this.sampleToWeightMap.entrySet()) { - this.sumWeightSamples += e.getValue(); - } - - if (!DepositUtils.nearlyEquals(sumWeightSamples, 1.0F)) { - throw new RuntimeException("Sum of weights for cluster samples should equal 1.0"); - } + validateFormat(oreToWeightMap, cumulativeOreWeightMap, sampleToWeightMap, sumWeightSamples); } @@ -132,17 +109,18 @@ public int generate(StructureWorldAccess world, BlockPos pos, IWorldDepositCompo } ChunkPos thisChunk = new ChunkPos(pos); + int height = Math.abs((this.yMax - this.yMin)); int x = thisChunk.getStartX() + world.getRandom().nextInt(16); int z = thisChunk.getStartZ() + world.getRandom().nextInt(16); int yMin = this.yMin + world.getRandom().nextInt(height / 4); int yMax = this.yMax - world.getRandom().nextInt(height / 4); - int max = GeoclusterUtils.getTopSolidBlock(world, pos).getY(); - if (yMin > max) { - yMin = Math.max(yMin, max); - } else if (yMin == yMax) { - yMax = this.yMax; - } + + int cmaxHeight = maxHeight - world.getRandom().nextBetween(0, maxHeight / 4); + int maxStart = MathHelper.abs(yMax - cmaxHeight - yMin); + yMin = world.getRandom().nextInt(maxStart + 1) + yMin; + yMax = yMin + cmaxHeight; + BlockPos basePos = new BlockPos(x, yMin, z); int totlPlaced = 0; @@ -219,6 +197,7 @@ public static DikeDeposit deserialize(JsonObject json) { int yMin = json.get("yMin").getAsInt(); int yMax = json.get("yMax").getAsInt(); int baseRadius = json.get("baseRadius").getAsInt(); + int maxHeight = json.get("maxHeight").getAsInt(); int genWt = json.get("generationWeight").getAsInt(); TagKey biomeTag = TagKey.of(Registry.BIOME_KEY, new Identifier(json.get("biomeTag").getAsString().replace("#", ""))); @@ -227,7 +206,7 @@ public static DikeDeposit deserialize(JsonObject json) { blockStateMatchers = SerializerUtils.toBlockStateList(json.get("blockStateMatchers").getAsJsonArray()); } - return new DikeDeposit(oreBlocks, sampleBlocks, yMin, yMax, baseRadius, genWt, biomeTag, blockStateMatchers); + return new DikeDeposit(oreBlocks, sampleBlocks, yMin, yMax, baseRadius, maxHeight, genWt, biomeTag, blockStateMatchers); } catch (Exception e) { Geocluster.LOGGER.error("Failed to parse: {}", e.getMessage()); return null; @@ -243,6 +222,7 @@ public JsonElement serialize() { config.addProperty("yMin", this.yMin); config.addProperty("yMax", this.yMax); config.addProperty("baseRadius", this.baseRadius); + config.addProperty("maxHeight", this.maxHeight); config.addProperty("generationWeight", this.getWeight()); config.addProperty("biomeTag", this.biomeTag.id().toString()); json.addProperty("type", JSON_TYPE); diff --git a/src/main/java/dev/sterner/geocluster/api/deposits/LayerDeposit.java b/src/main/java/dev/sterner/geocluster/api/deposits/LayerDeposit.java index aece60e..adf03a3 100644 --- a/src/main/java/dev/sterner/geocluster/api/deposits/LayerDeposit.java +++ b/src/main/java/dev/sterner/geocluster/api/deposits/LayerDeposit.java @@ -55,33 +55,7 @@ public LayerDeposit(HashMap> oreBlocks, HashM this.biomeTag = biomeTag; this.blockStateMatchers = blockStateMatchers; - // Verify that blocks.default exists. - if (!this.oreToWeightMap.containsKey("default")) { - throw new RuntimeException("Cluster blocks should always have a default key"); - } - - for (Map.Entry> i : this.oreToWeightMap.entrySet()) { - if (!this.cumulativeOreWeightMap.containsKey(i.getKey())) { - this.cumulativeOreWeightMap.put(i.getKey(), 0.0F); - } - - for (Map.Entry j : i.getValue().entrySet()) { - float v = this.cumulativeOreWeightMap.get(i.getKey()); - this.cumulativeOreWeightMap.put(i.getKey(), v + j.getValue()); - } - - if (!DepositUtils.nearlyEquals(this.cumulativeOreWeightMap.get(i.getKey()), 1.0F)) { - throw new RuntimeException("Sum of weights for cluster blocks should equal 1.0" + ", is " + i.getKey()); - } - } - - for (Map.Entry e : this.sampleToWeightMap.entrySet()) { - this.sumWeightSamples += e.getValue(); - } - - if (!DepositUtils.nearlyEquals(sumWeightSamples, 1.0F)) { - throw new RuntimeException("Sum of weights for cluster samples should equal 1.0"); - } + validateFormat(oreToWeightMap, cumulativeOreWeightMap, sampleToWeightMap, sumWeightSamples); } diff --git a/src/main/java/dev/sterner/geocluster/api/deposits/SparseDeposit.java b/src/main/java/dev/sterner/geocluster/api/deposits/SparseDeposit.java index cdb14a9..42dad24 100644 --- a/src/main/java/dev/sterner/geocluster/api/deposits/SparseDeposit.java +++ b/src/main/java/dev/sterner/geocluster/api/deposits/SparseDeposit.java @@ -55,33 +55,7 @@ public SparseDeposit(HashMap> oreBlocks, Hash this.biomeTag = biomeTag; this.blockStateMatchers = blockStateMatchers; - // Verify that blocks.default exists. - if (!this.oreToWeightMap.containsKey("default")) { - throw new RuntimeException("Cluster blocks should always have a default key"); - } - - for (Map.Entry> i : this.oreToWeightMap.entrySet()) { - if (!this.cumulativeOreWeightMap.containsKey(i.getKey())) { - this.cumulativeOreWeightMap.put(i.getKey(), 0.0F); - } - - for (Map.Entry j : i.getValue().entrySet()) { - float v = this.cumulativeOreWeightMap.get(i.getKey()); - this.cumulativeOreWeightMap.put(i.getKey(), v + j.getValue()); - } - - if (!DepositUtils.nearlyEquals(this.cumulativeOreWeightMap.get(i.getKey()), 1.0F)) { - throw new RuntimeException("Sum of weights for cluster blocks should equal 1.0" + ", is " + i.getKey()); - } - } - - for (Map.Entry e : this.sampleToWeightMap.entrySet()) { - this.sumWeightSamples += e.getValue(); - } - - if (!DepositUtils.nearlyEquals(sumWeightSamples, 1.0F)) { - throw new RuntimeException("Sum of weights for cluster samples should equal 1.0"); - } + validateFormat(oreToWeightMap, cumulativeOreWeightMap, sampleToWeightMap, sumWeightSamples); } diff --git a/src/main/java/dev/sterner/geocluster/api/deposits/TopLayerDeposit.java b/src/main/java/dev/sterner/geocluster/api/deposits/TopLayerDeposit.java index 7573245..e0da2bd 100644 --- a/src/main/java/dev/sterner/geocluster/api/deposits/TopLayerDeposit.java +++ b/src/main/java/dev/sterner/geocluster/api/deposits/TopLayerDeposit.java @@ -52,33 +52,7 @@ public TopLayerDeposit(HashMap> oreBlocks, Ha this.biomeTag = biomeTag; this.blockStateMatchers = blockStateMatchers; - // Verify that blocks.default exists. - if (!this.oreToWeightMap.containsKey("default")) { - throw new RuntimeException("Cluster blocks should always have a default key"); - } - - for (Map.Entry> i : this.oreToWeightMap.entrySet()) { - if (!this.cumulativeOreWeightMap.containsKey(i.getKey())) { - this.cumulativeOreWeightMap.put(i.getKey(), 0.0F); - } - - for (Map.Entry j : i.getValue().entrySet()) { - float v = this.cumulativeOreWeightMap.get(i.getKey()); - this.cumulativeOreWeightMap.put(i.getKey(), v + j.getValue()); - } - - if (!DepositUtils.nearlyEquals(this.cumulativeOreWeightMap.get(i.getKey()), 1.0F)) { - throw new RuntimeException("Sum of weights for cluster blocks should equal 1.0" + ", is " + i.getKey()); - } - } - - for (Map.Entry e : this.sampleToWeightMap.entrySet()) { - this.sumWeightSamples += e.getValue(); - } - - if (!DepositUtils.nearlyEquals(sumWeightSamples, 1.0F)) { - throw new RuntimeException("Sum of weights for cluster samples should equal 1.0"); - } + validateFormat(oreToWeightMap, cumulativeOreWeightMap, sampleToWeightMap, sumWeightSamples); } @Nullable diff --git a/src/main/java/dev/sterner/geocluster/common/data/WorldGenDataReloadListener.java b/src/main/java/dev/sterner/geocluster/common/data/WorldGenDataReloadListener.java index 6c1a79f..ed8fd7d 100644 --- a/src/main/java/dev/sterner/geocluster/common/data/WorldGenDataReloadListener.java +++ b/src/main/java/dev/sterner/geocluster/common/data/WorldGenDataReloadListener.java @@ -5,7 +5,7 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import dev.sterner.geocluster.Geocluster; -import dev.sterner.geocluster.api.GeoclusterAPI; +import dev.sterner.geocluster.api.DepositCache; import dev.sterner.geocluster.api.deposits.*; import dev.sterner.geocluster.common.data.serializer.*; import dev.sterner.geocluster.common.utils.ProspectingUtils; @@ -38,7 +38,8 @@ public Identifier getFabricId() { @Override protected void apply(Map prepared, ResourceManager manager, Profiler profiler) { - GeoclusterAPI.depositCache.clear(); + DepositCache cache = DepositCache.getCache(); + cache.clear(); prepared.forEach((identifier, json) -> { try { @@ -51,35 +52,35 @@ protected void apply(Map prepared, ResourceManager mana DenseDeposit denseDeposit = DenseSerializer.deserialize(config); if (denseDeposit != null) { Geocluster.LOGGER.info(denseDeposit.toString()); - GeoclusterAPI.depositCache.addDeposit(denseDeposit); + cache.addDeposit(denseDeposit); } } case "geocluster:deposit_layer" -> { LayerDeposit layerDeposit = LayerSerializer.deserialize(config); if (layerDeposit != null) { Geocluster.LOGGER.info(layerDeposit.toString()); - GeoclusterAPI.depositCache.addDeposit(layerDeposit); + cache.addDeposit(layerDeposit); } } case "geocluster:deposit_top_layer" -> { TopLayerDeposit topLayerDeposit = TopLayerSerializer.deserialize(config); if (topLayerDeposit != null) { Geocluster.LOGGER.info(topLayerDeposit.toString()); - GeoclusterAPI.depositCache.addDeposit(topLayerDeposit); + cache.addDeposit(topLayerDeposit); } } case "geocluster:deposit_dike" -> { DikeDeposit dikeDeposit = DikeSerializer.deserialize(config); if (dikeDeposit != null) { Geocluster.LOGGER.info(dikeDeposit.toString()); - GeoclusterAPI.depositCache.addDeposit(dikeDeposit); + cache.addDeposit(dikeDeposit); } } case "geocluster:deposit_sparse" -> { SparseDeposit sparseDeposit = SparseSerializer.deserialize(config); if (sparseDeposit != null) { Geocluster.LOGGER.info(sparseDeposit.toString()); - GeoclusterAPI.depositCache.addDeposit(sparseDeposit); + cache.addDeposit(sparseDeposit); } } default -> { diff --git a/src/main/java/dev/sterner/geocluster/common/registry/GeoclusterWorldgenRegistry.java b/src/main/java/dev/sterner/geocluster/common/registry/GeoclusterWorldgenRegistry.java index 87fceb9..c175926 100644 --- a/src/main/java/dev/sterner/geocluster/common/registry/GeoclusterWorldgenRegistry.java +++ b/src/main/java/dev/sterner/geocluster/common/registry/GeoclusterWorldgenRegistry.java @@ -3,6 +3,7 @@ import com.google.common.collect.Lists; import dev.sterner.geocluster.Geocluster; import dev.sterner.geocluster.common.world.feature.DepositFeature; +import dev.sterner.geocluster.common.world.feature.RemoveVeinsFeature; import dev.sterner.geocluster.mixin.BiomeModificationContextImplMixin; import net.fabricmc.fabric.api.biome.v1.*; import net.minecraft.tag.TagKey; @@ -27,6 +28,14 @@ public interface GeoclusterWorldgenRegistry { RegistryEntry> CONFIGURED_DEPOSIT_FEATURE = registerConfigured("deposits_configured", DEPOSIT_FEATURE); RegistryEntry PLACED_DEPOSIT_FEATURE = PlacedFeatures.register("geocluster:deposits_placed", CONFIGURED_DEPOSIT_FEATURE, placement); + /* Replaced with ChunkGeneratorSettingsMixin + Feature REMOVE_VEINS_FEATURE = registerFeature("remove_veins", new RemoveVeinsFeature(DefaultFeatureConfig.CODEC)); + RegistryEntry> CONFIGURED_REMOVE_VEINS_FEATURE = registerConfigured("remove_veins_configured", REMOVE_VEINS_FEATURE); + RegistryEntry PLACED_REMOVE_VEINS_FEATURE = PlacedFeatures.register("geocluster:remove_veins_placed", CONFIGURED_REMOVE_VEINS_FEATURE, placement); + + + */ + static void init() { BiomeModification modifications = BiomeModifications.create(Geocluster.id("worldgen")); @@ -42,12 +51,12 @@ static void init() { modifications.add(ModificationPhase.ADDITIONS, BiomeSelectors.all(), ctx -> { ctx.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PLACED_DEPOSIT_FEATURE.getKey().get()); + //ctx.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, PLACED_REMOVE_VEINS_FEATURE.getKey().get()); }); } private static Iterable> getPlacedFeaturesByTag(BiomeModificationContext ctx, TagKey placedFeatureTagKey) { - DynamicRegistryManager dynamicRegistryManager = ((BiomeModificationContextImplMixin) ctx).getRegistries(); Registry placedFeatureRegistry = dynamicRegistryManager.get(Registry.PLACED_FEATURE_KEY); return placedFeatureRegistry.iterateEntries(placedFeatureTagKey); diff --git a/src/main/java/dev/sterner/geocluster/common/utils/ProspectingUtils.java b/src/main/java/dev/sterner/geocluster/common/utils/ProspectingUtils.java index 87926f5..f4f5904 100644 --- a/src/main/java/dev/sterner/geocluster/common/utils/ProspectingUtils.java +++ b/src/main/java/dev/sterner/geocluster/common/utils/ProspectingUtils.java @@ -2,7 +2,7 @@ import dev.sterner.geocluster.Geocluster; import dev.sterner.geocluster.GeoclusterConfig; -import dev.sterner.geocluster.api.GeoclusterAPI; +import dev.sterner.geocluster.api.DepositCache; import net.minecraft.block.Block; import net.minecraft.block.BlockState; import net.minecraft.util.Identifier; @@ -24,8 +24,8 @@ public static HashSet getDepositBlocks() { public static void populateDepositBlocks() { depositBlocks = new HashSet<>(); - - GeoclusterAPI.depositCache.getOres().forEach((cluster) -> { + DepositCache cache = DepositCache.getCache(); + cache.getOres().forEach((cluster) -> { HashSet ores = cluster.getAllOres(); if (ores != null) { depositBlocks.addAll(ores); diff --git a/src/main/java/dev/sterner/geocluster/common/utils/SampleUtils.java b/src/main/java/dev/sterner/geocluster/common/utils/SampleUtils.java index 08eb485..e86cfe5 100644 --- a/src/main/java/dev/sterner/geocluster/common/utils/SampleUtils.java +++ b/src/main/java/dev/sterner/geocluster/common/utils/SampleUtils.java @@ -68,15 +68,30 @@ public static BlockPos getSamplePosition(StructureWorldAccess worldAccess, Chunk return null; } + /** + * @param level an WorldGenLevel instance + * @param pos A BlockPos to check in and around + * @return true if the block at pos is replaceable + */ public static boolean canReplace(StructureWorldAccess level, BlockPos pos) { BlockState state = level.getBlockState(pos); return state.getMaterial().isReplaceable() || state.isAir(); } + /** + * @param level an WorldGenLevel instance + * @param pos A BlockPos to check in and around + * @return true if the block is water (since we can waterlog) + */ public static boolean isInWater(StructureWorldAccess level, BlockPos pos) { return level.getBlockState(pos).getBlock() == Blocks.WATER; } + /** + * @param level an WorldGenLevel instance + * @param pos A BlockPos to check in and around + * @return true if the block is in a non-water fluid + */ public static boolean inNonWaterFluid(StructureWorldAccess level, BlockPos pos) { return level.getBlockState(pos).getMaterial().isLiquid() && !isInWater(level, pos); } diff --git a/src/main/java/dev/sterner/geocluster/common/world/feature/DepositFeature.java b/src/main/java/dev/sterner/geocluster/common/world/feature/DepositFeature.java index 3b7636f..04e19cd 100644 --- a/src/main/java/dev/sterner/geocluster/common/world/feature/DepositFeature.java +++ b/src/main/java/dev/sterner/geocluster/common/world/feature/DepositFeature.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import dev.sterner.geocluster.Geocluster; import dev.sterner.geocluster.GeoclusterConfig; -import dev.sterner.geocluster.api.GeoclusterAPI; +import dev.sterner.geocluster.api.DepositCache; import dev.sterner.geocluster.api.IDeposit; import dev.sterner.geocluster.common.components.*; import dev.sterner.geocluster.common.utils.FeatureUtils; @@ -40,7 +40,7 @@ public boolean generate(FeatureContext context) { if (world.getRandom().nextDouble() > GeoclusterConfig.CHUNK_SKIP_CHANCE) { for (int p = 0; p < GeoclusterConfig.NUMBER_CLUSTERS_PER_CHUNK; p++) { - IDeposit deposit = GeoclusterAPI.depositCache.pick(world, pos); + IDeposit deposit = DepositCache.getCache().pick(world, pos); if (deposit == null) { continue; } diff --git a/src/main/java/dev/sterner/geocluster/common/world/feature/RemoveVeinsFeature.java b/src/main/java/dev/sterner/geocluster/common/world/feature/RemoveVeinsFeature.java new file mode 100644 index 0000000..b56510c --- /dev/null +++ b/src/main/java/dev/sterner/geocluster/common/world/feature/RemoveVeinsFeature.java @@ -0,0 +1,76 @@ +package dev.sterner.geocluster.common.world.feature; + +import com.google.common.collect.Lists; +import com.mojang.serialization.Codec; +import dev.sterner.geocluster.common.components.GeoclusterComponents; +import dev.sterner.geocluster.common.components.IWorldDepositComponent; +import dev.sterner.geocluster.common.components.WorldChunkComponent; +import dev.sterner.geocluster.common.components.WorldDepositComponent; +import dev.sterner.geocluster.common.utils.FeatureUtils; +import net.minecraft.block.Block; +import net.minecraft.block.BlockState; +import net.minecraft.block.Blocks; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.BlockPos; +import net.minecraft.util.math.ChunkPos; +import net.minecraft.util.registry.Registry; +import net.minecraft.world.StructureWorldAccess; +import net.minecraft.world.gen.chunk.FlatChunkGenerator; +import net.minecraft.world.gen.feature.DefaultFeatureConfig; +import net.minecraft.world.gen.feature.Feature; +import net.minecraft.world.gen.feature.util.FeatureContext; + +import java.util.ArrayList; +import java.util.HashMap; + +public class RemoveVeinsFeature extends Feature { + private final ArrayList UNACCEPTABLE = Lists.newArrayList( + Blocks.RAW_IRON_BLOCK, + Blocks.RAW_COPPER_BLOCK, + Blocks.DEEPSLATE_IRON_ORE, + Blocks.COPPER_ORE + ); + + private final HashMap oreReplacementMap; + + public RemoveVeinsFeature(Codec configCodec) { + super(configCodec); + oreReplacementMap = initOreReplacementMap(); + } + + private HashMap initOreReplacementMap() { + return new HashMap<>() {{ + put(Blocks.COPPER_ORE, Blocks.STONE); + put(Blocks.RAW_COPPER_BLOCK, Blocks.STONE); + put(Blocks.DEEPSLATE_IRON_ORE, Blocks.DEEPSLATE); + put(Blocks.RAW_IRON_BLOCK, Blocks.DEEPSLATE); + }}; + } + + @Override + public boolean generate(FeatureContext context) { + if (context.getGenerator() instanceof FlatChunkGenerator) { + return false; + } + + StructureWorldAccess world = context.getWorld(); + ChunkPos cp = new ChunkPos(context.getOrigin()); + WorldDepositComponent depositComponent = GeoclusterComponents.DEPOSIT.get(world.toServerWorld()); + WorldChunkComponent chunkComponent = GeoclusterComponents.CHUNK.get(world.toServerWorld()); + + for (int x = cp.getStartX(); x <= cp.getEndX(); x++) { + for (int z = cp.getStartZ(); z <= cp.getEndZ(); z++) { + for (int y = world.getBottomY(); y < world.getHeight(); y++) { + BlockPos p = new BlockPos(x, y, z); + BlockState state = world.getBlockState(p); + if (UNACCEPTABLE.contains(state.getBlock())) { + BlockState properReplacement = oreReplacementMap.get(state.getBlock()).getDefaultState(); + FeatureUtils.enqueueBlockPlacement(world, p, properReplacement, depositComponent, chunkComponent); + } + } + } + } + + return true; + } +} diff --git a/src/main/java/dev/sterner/geocluster/mixin/ChunkGeneratorSettingsMixin.java b/src/main/java/dev/sterner/geocluster/mixin/ChunkGeneratorSettingsMixin.java new file mode 100644 index 0000000..6043206 --- /dev/null +++ b/src/main/java/dev/sterner/geocluster/mixin/ChunkGeneratorSettingsMixin.java @@ -0,0 +1,18 @@ +package dev.sterner.geocluster.mixin; + +import dev.sterner.geocluster.GeoclusterConfig; +import net.minecraft.world.gen.chunk.ChunkGeneratorSettings; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Mixin(ChunkGeneratorSettings.class) +public class ChunkGeneratorSettingsMixin { + + + @Inject(method = "oreVeins", at = @At(value = "RETURN"), cancellable = true) + private void geocluster$removeVeins(CallbackInfoReturnable cir){ + cir.setReturnValue(!GeoclusterConfig.REMOVE_VEINS); + } +} diff --git a/src/main/java/dev/sterner/geocluster/mixin/GeoMixinPlugin.java b/src/main/java/dev/sterner/geocluster/mixin/GeoMixinPlugin.java new file mode 100644 index 0000000..29f9a40 --- /dev/null +++ b/src/main/java/dev/sterner/geocluster/mixin/GeoMixinPlugin.java @@ -0,0 +1,47 @@ +package dev.sterner.geocluster.mixin; + +import com.llamalad7.mixinextras.MixinExtrasBootstrap; +import org.objectweb.asm.tree.ClassNode; +import org.spongepowered.asm.launch.MixinLaunchPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinConfigPlugin; +import org.spongepowered.asm.mixin.extensibility.IMixinInfo; + +import java.util.List; +import java.util.Set; + +public class GeoMixinPlugin implements IMixinConfigPlugin { + @Override + public void onLoad(String mixinPackage) { + MixinExtrasBootstrap.init(); + } + + @Override + public String getRefMapperConfig() { + return null; + } + + @Override + public boolean shouldApplyMixin(String targetClassName, String mixinClassName) { + return true; + } + + @Override + public void acceptTargets(Set myTargets, Set otherTargets) { + + } + + @Override + public List getMixins() { + return null; + } + + @Override + public void preApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + + } + + @Override + public void postApply(String targetClassName, ClassNode targetClass, String mixinClassName, IMixinInfo mixinInfo) { + + } +} diff --git a/src/main/resources/data/geocluster/deposits/ancient_debris.json b/src/main/resources/data/geocluster/deposits/ancient_debris.json index 0532507..70fbddd 100644 --- a/src/main/resources/data/geocluster/deposits/ancient_debris.json +++ b/src/main/resources/data/geocluster/deposits/ancient_debris.json @@ -3,6 +3,7 @@ "config": { "yMin": 8, "yMax": 22, + "maxHeight": 6, "baseRadius": 3, "biomeTag": "#minecraft:is_nether", "blockStateMatchers": [ diff --git a/src/main/resources/data/geocluster/deposits/coal.json b/src/main/resources/data/geocluster/deposits/coal.json index 6923466..3f452ca 100644 --- a/src/main/resources/data/geocluster/deposits/coal.json +++ b/src/main/resources/data/geocluster/deposits/coal.json @@ -4,7 +4,7 @@ "yMin": 34, "yMax": 78, "size": 32, - "spread": 16, + "spread": 10, "biomeTag": "#minecraft:is_overworld", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/coal_extra.json b/src/main/resources/data/geocluster/deposits/coal_extra.json index 8c43652..0b06a36 100644 --- a/src/main/resources/data/geocluster/deposits/coal_extra.json +++ b/src/main/resources/data/geocluster/deposits/coal_extra.json @@ -34,6 +34,6 @@ "chance": 1.0 } ], - "generationWeight": 6 + "generationWeight": 5 } } \ No newline at end of file diff --git a/src/main/resources/data/geocluster/deposits/copper.json b/src/main/resources/data/geocluster/deposits/copper.json index c2add06..4aedcba 100644 --- a/src/main/resources/data/geocluster/deposits/copper.json +++ b/src/main/resources/data/geocluster/deposits/copper.json @@ -31,8 +31,8 @@ ], "yMin": -16, "yMax": 90, - "size": 45, + "size": 35, "biomeTag": "#minecraft:is_overworld", - "generationWeight": 5 + "generationWeight": 4 } } \ No newline at end of file diff --git a/src/main/resources/data/geocluster/deposits/diamond.json b/src/main/resources/data/geocluster/deposits/diamond.json index cadcabc..416ae48 100644 --- a/src/main/resources/data/geocluster/deposits/diamond.json +++ b/src/main/resources/data/geocluster/deposits/diamond.json @@ -3,6 +3,7 @@ "config": { "yMin": -64, "yMax": 10, + "maxHeight": 8, "baseRadius": 2, "biomeTag": "#minecraft:is_overworld", "blocks": { @@ -30,11 +31,11 @@ "samples": [ { "block": "geocluster:diamond_ore_sample", - "chance": 0.5 + "chance": 0.75 }, { "block": null, - "chance": 0.5 + "chance": 0.25 } ], "generationWeight": 2 diff --git a/src/main/resources/data/geocluster/deposits/emerald.json b/src/main/resources/data/geocluster/deposits/emerald.json index 7aa3a23..7f5e4a3 100644 --- a/src/main/resources/data/geocluster/deposits/emerald.json +++ b/src/main/resources/data/geocluster/deposits/emerald.json @@ -31,6 +31,7 @@ ], "yMin": -52, "yMax": -40, + "maxHeight": 9, "baseRadius": 6, "biomeTag": "#minecraft:is_mountain", "generationWeight": 2 diff --git a/src/main/resources/data/geocluster/deposits/emerald_extra.json b/src/main/resources/data/geocluster/deposits/emerald_extra.json index 3dbcf08..2fa0ff3 100644 --- a/src/main/resources/data/geocluster/deposits/emerald_extra.json +++ b/src/main/resources/data/geocluster/deposits/emerald_extra.json @@ -35,6 +35,7 @@ ], "yMin": -52, "yMax": -40, + "maxHeight": 9, "baseRadius": 6, "biomeTag": "#c:is_hot/overworld", "generationWeight": 2 diff --git a/src/main/resources/data/geocluster/deposits/iron.json b/src/main/resources/data/geocluster/deposits/iron.json index f581b02..22fb7fc 100644 --- a/src/main/resources/data/geocluster/deposits/iron.json +++ b/src/main/resources/data/geocluster/deposits/iron.json @@ -4,6 +4,7 @@ "yMin": 32, "yMax": 60, "baseRadius": 3, + "maxHeight": 16, "biomeTag": "#minecraft:is_overworld", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/iron_marchy.json b/src/main/resources/data/geocluster/deposits/iron_marchy.json index 7d5f812..2bd815b 100644 --- a/src/main/resources/data/geocluster/deposits/iron_marchy.json +++ b/src/main/resources/data/geocluster/deposits/iron_marchy.json @@ -4,6 +4,7 @@ "yMin": -48, "yMax": -32, "baseRadius": 6, + "maxHeight": 20, "biomeTag": "#geocluster:is_marshy", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/iron_nickel.json b/src/main/resources/data/geocluster/deposits/iron_nickel.json index 37bc172..1c0342b 100644 --- a/src/main/resources/data/geocluster/deposits/iron_nickel.json +++ b/src/main/resources/data/geocluster/deposits/iron_nickel.json @@ -35,8 +35,8 @@ ], "yMin": -16, "yMax": 90, - "size": 45, + "size": 25, "biomeTag": "#minecraft:is_overworld", - "generationWeight": 6 + "generationWeight": 2 } } \ No newline at end of file diff --git a/src/main/resources/data/geocluster/deposits/lapis.json b/src/main/resources/data/geocluster/deposits/lapis.json index 4b4098e..095b09e 100644 --- a/src/main/resources/data/geocluster/deposits/lapis.json +++ b/src/main/resources/data/geocluster/deposits/lapis.json @@ -4,7 +4,7 @@ "yMin": -64, "yMax": 64, "size": 30, - "spread": 24, + "spread": 16, "biomeTag": "#c:is_dry/overworld", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/lead_silver.json b/src/main/resources/data/geocluster/deposits/lead_silver.json index 0fe47a3..ebf9d91 100644 --- a/src/main/resources/data/geocluster/deposits/lead_silver.json +++ b/src/main/resources/data/geocluster/deposits/lead_silver.json @@ -3,8 +3,8 @@ "config": { "yMin": -16, "yMax": 32, - "size": 32, - "spread": 32, + "size": 24, + "spread": 24, "biomeTag": "#c:is_plains", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/platinum.json b/src/main/resources/data/geocluster/deposits/platinum.json index 67d97e0..b898d89 100644 --- a/src/main/resources/data/geocluster/deposits/platinum.json +++ b/src/main/resources/data/geocluster/deposits/platinum.json @@ -4,6 +4,7 @@ "yMin": -25, "yMax": 19, "baseRadius": 4, + "maxHeight": 7, "biomeTag": "#minecraft:is_mountain", "blocks": { "default": [ @@ -33,6 +34,6 @@ "chance": 1.0 } ], - "generationWeight": 4 + "generationWeight": 2 } } \ No newline at end of file diff --git a/src/main/resources/data/geocluster/deposits/quartz.json b/src/main/resources/data/geocluster/deposits/quartz.json index 391993b..727dec7 100644 --- a/src/main/resources/data/geocluster/deposits/quartz.json +++ b/src/main/resources/data/geocluster/deposits/quartz.json @@ -4,6 +4,7 @@ "yMin": -64, "yMax": -48, "baseRadius": 7, + "maxHeight": 8, "biomeTag": "#minecraft:is_overworld", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/quartz_nether.json b/src/main/resources/data/geocluster/deposits/quartz_nether.json index 2733426..d235bea 100644 --- a/src/main/resources/data/geocluster/deposits/quartz_nether.json +++ b/src/main/resources/data/geocluster/deposits/quartz_nether.json @@ -4,6 +4,7 @@ "yMin": 10, "yMax": 60, "baseRadius": 7, + "maxHeight": 16, "blockStateMatchers": [ "minecraft:netherrack", "minecraft:basalt", diff --git a/src/main/resources/data/geocluster/deposits/redstone.json b/src/main/resources/data/geocluster/deposits/redstone.json index 969f619..4f9448e 100644 --- a/src/main/resources/data/geocluster/deposits/redstone.json +++ b/src/main/resources/data/geocluster/deposits/redstone.json @@ -4,7 +4,7 @@ "yMin": -60, "yMax": 15, "size": 24, - "spread": 16, + "spread": 8, "biomeTag": "#minecraft:is_overworld", "blocks": { "default": [ diff --git a/src/main/resources/data/geocluster/deposits/tin.json b/src/main/resources/data/geocluster/deposits/tin.json index a177a8a..1633e1d 100644 --- a/src/main/resources/data/geocluster/deposits/tin.json +++ b/src/main/resources/data/geocluster/deposits/tin.json @@ -34,6 +34,6 @@ "chance": 1.0 } ], - "generationWeight": 6 + "generationWeight": 4 } } \ No newline at end of file diff --git a/src/main/resources/data/geocluster/deposits/uranium.json b/src/main/resources/data/geocluster/deposits/uranium.json index 0e375aa..fa706e5 100644 --- a/src/main/resources/data/geocluster/deposits/uranium.json +++ b/src/main/resources/data/geocluster/deposits/uranium.json @@ -8,7 +8,7 @@ "chance": 0.85 }, { - "block": "granite", + "block": null, "chance": 0.15 } ], @@ -18,7 +18,7 @@ "chance": 0.85 }, { - "block": "minecraft:deepslate_granite", + "block": null, "chance": 0.15 } ] diff --git a/src/main/resources/data/geocluster/deposits/zinc.json b/src/main/resources/data/geocluster/deposits/zinc.json index 7c4e895..309f9c6 100644 --- a/src/main/resources/data/geocluster/deposits/zinc.json +++ b/src/main/resources/data/geocluster/deposits/zinc.json @@ -26,6 +26,6 @@ "chance": 1.0 } ], - "generationWeight": 5 + "generationWeight": 4 } } diff --git a/src/main/resources/geocluster.mixins.json b/src/main/resources/geocluster.mixins.json index a63cfa0..37365a9 100644 --- a/src/main/resources/geocluster.mixins.json +++ b/src/main/resources/geocluster.mixins.json @@ -2,8 +2,10 @@ "required": true, "package": "dev.sterner.geocluster.mixin", "compatibilityLevel": "JAVA_17", + "plugin": "dev.sterner.geocluster.mixin.GeoMixinPlugin", "mixins": [ - "BiomeModificationContextImplMixin" + "BiomeModificationContextImplMixin", + "ChunkGeneratorSettingsMixin" ], "injectors": { "defaultRequire": 1