diff options
author | Jacob <55346310+Kathund@users.noreply.github.com> | 2025-06-20 22:20:32 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-06-20 16:20:32 +0200 |
commit | 9189dbbacf88bc0cc53f367ea79db456fbb08a3c (patch) | |
tree | c77b467a682abb5c763446368a749c64714f34fd /src | |
parent | 286691c54c87b5e2e70eef7b51469b4ade5a75f6 (diff) | |
download | Firmament-9189dbbacf88bc0cc53f367ea79db456fbb08a3c.tar.gz Firmament-9189dbbacf88bc0cc53f367ea79db456fbb08a3c.tar.bz2 Firmament-9189dbbacf88bc0cc53f367ea79db456fbb08a3c.zip |
feat: hide recipe book (#124)
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/moe/nea/firmament/mixins/MixinRecipeBookScreen.java | 16 | ||||
-rw-r--r-- | src/main/kotlin/features/fixes/Fixes.kt | 1 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/main/java/moe/nea/firmament/mixins/MixinRecipeBookScreen.java b/src/main/java/moe/nea/firmament/mixins/MixinRecipeBookScreen.java new file mode 100644 index 0000000..2dbe738 --- /dev/null +++ b/src/main/java/moe/nea/firmament/mixins/MixinRecipeBookScreen.java @@ -0,0 +1,16 @@ +package moe.nea.firmament.mixins; + +import moe.nea.firmament.features.fixes.Fixes; +import net.minecraft.client.gui.screen.ingame.RecipeBookScreen; +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; + +@Mixin(value = RecipeBookScreen.class, priority = 999) +public class MixinRecipeBookScreen { + @Inject(method = "addRecipeBook", at = @At("HEAD"), cancellable = true) + public void addRecipeBook(CallbackInfo ci) { + if (Fixes.TConfig.INSTANCE.getHideRecipeBook()) ci.cancel(); + } +} diff --git a/src/main/kotlin/features/fixes/Fixes.kt b/src/main/kotlin/features/fixes/Fixes.kt index 5e6350d..30034db 100644 --- a/src/main/kotlin/features/fixes/Fixes.kt +++ b/src/main/kotlin/features/fixes/Fixes.kt @@ -25,6 +25,7 @@ object Fixes : FirmamentFeature { val hidePotionEffects by toggle("hide-mob-effects") { false } val noHurtCam by toggle("disable-hurt-cam") { false } val hideSlotHighlights by toggle("hide-slot-highlights") { false } + val hideRecipeBook by toggle("hide-recipe-book") { false } } override val config: ManagedConfig |