diff options
author | Torui <44932079+ToruiDev@users.noreply.github.com> | 2022-10-01 18:28:35 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-01 18:28:35 +0200 |
commit | 42ff9abd7a9ccb993a116fceb3e00b4eb0e5b878 (patch) | |
tree | 9f33d5a34f61200d232ecd428a5c8aff8737bade /src/main/java/de/torui/coflsky/CoflSkyCommand.java | |
parent | 155d92d0093bd3f5ebc052912257cbdcef19937d (diff) | |
parent | cc9fefb3d39f08ae8354477702662fd523dcf0ce (diff) | |
download | COFL-42ff9abd7a9ccb993a116fceb3e00b4eb0e5b878.tar.gz COFL-42ff9abd7a9ccb993a116fceb3e00b4eb0e5b878.tar.bz2 COFL-42ff9abd7a9ccb993a116fceb3e00b4eb0e5b878.zip |
Merge pull request #71 from Coflnet/fix/trade-view
Update descriptions on change and fix hot key starts
Diffstat (limited to 'src/main/java/de/torui/coflsky/CoflSkyCommand.java')
-rw-r--r-- | src/main/java/de/torui/coflsky/CoflSkyCommand.java | 30 |
1 files changed, 21 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..de82f12 100644 --- a/src/main/java/de/torui/coflsky/CoflSkyCommand.java +++ b/src/main/java/de/torui/coflsky/CoflSkyCommand.java @@ -95,8 +95,18 @@ 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": + if(Config.BaseUrl.contains("localhost")) { + CoflSky.Wrapper.startConnection(); + Config.BaseUrl = "https://sky.coflnet.com"; + } else { + CoflSky.Wrapper.initializeNewSocket("ws://localhost:8009/modsocket"); + Config.BaseUrl = "http://localhost:5005"; + } + sender.addChatMessage(new ChatComponentText("toggled dev mode, now using " + Config.BaseUrl)); break; case "status": sender.addChatMessage(new ChatComponentText(StatusMessage())); @@ -177,15 +187,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())); |