Skip to content

Commit

Permalink
Fix dwheel patch
Browse files Browse the repository at this point in the history
  • Loading branch information
kappa-maintainer committed Jun 15, 2024
1 parent 3f28dac commit ca49a00
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mappings_version=39-1.12
mod_id=fugue
mod_name=Fugue
mod_main_class=Fugue
mod_version=0.15.3
mod_version=0.15.4
mod_base_package=com.cleanroommc.fugue
mod_authors=kappa_maintainer
mod_description=A mod that patch dead mods for Cleanroom
3 changes: 3 additions & 0 deletions src/main/java/com/cleanroommc/fugue/config/FugueConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ Add them to list could redirect their toURI() to a decent jar URL.
@Config.Comment(
"""
Used when mouse wheel related operation being weird.
Classes in this list will get their Mouse.getDWheel() and Mouse.getEventDWheel() redirected.
Consult Cleanroom developers before using it!
""")
@Config.Name("Mouse.getEventDWheel() Patching List")
Expand All @@ -193,6 +194,8 @@ Add them to list could redirect their toURI() to a decent jar URL.
"xaero.map.gui.GuiMap",
"betterquesting.api2.client.gui.GuiContainerCanvas",
"betterquesting.api2.client.gui.GuiScreenCanvas",
"yalter.mousetweaks.MouseState",
"yalter.mousetweaks.SimpleMouseState",
};

@Config.Comment(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@ public byte[] transform(byte[] bytes) {
@Override
public void edit(MethodCall m) throws CannotCompileException {
if (m.getMethodName().equals("getEventDWheel") && m.getClassName().equals("org.lwjgl.input.Mouse")) {
m.replace("$_ = $proceed($$) * 120.0;");
m.replace("$_ = $proceed($$) * 120;");
}
if (m.getMethodName().equals("getDWheel") && m.getClassName().equals("org.lwjgl.input.Mouse")) {
m.replace("$_ = $proceed($$) * 120;");
}
}
});
Expand Down

0 comments on commit ca49a00

Please sign in to comment.