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

Commit

Permalink
Dispatch from ForgeHooksClient to InputEvents
Browse files Browse the repository at this point in the history
  • Loading branch information
kitlith committed Jul 15, 2020
1 parent a3f4cb5 commit 38a5918
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions patchwork-god-classes/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ version = getSubprojectVersion(project, "0.1.0")

dependencies {
compile project(path: ':patchwork-fml', configuration: 'dev')
compile project(path: ':patchwork-events-input', configuration: 'dev')
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,28 @@

package net.minecraftforge.client;

import net.minecraft.client.Mouse;

import net.patchworkmc.impl.event.input.InputEvents;

/*
* Note: this class is intended for mod use only, to dispatch to the implementations kept in their own modules.
* Do not keep implementation details here, methods should be thin wrappers around methods in other modules.
*/
public class ForgeHooksClient {
public static void fireMouseInput(int button, int action, int mods) {
InputEvents.fireMouseInput(button, action, mods);
}

public static void fireKeyInput(int key, int scanCode, int action, int modifiers) {
InputEvents.fireKeyInput(key, scanCode, action, modifiers);
}

public static boolean onMouseScroll(Mouse mouseHelper, double scrollDelta) {
return InputEvents.onMouseScroll(mouseHelper, scrollDelta);
}

public static boolean onRawMouseClicked(int button, int action, int mods) {
return InputEvents.onRawMouseClicked(button, action, mods);
}
}

0 comments on commit 38a5918

Please sign in to comment.