From a0a473314a0e2eb0d316fdf619be00f6e7aa628b Mon Sep 17 00:00:00 2001 From: tier940 Date: Wed, 11 Feb 2026 15:27:23 +0900 Subject: [PATCH 1/2] Add BQu mixin --- buildscript.properties | 1 + dependencies.gradle | 6 ++ .../github/gtexpert/core/api/util/Mods.java | 2 + .../core/integration/ae/AEConfigHolder.java | 4 -- .../integration/ae/recipes/AEToolsRecipe.java | 3 +- .../integration/eio/EnderIOConfigHolder.java | 4 -- .../eio/recipes/EIOToolsRecipe.java | 3 +- .../core/integration/tc/TCConfigHolder.java | 3 - .../integration/tc/recipes/TCToolsRecipe.java | 3 +- .../gtexpert/core/mixins/GTEMixinLoader.java | 1 + .../betterquesting/GuiHomeUpdateMixin.java | 57 +++++++++++++++++++ .../mixins.gtexpert.betterquesting.json | 14 +++++ 12 files changed, 84 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/github/gtexpert/core/mixins/betterquesting/GuiHomeUpdateMixin.java create mode 100644 src/main/resources/mixins.gtexpert.betterquesting.json diff --git a/buildscript.properties b/buildscript.properties index 92cb7325..48c3f0e7 100644 --- a/buildscript.properties +++ b/buildscript.properties @@ -33,6 +33,7 @@ debug_deda = false debug_avaritia = false debug_gtfo = false debug_jer = false +debug_bqu = false # Select a username for testing your mod with breakpoints. You may leave this empty for a random username each time you # restart Minecraft in development. Choose this dependent on your mod: diff --git a/dependencies.gradle b/dependencies.gradle index dc7f2bb5..37602d31 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -129,6 +129,12 @@ dependencies { runtimeOnly rfg.deobf("curse.maven:draconicadditions-314515:3514704") } + // Debug BQu: 4.2.7 + compileOnly rfg.deobf("curse.maven:better-questing-unofficial-629629:7421294") + if (project.debug_all.toBoolean() || project.debug_deda.toBoolean()) { + runtimeOnly rfg.deobf("curse.maven:better-questing-unofficial-629629:7421294") + } + // Debug Avaritia: 3.3.0.47-hotfix1 if (project.debug_all.toBoolean() || project.debug_avaritia.toBoolean()) { runtimeOnly rfg.deobf("curse.maven:avaritia-1-1x-unofficial-1165010:7186329") diff --git a/src/main/java/com/github/gtexpert/core/api/util/Mods.java b/src/main/java/com/github/gtexpert/core/api/util/Mods.java index 1839ed9c..2af0612d 100644 --- a/src/main/java/com/github/gtexpert/core/api/util/Mods.java +++ b/src/main/java/com/github/gtexpert/core/api/util/Mods.java @@ -31,6 +31,7 @@ public enum Mods { Avaritia(Names.AVARITIA), Avaritiaaddons(Names.AVARITIAADDONS), Baubles(Names.BAUBLES), + BetterQuesting(Names.BETTER_QUESTING), Chisel(Names.CHISEL), CTM(Names.CONNECTED_TEXTURES_MOD), CraftTweaker(Names.CRAFT_TWEAKER), @@ -100,6 +101,7 @@ public static class Names { public static final String AVARITIA = "avaritia"; public static final String AVARITIAADDONS = "avaritiaddons"; public static final String BAUBLES = "baubles"; + public static final String BETTER_QUESTING = "betterquesting"; public static final String BOTANY = "botany"; public static final String CHISEL = "chisel"; public static final String CONNECTED_TEXTURES_MOD = "ctm"; diff --git a/src/main/java/com/github/gtexpert/core/integration/ae/AEConfigHolder.java b/src/main/java/com/github/gtexpert/core/integration/ae/AEConfigHolder.java index a6163edb..ecfda338 100644 --- a/src/main/java/com/github/gtexpert/core/integration/ae/AEConfigHolder.java +++ b/src/main/java/com/github/gtexpert/core/integration/ae/AEConfigHolder.java @@ -17,10 +17,6 @@ public class AEConfigHolder { @Config.RangeInt(min = 2, max = 10) public static int voltageTier = 3; - @Config.Comment({ "Change AE swords, axes, etc. to GT recipe standards.", - "CEu's hardToolArmorRecipes to true to reflect.", "Default: false" }) - public static boolean hardToolRecipes = false; - @Config.Comment({ "Integrate Printed Silicon and various Circuit creation molds.", "Default: false" }) public static boolean moveSteelShape = false; } diff --git a/src/main/java/com/github/gtexpert/core/integration/ae/recipes/AEToolsRecipe.java b/src/main/java/com/github/gtexpert/core/integration/ae/recipes/AEToolsRecipe.java index bf91d2c3..24bebae0 100644 --- a/src/main/java/com/github/gtexpert/core/integration/ae/recipes/AEToolsRecipe.java +++ b/src/main/java/com/github/gtexpert/core/integration/ae/recipes/AEToolsRecipe.java @@ -8,12 +8,11 @@ import gregtech.common.ConfigHolder; import com.github.gtexpert.core.api.util.Mods; -import com.github.gtexpert.core.integration.ae.AEConfigHolder; public class AEToolsRecipe { public static void init() { - if (ConfigHolder.recipes.hardToolArmorRecipes && AEConfigHolder.hardToolRecipes) { + if (ConfigHolder.recipes.hardToolArmorRecipes) { // Nether Quartz Axe ModHandler.removeRecipeByName( Mods.AppliedEnergistics2.getResource("tools/nether_quartz_axe")); diff --git a/src/main/java/com/github/gtexpert/core/integration/eio/EnderIOConfigHolder.java b/src/main/java/com/github/gtexpert/core/integration/eio/EnderIOConfigHolder.java index c85fb05e..59186f97 100644 --- a/src/main/java/com/github/gtexpert/core/integration/eio/EnderIOConfigHolder.java +++ b/src/main/java/com/github/gtexpert/core/integration/eio/EnderIOConfigHolder.java @@ -16,10 +16,6 @@ public class EnderIOConfigHolder { @Config.RangeInt(min = 1, max = 8) public static int voltageTier = 3; - @Config.Comment({ "Change EIO swords, axes, armor, etc. to GT recipe standards.", - "CEu's hardToolArmorRecipes to true to reflect.", "Default: false" }) - public static boolean hardToolArmorRecipes = false; - @Config.Comment({ "Add Shapeless Recipe in CoreMod Machines and EIO Machines.", "This change adds a recipe for equivalent exchange of HV machines and EIO machines", "Default: false" }) public static boolean addShapelessRecipeMachines = false; diff --git a/src/main/java/com/github/gtexpert/core/integration/eio/recipes/EIOToolsRecipe.java b/src/main/java/com/github/gtexpert/core/integration/eio/recipes/EIOToolsRecipe.java index 760502bf..f86027fd 100644 --- a/src/main/java/com/github/gtexpert/core/integration/eio/recipes/EIOToolsRecipe.java +++ b/src/main/java/com/github/gtexpert/core/integration/eio/recipes/EIOToolsRecipe.java @@ -10,7 +10,6 @@ import gregtech.common.ConfigHolder; import com.github.gtexpert.core.api.unification.material.GTEMaterials; -import com.github.gtexpert.core.integration.eio.EnderIOConfigHolder; import crazypants.enderio.base.init.ModObject; import crazypants.enderio.endergy.init.EndergyObject; @@ -18,7 +17,7 @@ public class EIOToolsRecipe { public static void init() { - if (ConfigHolder.recipes.hardToolArmorRecipes && EnderIOConfigHolder.hardToolArmorRecipes) { + if (ConfigHolder.recipes.hardToolArmorRecipes) { // Dark Helm ModHandler.addShapedRecipe(true, "dark_steel_helmet", new ItemStack(ModObject.itemDarkSteelHelmet.getItemNN(), 1), diff --git a/src/main/java/com/github/gtexpert/core/integration/tc/TCConfigHolder.java b/src/main/java/com/github/gtexpert/core/integration/tc/TCConfigHolder.java index 3a8ddbd5..fe83e35c 100644 --- a/src/main/java/com/github/gtexpert/core/integration/tc/TCConfigHolder.java +++ b/src/main/java/com/github/gtexpert/core/integration/tc/TCConfigHolder.java @@ -11,7 +11,4 @@ category = "Thaumcraft") public class TCConfigHolder { - @Config.Comment({ "Change Thaumcraft recipes to GT recipe standards.", - "CEu's hardToolArmorRecipes to true to reflect.", "Default: false" }) - public static boolean hardToolRecipes = false; } diff --git a/src/main/java/com/github/gtexpert/core/integration/tc/recipes/TCToolsRecipe.java b/src/main/java/com/github/gtexpert/core/integration/tc/recipes/TCToolsRecipe.java index e04a9d56..31f22102 100644 --- a/src/main/java/com/github/gtexpert/core/integration/tc/recipes/TCToolsRecipe.java +++ b/src/main/java/com/github/gtexpert/core/integration/tc/recipes/TCToolsRecipe.java @@ -9,12 +9,11 @@ import com.github.gtexpert.core.api.unification.material.GTEMaterials; import com.github.gtexpert.core.api.util.Mods; -import com.github.gtexpert.core.integration.tc.TCConfigHolder; public class TCToolsRecipe { public static void init() { - if (ConfigHolder.recipes.hardToolArmorRecipes && TCConfigHolder.hardToolRecipes) { + if (ConfigHolder.recipes.hardToolArmorRecipes) { // Dark Helm ModHandler.removeRecipeByName(Mods.Thaumcraft.getResource("thaumiumhelm")); ModHandler.addShapedRecipe(true, "thaumium_helm", diff --git a/src/main/java/com/github/gtexpert/core/mixins/GTEMixinLoader.java b/src/main/java/com/github/gtexpert/core/mixins/GTEMixinLoader.java index f8de01c8..ae66aab6 100644 --- a/src/main/java/com/github/gtexpert/core/mixins/GTEMixinLoader.java +++ b/src/main/java/com/github/gtexpert/core/mixins/GTEMixinLoader.java @@ -19,6 +19,7 @@ public class GTEMixinLoader implements ILateMixinLoader { public static final Map modMixinsConfig = new ImmutableMap.Builder() + .put(Mods.Names.BETTER_QUESTING, true) .put(Mods.Names.DRACONIC_EVOLUTION, true) .put(Mods.Names.DRACONIC_ADDITIONS, true) .put(Mods.Names.GREGTECH, true) diff --git a/src/main/java/com/github/gtexpert/core/mixins/betterquesting/GuiHomeUpdateMixin.java b/src/main/java/com/github/gtexpert/core/mixins/betterquesting/GuiHomeUpdateMixin.java new file mode 100644 index 00000000..f1f83f7c --- /dev/null +++ b/src/main/java/com/github/gtexpert/core/mixins/betterquesting/GuiHomeUpdateMixin.java @@ -0,0 +1,57 @@ +package com.github.gtexpert.core.mixins.betterquesting; + +import java.io.File; + +import net.minecraft.client.Minecraft; +import net.minecraftforge.fml.common.FMLCommonHandler; + +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; + +import betterquesting.api.storage.BQ_Settings; +import betterquesting.api2.client.gui.controls.IPanelButton; +import betterquesting.api2.client.gui.events.PanelEvent; +import betterquesting.api2.client.gui.events.types.PEventButton; +import betterquesting.client.gui2.GuiHome; +import betterquesting.commands.admin.QuestCommandDefaults; +import betterquesting.handlers.SaveLoadHandler; + +/** + * Fixes the "Update Available!" button on the BetterQuesting home screen. + * The original handler only checks for the legacy single-file format (DefaultQuests.json), + * silently ignoring the directory format (DefaultQuests/) used by newer modpacks. + * This mixin adds support for the directory format by delegating to + * {@link QuestCommandDefaults#load}, matching the behavior of {@code /bq_admin default load}. + */ +@Mixin(value = GuiHome.class, remap = false) +public class GuiHomeUpdateMixin { + + @Inject(method = "onButtonPress", at = @At("HEAD"), cancellable = true) + private void gtexpert$fixUpdateButton(PanelEvent event, CallbackInfo ci) { + if (!(event instanceof PEventButton)) return; + + IPanelButton btn = ((PEventButton) event).getButton(); + if (btn.getButtonID() != 5) return; + + File dataDir = new File(BQ_Settings.defaultDir, QuestCommandDefaults.DEFAULT_FILE); + File legacyFile = new File(BQ_Settings.defaultDir, QuestCommandDefaults.DEFAULT_FILE + ".json"); + + if (dataDir.exists()) { + FMLCommonHandler.instance().getMinecraftServerInstance().addScheduledTask(() -> { + QuestCommandDefaults.load(null, null, dataDir, false); + SaveLoadHandler.INSTANCE.resetUpdate(); + }); + Minecraft.getMinecraft().displayGuiScreen(null); + } else if (legacyFile.exists()) { + FMLCommonHandler.instance().getMinecraftServerInstance().addScheduledTask(() -> { + QuestCommandDefaults.loadLegacy(null, null, legacyFile, false); + SaveLoadHandler.INSTANCE.resetUpdate(); + }); + Minecraft.getMinecraft().displayGuiScreen(null); + } + + ci.cancel(); + } +} diff --git a/src/main/resources/mixins.gtexpert.betterquesting.json b/src/main/resources/mixins.gtexpert.betterquesting.json new file mode 100644 index 00000000..32418f6f --- /dev/null +++ b/src/main/resources/mixins.gtexpert.betterquesting.json @@ -0,0 +1,14 @@ +{ + "package": "com.github.gtexpert.core.mixins.betterquesting", + "refmap": "mixins.gtexpert.refmap.json", + "target": "@env(DEFAULT)", + "minVersion": "0.8", + "compatibilityLevel": "JAVA_8", + "mixins": [ + ], + "server": [ + ], + "client": [ + "GuiHomeUpdateMixin" + ] +} From 6f4e48245658dbb50222b4a49ae0a655bc77ca5e Mon Sep 17 00:00:00 2001 From: tier940 Date: Wed, 11 Feb 2026 15:32:33 +0900 Subject: [PATCH 2/2] fix --- dependencies.gradle | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/dependencies.gradle b/dependencies.gradle index 37602d31..1639032d 100644 --- a/dependencies.gradle +++ b/dependencies.gradle @@ -73,9 +73,10 @@ dependencies { runtimeOnly "curse.maven:implosionnobomb-1094386:5731331" } - // Debug ExtraCells2 Additions: 1.3.8 + // Debug ExtraCells2 Additions if (project.debug_all.toBoolean() || project.debug_aea.toBoolean()) { - runtimeOnly "curse.maven:ae-additions-extra-cells-2-fork-493962:3814371" + runtimeOnly "curse.maven:forgelin-continuous-456403:7182824" // Forgelin-Continuous 2.2.21.0 + runtimeOnly "curse.maven:ae-additions-extra-cells-2-fork-493962:3814371" // ExtraCells2 Additions: 1.3.8 } // Debug ExtraCPUs: 1.2.1 @@ -131,7 +132,7 @@ dependencies { // Debug BQu: 4.2.7 compileOnly rfg.deobf("curse.maven:better-questing-unofficial-629629:7421294") - if (project.debug_all.toBoolean() || project.debug_deda.toBoolean()) { + if (project.debug_all.toBoolean() || project.debug_bqu.toBoolean()) { runtimeOnly rfg.deobf("curse.maven:better-questing-unofficial-629629:7421294") }