From bf5bdf3ca643c6a28def732e9085a6c9766a8830 Mon Sep 17 00:00:00 2001 From: Florian Rinke Date: Fri, 5 Nov 2021 17:07:39 +0100 Subject: Modularized Command Infrastructure --- src/main/java/de/torui/coflsky/EventRegistry.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/main/java/de/torui/coflsky/EventRegistry.java') 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); } -- cgit