diff options
author | Florian Rinke <develop@torui.de> | 2021-11-05 17:07:39 +0100 |
---|---|---|
committer | Florian Rinke <develop@torui.de> | 2021-11-05 20:05:05 +0100 |
commit | bf5bdf3ca643c6a28def732e9085a6c9766a8830 (patch) | |
tree | c5a7e828279c497924b3fe1fa39a8ef54dc5a94d /src/main/java/de/torui/coflsky/EventRegistry.java | |
parent | 161c01a2be916670c5bb4730760966f78e35afd0 (diff) | |
download | COFL-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.java | 10 |
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); } |