Skip to content

Commit

Permalink
Updated to 1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Minenash committed May 28, 2021
1 parent 2d9eee2 commit 8398216
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,16 @@ public void generateDebugRebinds(CallbackInfo _info) {
RebindAllTheKeys.updateDebugKeybinds();
}

// @Redirect(method = "load", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/options/KeyBinding;setBoundKey(Lnet/minecraft/client/util/InputUtil$Key;)V"))
// public void fixKeybindsAfterAmecsIsRemoved(KeyBinding keyBinding, InputUtil.Key key) {
//
// if (!RebindAllTheKeys.isAmecsInstalled && keyBinding.getCategory().equals("rebind_all_the_keys.keybind_group.debug") && !keyBinding.getTranslationKey().equals("rebind_all_the_keys.keybind.debug_key") && key.getCode() > -1) {
// String prefix = key.getCategory() == InputUtil.Type.MOUSE ? "key.mouse." : "key.keyboard.";
// keyBinding.setBoundKey(InputUtil.fromTranslationKey(prefix + -key.getCode()));
// }
// else
// keyBinding.setBoundKey(key);
//
// }
@Redirect(method = "accept", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/option/KeyBinding;setBoundKey(Lnet/minecraft/client/util/InputUtil$Key;)V"))
public void fixKeybindsAfterAmecsIsRemoved(KeyBinding keyBinding, InputUtil.Key key) {

if (!RebindAllTheKeys.isAmecsInstalled && keyBinding.getCategory().equals("rebind_all_the_keys.keybind_group.debug") && !keyBinding.getTranslationKey().equals("rebind_all_the_keys.keybind.debug_key") && key.getCode() > -1) {
String prefix = key.getCategory() == InputUtil.Type.MOUSE ? "key.mouse." : "key.keyboard.";
keyBinding.setBoundKey(InputUtil.fromTranslationKey(prefix + -key.getCode()));
}
else
keyBinding.setBoundKey(key);

}

}

0 comments on commit 8398216

Please sign in to comment.