aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/de/torui/coflsky/WSCommandHandler.java
diff options
context:
space:
mode:
authorFlorian Rinke <develop@torui.de>2021-10-25 19:40:19 +0200
committerFlorian Rinke <develop@torui.de>2021-10-25 19:40:19 +0200
commit14aad34088a7971b46f0174d3245b480a22daaf9 (patch)
tree3d2e7780b773537d4b7402c6d64a779fcbb17fdd /src/main/java/de/torui/coflsky/WSCommandHandler.java
parentaf2497f08733eb7fc0fa34d5dc29ae80abc6a2e1 (diff)
parent01aa6f4d5d31d0f30fc6c174aa41b6bee2dd4a9a (diff)
downloadCOFL-14aad34088a7971b46f0174d3245b480a22daaf9.tar.gz
COFL-14aad34088a7971b46f0174d3245b480a22daaf9.tar.bz2
COFL-14aad34088a7971b46f0174d3245b480a22daaf9.zip
Merge branch 'main' of https://github.com/Coflnet/SkyblockMod into main
Diffstat (limited to 'src/main/java/de/torui/coflsky/WSCommandHandler.java')
-rw-r--r--src/main/java/de/torui/coflsky/WSCommandHandler.java17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main/java/de/torui/coflsky/WSCommandHandler.java b/src/main/java/de/torui/coflsky/WSCommandHandler.java
index abffdf2..7e857db 100644
--- a/src/main/java/de/torui/coflsky/WSCommandHandler.java
+++ b/src/main/java/de/torui/coflsky/WSCommandHandler.java
@@ -69,17 +69,22 @@ public class WSCommandHandler {
private static void Execute(Command cmd, Entity sender) {
System.out.println("Execute: " + cmd.getData() + " sender:" + sender);
String dummy = WSClient.gson.fromJson(cmd.getData(), String.class);
-
- if(dummy.startsWith("/cofl")) {
- ClientCommandHandler.instance.executeCommand(sender, dummy);
+ Execute(dummy,sender);
+ }
+
+ public static void Execute(String cmd, Entity sender)
+ {
+ if(cmd.startsWith("/cofl") || cmd.startsWith("http")) {
+ ClientCommandHandler.instance.executeCommand(sender, cmd);
} else {
- Minecraft.getMinecraft().thePlayer.sendChatMessage(dummy);
+ Minecraft.getMinecraft().thePlayer.sendChatMessage(cmd);
}
-
}
private static IChatComponent CommandToChatComponent(WriteToChatCommand wcmd) {
+ if(wcmd.OnClick != null)
+ lastOnClickEvent = "/cofl callback " + wcmd.OnClick;
if (wcmd.Text != null) {
IChatComponent comp = new ChatComponentText(wcmd.Text);
@@ -126,8 +131,6 @@ public class WSCommandHandler {
IChatComponent comp = CommandToChatComponent(wcmd);
if (comp != null)
{
- if(wcmd.OnClick != null)
- lastOnClickEvent = "/cofl callback " + wcmd.OnClick;
Minecraft.getMinecraft().thePlayer.addChatMessage(comp);
}