Skip to content
This repository has been archived by the owner on Sep 5, 2023. It is now read-only.

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Sasha committed Jan 4, 2019
1 parent 24814f4 commit 30abb9c
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/main/java/com/sasha/queueskip/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
29 changes: 29 additions & 0 deletions src/main/java/com/sasha/queueskip/command/ToggleDebugCommand.java
Original file line number Diff line number Diff line change
@@ -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;
}
}
}

0 comments on commit 30abb9c

Please sign in to comment.