diff options
author | Äkwav <ekwav@coflnet.com> | 2022-09-30 18:03:39 +0200 |
---|---|---|
committer | Äkwav <ekwav@coflnet.com> | 2022-09-30 18:03:39 +0200 |
commit | 3e2d251438e421c202bd49953467af47acfb4702 (patch) | |
tree | a6c6ed555a514dbb38b5a78eca159109e1dd5860 /src/main/java/de/torui/coflsky/CoflSkyCommand.java | |
parent | 3f8a19c086a3ab18984b58cf50707d2f71fff06f (diff) | |
download | COFL-3e2d251438e421c202bd49953467af47acfb4702.tar.gz COFL-3e2d251438e421c202bd49953467af47acfb4702.tar.bz2 COFL-3e2d251438e421c202bd49953467af47acfb4702.zip |
fixes #68 & fixes #67
Diffstat (limited to 'src/main/java/de/torui/coflsky/CoflSkyCommand.java')
-rw-r--r-- | src/main/java/de/torui/coflsky/CoflSkyCommand.java | 25 |
1 files changed, 16 insertions, 9 deletions
diff --git a/src/main/java/de/torui/coflsky/CoflSkyCommand.java b/src/main/java/de/torui/coflsky/CoflSkyCommand.java index 5b21274..2cebb8f 100644 --- a/src/main/java/de/torui/coflsky/CoflSkyCommand.java +++ b/src/main/java/de/torui/coflsky/CoflSkyCommand.java @@ -95,8 +95,13 @@ public class CoflSkyCommand extends CommandBase { // + "g º87,000 -> 13,999 ºg[BUY]\\\",\\\"onClick\\\":\\\"/viewauction f7d7295ca72f43e9876bf6da7424000c\\\",\\\"hover\\\":\\\"\\\"}\"}"), sender.getCommandSenderEntity()); //WSCommandHandler.HandleCommand(new Command(CommandType.PlaySound, "{\"name\":\"random.orb\",\"pitch\":0.5}"), sender.getCommandSenderEntity()); break; - case "callback": - CallbackCommand(args); + case "callback": + CallbackCommand(args); + break; + case "dev": + CoflSky.Wrapper.initializeNewSocket("ws://localhost:8009/modsocket"); + Config.BaseUrl = "http://localhost:5005"; + System.out.println("entered dev mode"); break; case "status": sender.addChatMessage(new ChatComponentText(StatusMessage())); @@ -177,15 +182,17 @@ public class CoflSkyCommand extends CommandBase { if(CoflSky.Wrapper.isRunning) { CoflSky.Wrapper.SendMessage(rc); } else { - sender.addChatMessage(new ChatComponentText("CoflSky wasn't active.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); - CoflSky.Wrapper.stop(); - CoflSky.Wrapper.startConnection(); - CoflSky.Wrapper.SendMessage(rc); + SendAfterStart(sender, rc); } - - } - + + private static synchronized void SendAfterStart(ICommandSender sender, RawCommand rc) { + sender.addChatMessage(new ChatComponentText("CoflSky wasn't active.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED))); + //CoflSky.Wrapper.stop(); + CoflSky.Wrapper.startConnection(); + CoflSky.Wrapper.SendMessage(rc); + } + public void ListHelp(ICommandSender sender) { sender.addChatMessage(new ChatComponentText(HelpText)); sender.addChatMessage(new ChatComponentText(QueryServerCommands.QueryCommands())); |