aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/torui/coflsky
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/de/torui/coflsky')
-rw-r--r--src/main/java/de/torui/coflsky/WSCommandHandler.java4
-rw-r--r--src/main/java/de/torui/coflsky/handlers/EventRegistry.java12
2 files changed, 8 insertions, 8 deletions
diff --git a/src/main/java/de/torui/coflsky/WSCommandHandler.java b/src/main/java/de/torui/coflsky/WSCommandHandler.java
index ca583a2..ef15381 100644
--- a/src/main/java/de/torui/coflsky/WSCommandHandler.java
+++ b/src/main/java/de/torui/coflsky/WSCommandHandler.java
@@ -68,8 +68,8 @@ public class WSCommandHandler {
ChatMessage(showCmd);
flipHandler.fds.Insert(new de.torui.coflsky.FlipHandler.Flip(cmd.getData().Id, cmd.getData().Worth));
- //just to be safe emit a event
- CoflSky.Events.onEvent(null);
+ // trigger the keyevent to execute the event handler
+ CoflSky.Events.onKeyEvent(null);
}
private static void PlaySound(Command<SoundData> cmd, Entity sender) {
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)