diff --git a/README.MD b/README.MD index 4d8e91e..b6a13a3 100644 --- a/README.MD +++ b/README.MD @@ -70,6 +70,7 @@ This mod also contains patches for the following mods: - Extra Utilities - Factorization - Futurepack +- Gadomancy - GalactiCraft - Highlands - Immersive Cavegen diff --git a/build.gradle.kts b/build.gradle.kts index be67f60..a547e9c 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -159,6 +159,9 @@ dependencies { //Futurepack v18.7 compileOnly(deobfCurse("futurepack-237333:2263966")) + //Gadomancy 1.0.7.3 + compileOnly(deobfCurse("gadomancy-237271:2338768")) + //Galacticraft Core 3.0.12.504 //micdoodle8.com went down compileOnly(deobf("mirror.micdoodle:GalacticraftCore:1.7-3.0.12.504")) diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/gadomancy/ChunkProviderTCOuterMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/gadomancy/ChunkProviderTCOuterMixin.java new file mode 100644 index 0000000..cac030a --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/gadomancy/ChunkProviderTCOuterMixin.java @@ -0,0 +1,61 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2025 FalsePattern, The MEGA Team + * All Rights Reserved + * + * The above copyright notice, this permission notice and the word "MEGA" + * shall be included in all copies or substantial portions of the Software. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Lesser General Public License as published by + * the Free Software Foundation, only version 3 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program. If not, see . + */ + +package com.falsepattern.endlessids.mixin.mixins.common.biome.gadomancy; + +import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper; +import makeo.gadomancy.common.utils.world.ChunkProviderTCOuter; +import org.spongepowered.asm.mixin.Final; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Mutable; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.Redirect; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import thaumcraft.common.lib.world.ThaumcraftWorldGenerator; + +import net.minecraft.world.chunk.Chunk; +import net.minecraft.world.chunk.IChunkProvider; + +@Mixin(ChunkProviderTCOuter.class) +public abstract class ChunkProviderTCOuterMixin implements IChunkProvider { + @Mutable + @Shadow(remap = false) + @Final + private static byte[] biomeArr; + + @Inject(method = "", + at = @At("RETURN"), + require = 1) + private static void extendedBiomeArr(CallbackInfo ci) { + biomeArr = new byte[0]; + } + + @Redirect(method = "provideChunk", + at = @At(value = "INVOKE", + target = "Lnet/minecraft/world/chunk/Chunk;getBiomeArray()[B"), + require = 1) + private byte[] setBiomesTweaked(Chunk instance) { + return BiomePatchHelper.getBiomeArrayTweaked(instance, i -> ThaumcraftWorldGenerator.biomeEldritchLands); + } +} diff --git a/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java b/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java index 579fa94..a7cea19 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java @@ -150,6 +150,9 @@ public enum Mixin implements IMixin { //region Futurepack FuturepackBiomeGenSpaceMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.FUTUREPACK)), "biome.futurepack.BiomeGenSpaceMixin"), //endregion Futurepack + //region Gadomancy + ChunkProviderTCOuterMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.GADOMANCY)), "biome.gadomancy.ChunkProviderTCOuterMixin"), + //endregion //region GalactiCraftCore GalactiCraftConfigManagerCoreMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.GALACTICRAFTCORE)), "biome.galacticraft.ConfigManagerCoreMixin"), //endregion GalactiCraftCore diff --git a/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java b/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java index 2e4950e..8b721e3 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java @@ -56,6 +56,7 @@ public enum TargetedMod implements ITargetedMod { EXTRAUTILITIES("Extra Utilities", false, contains("extrautilities-")), FACTORIZATION("Factorization", false, contains("factorization-")), FUTUREPACK("Futurepack", false, contains("futurepack")), + GADOMANCY("Gadomancy", false, contains("gadomancy-")), GALACTICRAFTCORE("GalactiCraftCore", false, contains("galacticraftcore")), GALAXYSPACE("GalaxySpace", false, contains("galaxyspace-")), HBM_NTM("Hbm's Nuclear Tech Mod", false, contains("hbm-ntm")),