From b424aced707874106ea85cc82439b9ae2aac92ff Mon Sep 17 00:00:00 2001 From: Jakob Date: Wed, 31 Jul 2024 15:37:18 -0400 Subject: [PATCH] Updated to 1.21 --- gradle.properties | 10 +++++----- .../mixin/ControlsOptionsScreenMixin.java | 10 ++++------ .../rebind_all_the_keys/mixin/KeybindsScreenMixin.java | 2 +- src/main/resources/fabric.mod.json | 4 ++-- 4 files changed, 12 insertions(+), 14 deletions(-) diff --git a/gradle.properties b/gradle.properties index 147b979..92eec9d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,14 +3,14 @@ org.gradle.jvmargs=-Xmx1G # Fabric Properties # check these on https://fabricmc.net/develop - minecraft_version=1.20.5 - yarn_mappings=1.20.5+build.1 - loader_version=0.15.10 + minecraft_version=1.21 + yarn_mappings=1.21+build.9 + loader_version=0.15.11 # Mod Properties - mod_version = 1.5.2+1.20.5 + mod_version = 1.5.2+1.21 maven_group = com.minenash archives_base_name = rebind-all-the-keys # Dependencies - fabric_version=0.97.5+1.20.5 + fabric_version=0.100.8+1.21 diff --git a/src/main/java/com/minenash/rebind_all_the_keys/mixin/ControlsOptionsScreenMixin.java b/src/main/java/com/minenash/rebind_all_the_keys/mixin/ControlsOptionsScreenMixin.java index a24fc46..e6ed30f 100644 --- a/src/main/java/com/minenash/rebind_all_the_keys/mixin/ControlsOptionsScreenMixin.java +++ b/src/main/java/com/minenash/rebind_all_the_keys/mixin/ControlsOptionsScreenMixin.java @@ -16,21 +16,19 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @Mixin(ControlsOptionsScreen.class) -public class ControlsOptionsScreenMixin extends GameOptionsScreen{ - - @Shadow @Nullable private OptionListWidget optionListWidget; +public abstract class ControlsOptionsScreenMixin extends GameOptionsScreen{ public ControlsOptionsScreenMixin(Screen parent, GameOptions gameOptions, Text title) { super(parent, gameOptions, title); } - @Inject(method = "init", at = @At(value = "TAIL")) + @Inject(method = "addOptions", at = @At(value = "TAIL")) public void addMacCommandToControl(CallbackInfo ci) { if (MinecraftClient.IS_SYSTEM_MAC) - optionListWidget.addAll(RebindAllTheKeys.doubleTapSprint, RebindAllTheKeys.doubleTapFly, RebindAllTheKeys.macCommandToControl); + body.addAll(RebindAllTheKeys.doubleTapSprint, RebindAllTheKeys.doubleTapFly, RebindAllTheKeys.macCommandToControl); else - optionListWidget.addAll(RebindAllTheKeys.doubleTapSprint, RebindAllTheKeys.doubleTapFly); + body.addAll(RebindAllTheKeys.doubleTapSprint, RebindAllTheKeys.doubleTapFly); } @Redirect(method = "getOptions", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/GameOptions;getSprintToggled()Lnet/minecraft/client/option/SimpleOption;")) diff --git a/src/main/java/com/minenash/rebind_all_the_keys/mixin/KeybindsScreenMixin.java b/src/main/java/com/minenash/rebind_all_the_keys/mixin/KeybindsScreenMixin.java index 0aad03c..7441ccb 100644 --- a/src/main/java/com/minenash/rebind_all_the_keys/mixin/KeybindsScreenMixin.java +++ b/src/main/java/com/minenash/rebind_all_the_keys/mixin/KeybindsScreenMixin.java @@ -23,7 +23,7 @@ @Environment(EnvType.CLIENT) @Mixin(KeybindsScreen.class) -public class KeybindsScreenMixin extends GameOptionsScreen { +public abstract class KeybindsScreenMixin extends GameOptionsScreen { @Shadow @Nullable public KeyBinding selectedKeyBinding; diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 67f3937..42ee1fc 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -26,8 +26,8 @@ ], "accessWidener": "rebind_all_the_keys.accesswidener", "depends": { - "fabricloader": ">=0.11.3", + "fabricloader": "*", "fabric": "*", - "minecraft": ">=1.20.5" + "minecraft": ">=1.21" } }