Skip to content

Commit

Permalink
Implement HWYLA keybindings fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Mar 26, 2024
1 parent 14d570e commit f9f1e49
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 0 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,8 @@ All changes are toggleable via config files.
* **Disable Bee Damage Armor Bypass:** Disables damage caused by bees bypassing player armor
* **Duplication Fixes:** Fixes various duplication exploits
* **Replanting Cocoa Beans:** Allows Forestry farms to automatically replant cocoa beans
* **HWYLA**
* **Keybindings Fix:** Fixes crashes in all menus when changing HWYLA keybindings to unsupported values
* **IndustrialCraft 2**
* **Duplication Fixes:** Fixes various duplication exploits
* **Industrial Foregoing**
Expand Down
1 change: 1 addition & 0 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ dependencies {
compileOnly 'curse.maven:extrautilities-225561:2678374'
compileOnly 'curse.maven:forgemultipartcbe-258426:2755790' // aka "CB Multipart"
compileOnly 'curse.maven:guideapi-228832:2645992'
compileOnly 'curse.maven:hwyla-253449:2568751'
compileOnly 'curse.maven:industrialcraft-242638:3078604'
compileOnly 'curse.maven:ironbackpacks-227049:2564573'
compileOnly 'curse.maven:mekanism-268560:2835175'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public List<String> getMixinConfigs()
configs.add("mixins.mods.cbmultipart.client.json");
configs.add("mixins.mods.compactmachines.json");
configs.add("mixins.mods.crafttweaker.json");
configs.add("mixins.mods.hwyla.json");
configs.add("mixins.mods.roost.json");
configs.add("mixins.mods.storagedrawers.client.json");
configs.add("mixins.mods.thaumcraft.entities.client.json");
Expand Down Expand Up @@ -98,6 +99,8 @@ public boolean shouldMixinConfigQueue(String mixinConfig)
return Loader.isModLoaded("compactmachines3") && UTConfigMods.COMPACT_MACHINES.utCMRenderFixToggle;
case "mixins.mods.crafttweaker.json":
return Loader.isModLoaded("crafttweaker");
case "mixins.mods.hwyla.json":
return Loader.isModLoaded("waila");
case "mixins.mods.roost.json":
return Loader.isModLoaded("roost") && Loader.isModLoaded("contenttweaker");
case "mixins.mods.storagedrawers.client.json":
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package mod.acgaming.universaltweaks.mods.hwyla.mixin;

import net.minecraft.client.settings.GameSettings;

import mcp.mobius.waila.client.KeyEvent;
import mcp.mobius.waila.overlay.WailaTickHandler;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;

@Mixin(value = WailaTickHandler.class, remap = false)
public class UTHwylaKeybindingMixin
{
@Redirect(method = "tickClient", at = @At(value = "INVOKE", target = "Lorg/lwjgl/input/Keyboard;isKeyDown(I)Z"))
private static boolean utHwylaKeybinding(int key)
{
return GameSettings.isKeyDown(KeyEvent.key_show);
}
}
7 changes: 7 additions & 0 deletions src/main/resources/mixins.mods.hwyla.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"package": "mod.acgaming.universaltweaks.mods.hwyla.mixin",
"refmap": "universaltweaks.refmap.json",
"minVersion": "0.8",
"compatibilityLevel": "JAVA_8",
"client": ["UTHwylaKeybindingMixin"]
}

0 comments on commit f9f1e49

Please sign in to comment.