From 30abb9c236bd41d25d6ac300821ec56a625da795 Mon Sep 17 00:00:00 2001 From: Sasha Date: Thu, 3 Jan 2019 21:54:39 -0800 Subject: [PATCH] debug --- src/main/java/com/sasha/queueskip/Main.java | 1 + .../queueskip/command/ToggleDebugCommand.java | 29 +++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 src/main/java/com/sasha/queueskip/command/ToggleDebugCommand.java diff --git a/src/main/java/com/sasha/queueskip/Main.java b/src/main/java/com/sasha/queueskip/Main.java index 2f81858..10fad16 100644 --- a/src/main/java/com/sasha/queueskip/Main.java +++ b/src/main/java/com/sasha/queueskip/Main.java @@ -111,6 +111,7 @@ public void registerCommands() { COMMAND_PROCESSOR.register(ToggleSafeModeCommand.class); COMMAND_PROCESSOR.register(AboutCommand.class); COMMAND_PROCESSOR.register(ToggleInRangeNotificationsCommand.class); + COMMAND_PROCESSOR.register(ToggleDebugCommand.class); ReMinecraft.INGAME_CMD_PROCESSOR.register(com.sasha.queueskip.command.ingame.AboutCommand.class); } catch (IllegalAccessException | InstantiationException e) { e.printStackTrace(); diff --git a/src/main/java/com/sasha/queueskip/command/ToggleDebugCommand.java b/src/main/java/com/sasha/queueskip/command/ToggleDebugCommand.java new file mode 100644 index 0000000..f6322e5 --- /dev/null +++ b/src/main/java/com/sasha/queueskip/command/ToggleDebugCommand.java @@ -0,0 +1,29 @@ +package com.sasha.queueskip.command; + +import com.sasha.queueskip.DiscordUtils; +import com.sasha.queueskip.Main; +import com.sasha.simplecmdsys.SimpleCommand; +import com.sasha.simplecmdsys.SimpleCommandInfo; + +@SimpleCommandInfo(description = "Toggle \"player in range\" notifications", syntax = {""}) +public class ToggleDebugCommand extends SimpleCommand { + + public ToggleDebugCommand() { + super("inrange"); + } + + @Override + public void onCommand() { + Action action = Main.CONFIG.var_debug ? Action.DISABLING : Action.ENABLING; + switch (action) { + case ENABLING: + DiscordUtils.recievedMessage.getChannel().sendMessage(DiscordUtils.buildInfoEmbed("Debug notifications enabled", "Mm.")).queue(); + Main.CONFIG.var_debug = true; + break; + case DISABLING: + DiscordUtils.recievedMessage.getChannel().sendMessage(DiscordUtils.buildInfoEmbed("Debug notifications disabled", "Mm.")).queue(); + Main.CONFIG.var_debug = false; + break; + } + } +} \ No newline at end of file