aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/torui/coflsky/EventRegistry.java
diff options
context:
space:
mode:
authorFlorian Rinke <develop@torui.de>2021-11-05 17:07:39 +0100
committerFlorian Rinke <develop@torui.de>2021-11-05 20:05:05 +0100
commitbf5bdf3ca643c6a28def732e9085a6c9766a8830 (patch)
treec5a7e828279c497924b3fe1fa39a8ef54dc5a94d /src/main/java/de/torui/coflsky/EventRegistry.java
parent161c01a2be916670c5bb4730760966f78e35afd0 (diff)
downloadCOFL-bf5bdf3ca643c6a28def732e9085a6c9766a8830.tar.gz
COFL-bf5bdf3ca643c6a28def732e9085a6c9766a8830.tar.bz2
COFL-bf5bdf3ca643c6a28def732e9085a6c9766a8830.zip
Modularized Command Infrastructure
Diffstat (limited to 'src/main/java/de/torui/coflsky/EventRegistry.java')
-rw-r--r--src/main/java/de/torui/coflsky/EventRegistry.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/de/torui/coflsky/EventRegistry.java b/src/main/java/de/torui/coflsky/EventRegistry.java
index f47d0a1..c0b4546 100644
--- a/src/main/java/de/torui/coflsky/EventRegistry.java
+++ b/src/main/java/de/torui/coflsky/EventRegistry.java
@@ -1,5 +1,8 @@
package de.torui.coflsky;
+import de.torui.coflsky.core.Command;
+import de.torui.coflsky.core.CommandType;
+import de.torui.coflsky.core.JsonStringCommand;
import java.util.UUID;
import net.minecraft.client.Minecraft;
@@ -58,14 +61,13 @@ public class EventRegistry{
public void onEvent(KeyInputEvent event) {
if(CoflSky.keyBindings[0].isPressed()) {
- //System.out.println(">>>>> Key Pressed");
-
+
if(WSCommandHandler.lastOnClickEvent != null) {
String command = WSCommandHandler.lastOnClickEvent;
WSCommandHandler.lastOnClickEvent = null;
- //System.out.println(">>>>> HasLastONClickEvent = " + command);
- WSCommandHandler.Execute(command,Minecraft.getMinecraft().thePlayer);
+ WSCommandHandler.HandleCommand(new JsonStringCommand(CommandType.Execute, WSClient.gson.toJson(command)),
+ Minecraft.getMinecraft().thePlayer);
}