From 0c40830f97fb8868de2442cfba09cce04a72f9bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=9D=E5=A4=8F=E5=90=8C=E5=AD=A6?= <2411829240@qq.com> Date: Mon, 27 May 2024 00:26:15 +0800 Subject: [PATCH] Fix A bug where Space Module Miner does not output --- .../wohaopa/GTNHModify/LateMixinLoader.java | 5 +++++ .../com/github/wohaopa/GTNHModify/ModHelper.java | 1 + .../TileEntityModuleMinerMixin.java | 16 ++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gtnhintergalactic/TileEntityModuleMinerMixin.java diff --git a/src/main/java/com/github/wohaopa/GTNHModify/LateMixinLoader.java b/src/main/java/com/github/wohaopa/GTNHModify/LateMixinLoader.java index 610b61d..f306cdf 100644 --- a/src/main/java/com/github/wohaopa/GTNHModify/LateMixinLoader.java +++ b/src/main/java/com/github/wohaopa/GTNHModify/LateMixinLoader.java @@ -23,6 +23,8 @@ public List getMixins(Set loadedMods) { ModHelper.hasGregtech = true; } else if (modId.equals("Thaumcraft")) { ModHelper.hasThaumcraft = true; + } else if (modId.equals("gtnhintergalactic")) { + ModHelper.hasGtnhIntergalactic = true; } } @@ -38,6 +40,9 @@ public List getMixins(Set loadedMods) { if (ModHelper.hasThaumcraft) { mixins.add("thaumcraft.TileAlchemyFurnaceMixin"); } + if (ModHelper.hasGtnhIntergalactic) { + mixins.add("gtnhintergalactic.TileEntityModuleMinerMixin"); + } return mixins; } diff --git a/src/main/java/com/github/wohaopa/GTNHModify/ModHelper.java b/src/main/java/com/github/wohaopa/GTNHModify/ModHelper.java index eb18521..48c251a 100644 --- a/src/main/java/com/github/wohaopa/GTNHModify/ModHelper.java +++ b/src/main/java/com/github/wohaopa/GTNHModify/ModHelper.java @@ -4,4 +4,5 @@ public class ModHelper { public static boolean hasGregtech; public static boolean hasThaumcraft; + public static boolean hasGtnhIntergalactic; } diff --git a/src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gtnhintergalactic/TileEntityModuleMinerMixin.java b/src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gtnhintergalactic/TileEntityModuleMinerMixin.java new file mode 100644 index 0000000..0532001 --- /dev/null +++ b/src/main/java/com/github/wohaopa/GTNHModify/mixins/late/gtnhintergalactic/TileEntityModuleMinerMixin.java @@ -0,0 +1,16 @@ +package com.github.wohaopa.GTNHModify.mixins.late.gtnhintergalactic; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; + +import com.gtnewhorizons.gtnhintergalactic.tile.multi.elevatormodules.TileEntityModuleMiner; +import com.llamalad7.mixinextras.injector.ModifyReturnValue; + +@Mixin(value = TileEntityModuleMiner.class, remap = false) +public abstract class TileEntityModuleMinerMixin { + + @ModifyReturnValue(method = "getRecipeTime", at = @At("RETURN")) + private int fixZeroRecipeTimeBug(int original) { + return Math.max(original, 1); + } +}