diff --git a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java index eafa1045..8fb422b8 100644 --- a/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java +++ b/src/main/java/com/mitchej123/hodgepodge/config/FixesConfig.java @@ -523,6 +523,12 @@ public class FixesConfig { @Config.DefaultBoolean(true) public static boolean java12MineChemCompat; + // Minefactory Reloaded + + @Config.Comment("Prevents Sacred Rubber Tree Generation") + @Config.DefaultBoolean(false) + public static boolean disableMassiveSacredTreeGeneration; + // Morpheus @Config.Comment("Fix not properly waking players if not everyone is sleeping") diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java index 856def59..6cb56467 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java @@ -630,6 +630,12 @@ public enum Mixins { .addMixinClasses("cofhcore.MixinOreDictionaryArbiter").setPhase(Phase.EARLY).setSide(Side.BOTH) .addTargetedMod(TargetedMod.COFH_CORE).setApplyIf(() -> FixesConfig.fixCofhOreDictNPE)), + // Minefactory Reloaded + DISARM_SACRED_TREE(new Builder("Prevents Sacred Rubber Tree Generation") + .addMixinClasses("minefactoryreloaded.MixinBlockRubberSapling").setPhase(Phase.LATE).setSide(Side.BOTH) + .addTargetedMod(TargetedMod.MINEFACTORY_RELOADED) + .setApplyIf(() -> FixesConfig.disableMassiveSacredTreeGeneration)), + // Immersive engineering JAVA12_IMMERSIVE_ENGINERRING(new Builder("Immersive Engineering Java-12 safe potion array resizing") .setPhase(Phase.LATE).setSide(Side.BOTH).addMixinClasses("immersiveengineering.MixinIEPotions") diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/late/minefactoryreloaded/MixinBlockRubberSapling.java b/src/main/java/com/mitchej123/hodgepodge/mixins/late/minefactoryreloaded/MixinBlockRubberSapling.java new file mode 100644 index 00000000..827493d7 --- /dev/null +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/late/minefactoryreloaded/MixinBlockRubberSapling.java @@ -0,0 +1,32 @@ +package com.mitchej123.hodgepodge.mixins.late.minefactoryreloaded; + +import java.util.Random; + +import net.minecraft.world.World; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import powercrystals.minefactoryreloaded.block.BlockRubberSapling; +import powercrystals.minefactoryreloaded.world.MineFactoryReloadedWorldGen; +import powercrystals.minefactoryreloaded.world.WorldGenMassiveTree; + +@Mixin(BlockRubberSapling.class) +public class MixinBlockRubberSapling { + + /** + * @author DrParadox7 + * @reason Swap Massive world-breaking tree to Mega, a still reasonably large but safe tree, should it still be + * obtained by chance. + */ + @Redirect( + method = "func_149878_d", + at = @At( + value = "INVOKE", + target = "Lpowercrystals/minefactoryreloaded/world/WorldGenMassiveTree;generate(Lnet/minecraft/world/World;Ljava/util/Random;III)Z")) + private boolean hodgepodge$generateMassiveRubberTree(WorldGenMassiveTree instance, World world, Random random, + int x, int y, int z) { + return MineFactoryReloadedWorldGen.generateMegaRubberTree(world, random, x, y, z, true); + } +}