aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/torui/coflsky/handlers/EventRegistry.java
diff options
context:
space:
mode:
authorÄkwav <ekwav@coflnet.com>2022-06-04 14:46:42 +0200
committerÄkwav <ekwav@coflnet.com>2022-06-04 14:46:42 +0200
commitcab805393559a9a7e6433199aaf8591cc9a8ae98 (patch)
tree27d16b3971d3227f50637ed179f5381de5e45b71 /src/main/java/de/torui/coflsky/handlers/EventRegistry.java
parentcd127e92dfd9657977b180678dbe76306a3e917f (diff)
downloadCOFL-cab805393559a9a7e6433199aaf8591cc9a8ae98.tar.gz
COFL-cab805393559a9a7e6433199aaf8591cc9a8ae98.tar.bz2
COFL-cab805393559a9a7e6433199aaf8591cc9a8ae98.zip
only send nobestflip once and clearify code
Diffstat (limited to 'src/main/java/de/torui/coflsky/handlers/EventRegistry.java')
-rw-r--r--src/main/java/de/torui/coflsky/handlers/EventRegistry.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/java/de/torui/coflsky/handlers/EventRegistry.java b/src/main/java/de/torui/coflsky/handlers/EventRegistry.java
index 81411f4..aaee721 100644
--- a/src/main/java/de/torui/coflsky/handlers/EventRegistry.java
+++ b/src/main/java/de/torui/coflsky/handlers/EventRegistry.java
@@ -60,7 +60,7 @@ public class EventRegistry {
@SideOnly(Side.CLIENT)
@SubscribeEvent(priority = EventPriority.NORMAL, receiveCanceled = true)
- public void onEvent(KeyInputEvent event) {
+ public void onKeyEvent(KeyInputEvent event) {
if (CoflSky.keyBindings[0].isPressed()) {
if (WSCommandHandler.lastOnClickEvent != null) {
@@ -74,7 +74,7 @@ public class EventRegistry {
}
if(CoflSky.keyBindings[1].isKeyDown()) {
- if((System.currentTimeMillis() - LastClick) >= 400) {
+ if((System.currentTimeMillis() - LastClick) >= 300) {
Flip f = WSCommandHandler.flipHandler.fds.GetHighestFlip();
@@ -87,12 +87,12 @@ public class EventRegistry {
WSCommandHandler.Execute("/cofl track besthotkey " + f.id, Minecraft.getMinecraft().thePlayer);
CoflSky.Wrapper.SendMessage(new JsonStringCommand(CommandType.Clicked, command));
} else {
- WSCommandHandler.Execute("/cofl dialog nobestflip", Minecraft.getMinecraft().thePlayer);
- }
-
+ // only display message once (if this is the key down event)
+ if(CoflSky.keyBindings[1].isPressed())
+ WSCommandHandler.Execute("/cofl dialog nobestflip", Minecraft.getMinecraft().thePlayer);
+ }
}
}
-
}
@SideOnly(Side.CLIENT)