aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-12 18:22:03 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-06-12 18:22:03 +0700
commit30ffb79a12903b15cda80f14520631d8ba4f0de7 (patch)
treefa0a4372c804fc88efa692807a5c806b72a00e20 /src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java
parent004191f93e015c0f83dc5da65ea847641033cbdb (diff)
downloadOneConfig-30ffb79a12903b15cda80f14520631d8ba4f0de7.tar.gz
OneConfig-30ffb79a12903b15cda80f14520631d8ba4f0de7.tar.bz2
OneConfig-30ffb79a12903b15cda80f14520631d8ba4f0de7.zip
migrate keybinds to oneconfig events
Diffstat (limited to 'src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java
index 8a28bed..6308fdb 100644
--- a/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java
+++ b/src/main/java/cc/polyfrost/oneconfig/internal/mixin/MinecraftMixin.java
@@ -74,4 +74,14 @@ public class MinecraftMixin {
private void onDeltaTickTimerUpdate(CallbackInfo ci) {
EventManager.INSTANCE.post(new TimerUpdateEvent(timer, true));
}
+
+ @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;fireKeyInput()V"))
+ private void onKeyEvent(CallbackInfo ci) {
+ EventManager.INSTANCE.post(new KeyInputEvent());
+ }
+
+ @Inject(method = "runTick", at = @At(value = "INVOKE", target = "Lnet/minecraftforge/fml/common/FMLCommonHandler;fireMouseInput()V"))
+ private void onMouseEvent(CallbackInfo ci) {
+ EventManager.INSTANCE.post(new MouseInputEvent());
+ }
}