Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.

Commit 38a5918

Browse files
committed
Dispatch from ForgeHooksClient to InputEvents
1 parent a3f4cb5 commit 38a5918

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

patchwork-god-classes/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ version = getSubprojectVersion(project, "0.1.0")
33

44
dependencies {
55
compile project(path: ':patchwork-fml', configuration: 'dev')
6+
compile project(path: ':patchwork-events-input', configuration: 'dev')
67
}

patchwork-god-classes/src/main/java/net/minecraftforge/client/ForgeHooksClient.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,28 @@
1919

2020
package net.minecraftforge.client;
2121

22+
import net.minecraft.client.Mouse;
23+
24+
import net.patchworkmc.impl.event.input.InputEvents;
25+
2226
/*
2327
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
2428
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
2529
*/
2630
public class ForgeHooksClient {
31+
public static void fireMouseInput(int button, int action, int mods) {
32+
InputEvents.fireMouseInput(button, action, mods);
33+
}
34+
35+
public static void fireKeyInput(int key, int scanCode, int action, int modifiers) {
36+
InputEvents.fireKeyInput(key, scanCode, action, modifiers);
37+
}
38+
39+
public static boolean onMouseScroll(Mouse mouseHelper, double scrollDelta) {
40+
return InputEvents.onMouseScroll(mouseHelper, scrollDelta);
41+
}
42+
43+
public static boolean onRawMouseClicked(int button, int action, int mods) {
44+
return InputEvents.onRawMouseClicked(button, action, mods);
45+
}
2746
}

0 commit comments

Comments
 (0)