diff --git a/README.MD b/README.MD index caa1694..33f8c17 100644 --- a/README.MD +++ b/README.MD @@ -56,6 +56,7 @@ This mod also contains patches for the following mods: - Enderlicious - Enhanced Biomes - Erebus +- Extended Planets - Extra Planets - Extra Utilities - Factorization diff --git a/build.gradle.kts b/build.gradle.kts index f720878..be67f60 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -143,6 +143,10 @@ dependencies { //Erebus 0.4.7 compileOnly(deobfCurse("theerebus-220698:2305035")) + //Extended Planets 0.4.2 + //Source: https://www.mcmod.cn/class/1301.html + compileOnly(deobf("mirror:ExtendedPlanets:0.4.2")) + //Extra Planets 2.1.4 compileOnly(deobfCurse("extraplanets-241291:3214413")) diff --git a/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/extendedplanets/ChunkProviderOceanMixin.java b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/extendedplanets/ChunkProviderOceanMixin.java new file mode 100644 index 0000000..bd028a9 --- /dev/null +++ b/src/main/java/com/falsepattern/endlessids/mixin/mixins/common/biome/extendedplanets/ChunkProviderOceanMixin.java @@ -0,0 +1,47 @@ +/* + * EndlessIDs + * + * Copyright (C) 2022-2024 FalsePattern + * All Rights Reserved + * + * The above copyright notice, this permission notice and the words "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, either version 3 of the License, or + * (at your option) any later version. + * + * 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 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.extendedplanets; + +import ExtendedPlanets.dimension.other.ChunkProviderOcean; +import com.falsepattern.endlessids.mixin.helpers.BiomePatchHelper; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import net.minecraft.world.biome.BiomeGenBase; +import net.minecraft.world.chunk.Chunk; + +@Mixin(ChunkProviderOcean.class) +public abstract class ChunkProviderOceanMixin { + @Shadow(remap = false) private BiomeGenBase[] biomesForGeneration; + + @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, biomesForGeneration); + } +} 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 67bdfd6..7120a7b 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/plugin/Mixin.java @@ -135,6 +135,9 @@ public enum Mixin implements IMixin { //region Erebus ErebusModBiomesMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.EREBUS)), "biome.erebus.ModBiomesMixin"), //endregion Erebus + //region Extended Planets + ChunkProviderOceanMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.EXTENDEDPLANETS)), "biome.extendedplanets.ChunkProviderOceanMixin"), + //endregion //region ExtraPlanets ExtraPlanetsConfigMixin(Side.COMMON, condition(() -> GeneralConfig.extendBiome).and(require(TargetedMod.EXTRAPLANETS)), "biome.extraplanets.ConfigMixin"), //endregion ExtraPlanets 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 2af36d5..d12c532 100644 --- a/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java +++ b/src/main/java/com/falsepattern/endlessids/mixin/plugin/TargetedMod.java @@ -52,6 +52,7 @@ public enum TargetedMod implements ITargetedMod { EB("Enhanced Biomes", false, contains("Enhanced Biomes").or(contains("enhancedbiomes"))), ENDERLICIOUS("Enderlicious", false, contains("enderlicious-")), EREBUS("The Erebus", false, contains("theerebus")), + EXTENDEDPLANETS("Extended Planets", false, contains("extendedplanets-")), EXTRAPLANETS("Extra Planets", false, contains("extraplanets-")), EXTRAUTILITIES("Extra Utilities", false, contains("extrautilities-")), FACTORIZATION("Factorization", false, contains("factorization-")),