From 50c90fd53b9522c2f0dbb1d567f58cbcc08fe501 Mon Sep 17 00:00:00 2001 From: Midnight145 <23142346+Midnight145@users.noreply.github.com> Date: Tue, 10 Dec 2024 03:49:21 -0600 Subject: [PATCH] Configurable ender quarry RF storage (#446) Co-authored-by: Wilhelm Schuster Co-authored-by: Martin Robertz (cherry picked from commit e12c6d8618f7b9d964a821cfebccf2ad2d8ae57b) --- .../hodgepodge/config/TweaksConfig.java | 5 +++++ .../mitchej123/hodgepodge/mixins/Mixins.java | 4 ++++ .../MixinTileEntityEnderQuarry.java | 17 +++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100644 src/main/java/com/mitchej123/hodgepodge/mixins/late/extrautilities/MixinTileEntityEnderQuarry.java diff --git a/src/main/java/com/mitchej123/hodgepodge/config/TweaksConfig.java b/src/main/java/com/mitchej123/hodgepodge/config/TweaksConfig.java index ac1228a6..d317cf2c 100644 --- a/src/main/java/com/mitchej123/hodgepodge/config/TweaksConfig.java +++ b/src/main/java/com/mitchej123/hodgepodge/config/TweaksConfig.java @@ -199,6 +199,11 @@ public class TweaksConfig { @Config.DefaultInt(64) public static int ic2SeedMaxStackSize; + @Config.Comment("Ender Quarry RF Storage Override (ExU default value: 10000000) (0 to use default value)") + @Config.RangeInt(min = 0) + @Config.DefaultInt(0) + public static int extraUtilitiesEnderQuarryOverride; + // Minechem @Config.Comment("Minechem Atropine High (Delirium) effect ID") diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java index b6bd0046..90a6723b 100644 --- a/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/Mixins.java @@ -777,6 +777,10 @@ public enum Mixins { FIX_FILTER_DUPE(new Builder("Prevent hotkeying other items onto item filters while they are open") .addMixinClasses("extrautilities.MixinContainerFilter").setPhase(Phase.LATE).setSide(Side.BOTH) .setApplyIf(() -> FixesConfig.fixExtraUtilitiesFilterDupe).addTargetedMod(TargetedMod.EXTRA_UTILITIES)), + CONFIGURABLE_ENDERQUARRY_ENERGY(new Builder("Ender Quarry energy storage override") + .addMixinClasses("extrautilities.MixinTileEntityEnderQuarry").setPhase(Phase.LATE).setSide(Side.BOTH) + .setApplyIf(() -> TweaksConfig.extraUtilitiesEnderQuarryOverride > 0) + .addTargetedMod(TargetedMod.EXTRA_UTILITIES)), // Gliby's Voice Chat FIX_GLIBYS_VC_THREAD_SHUTDOWN_CLIENT( diff --git a/src/main/java/com/mitchej123/hodgepodge/mixins/late/extrautilities/MixinTileEntityEnderQuarry.java b/src/main/java/com/mitchej123/hodgepodge/mixins/late/extrautilities/MixinTileEntityEnderQuarry.java new file mode 100644 index 00000000..88da43cd --- /dev/null +++ b/src/main/java/com/mitchej123/hodgepodge/mixins/late/extrautilities/MixinTileEntityEnderQuarry.java @@ -0,0 +1,17 @@ +package com.mitchej123.hodgepodge.mixins.late.extrautilities; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.ModifyArg; + +import com.mitchej123.hodgepodge.config.TweaksConfig; +import com.rwtema.extrautils.tileentity.enderquarry.TileEntityEnderQuarry; + +@Mixin(value = TileEntityEnderQuarry.class, remap = false) +public class MixinTileEntityEnderQuarry { + + @ModifyArg(method = "", at = @At(value = "INVOKE", target = "Lcofh/api/energy/EnergyStorage;(I)V")) + private int mixinInit(int energyStored) { + return TweaksConfig.extraUtilitiesEnderQuarryOverride; + } +}