From 3509e88cd29bd253803a5b0ce7639c78784ca501 Mon Sep 17 00:00:00 2001 From: Integer Limit <103940576+IntegerLimit@users.noreply.github.com> Date: Thu, 14 Nov 2024 21:13:50 +1100 Subject: [PATCH] Increase Fuel Efficiency of Large Boilers 10x --- .../gregtech/BoilerRecipeLogicMixin.java | 25 +++++++++++++++++++ .../resources/mixins.nomilabs.gregtech.json | 1 + 2 files changed, 26 insertions(+) create mode 100644 src/main/java/com/nomiceu/nomilabs/mixin/gregtech/BoilerRecipeLogicMixin.java diff --git a/src/main/java/com/nomiceu/nomilabs/mixin/gregtech/BoilerRecipeLogicMixin.java b/src/main/java/com/nomiceu/nomilabs/mixin/gregtech/BoilerRecipeLogicMixin.java new file mode 100644 index 00000000..519ecd7c --- /dev/null +++ b/src/main/java/com/nomiceu/nomilabs/mixin/gregtech/BoilerRecipeLogicMixin.java @@ -0,0 +1,25 @@ +package com.nomiceu.nomilabs.mixin.gregtech; + +import net.minecraft.item.ItemStack; +import net.minecraft.tileentity.TileEntityFurnace; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Redirect; + +import gregtech.api.capability.impl.BoilerRecipeLogic; + +/** + * Makes fuels last 10x as long in large boilers, to fix fuel efficiency disparity between it and small boilers. + */ +@Mixin(value = BoilerRecipeLogic.class, remap = false) +public class BoilerRecipeLogicMixin { + + @Redirect(method = "trySearchNewRecipe", + at = @At(value = "INVOKE", + target = "Lnet/minecraft/tileentity/TileEntityFurnace;getItemBurnTime(Lnet/minecraft/item/ItemStack;)I", + remap = true)) + private int increaseFuelBurnTime(ItemStack itemStack) { + return TileEntityFurnace.getItemBurnTime(itemStack) * 10; + } +} diff --git a/src/main/resources/mixins.nomilabs.gregtech.json b/src/main/resources/mixins.nomilabs.gregtech.json index 03c8007c..fbf5ec15 100644 --- a/src/main/resources/mixins.nomilabs.gregtech.json +++ b/src/main/resources/mixins.nomilabs.gregtech.json @@ -8,6 +8,7 @@ "AccessibleDecompositionRecipeHandler", "AccessibleMaterialInfo", "AccessibleModHandler", + "BoilerRecipeLogicMixin", "FluidStorageKeyAccessor", "FluidStorageKeysMixin", "GTRecipeInputMixin",