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

Commit 9cdbf2a

Browse files
committed
Dispatch from ForgeHooksClient to InputEvents
1 parent 76829bd commit 9cdbf2a

File tree

3 files changed

+21
-0
lines changed

3 files changed

+21
-0
lines changed

patchwork-god-classes/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,6 @@ version = getSubprojectVersion(project, "0.1.0")
44
dependencies {
55
compile project(path: ':patchwork-fml', configuration: 'dev')
66
compile project(path: ':patchwork-capabilities', configuration: 'dev')
7+
compile project(path: ':patchwork-events-input', configuration: 'dev')
78
compile project(path: ':patchwork-events-lifecycle', configuration: 'dev')
89
}

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
}

patchwork-god-classes/src/main/resources/fabric.mod.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
"fabricloader": ">=0.8.4",
1919
"patchwork-fml": "*",
2020
"patchwork-capabilities": "*",
21+
"patchwork-events-input": "*",
2122
"patchwork-events-lifecycle": "*"
2223
},
2324
"custom": {

0 commit comments

Comments
 (0)