diff options
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/commands')
-rw-r--r-- | src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java b/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java index 9f0a22d..ee2eb2b 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/commands/Commands.java @@ -1,6 +1,7 @@ package com.thatgravyboat.skyblockhud.commands; import com.google.common.collect.ImmutableSet; +import com.thatgravyboat.skyblockhud.DevModeConstants; import com.thatgravyboat.skyblockhud.SkyblockHud; import com.thatgravyboat.skyblockhud.api.LeaderboardGetter; import com.thatgravyboat.skyblockhud.config.SBHConfigEditor; @@ -8,8 +9,6 @@ import com.thatgravyboat.skyblockhud.core.GuiScreenElementWrapper; import com.thatgravyboat.skyblockhud.handlers.MapHandler; import com.thatgravyboat.skyblockhud.location.LocationHandler; import com.thatgravyboat.skyblockhud.playerstats.ActionBarParsing; -import java.awt.*; -import java.awt.datatransfer.StringSelection; import net.minecraft.command.ICommandSender; import net.minecraft.entity.boss.BossStatus; import net.minecraft.util.ChatComponentText; @@ -17,6 +16,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.client.ClientCommandHandler; import org.apache.commons.lang3.StringUtils; +import java.awt.*; +import java.awt.datatransfer.StringSelection; + public class Commands { private static boolean devMode = false; @@ -31,7 +33,7 @@ public class Commands { } }; - private static final SimpleSubCommand devCommand = new SimpleSubCommand("sbhdev", ImmutableSet.of("copyBossBar", "copyScoreboard", "copyActionBar")) { + private static final SimpleSubCommand devCommand = new SimpleSubCommand("sbhdev", ImmutableSet.of("copyBossBar", "copyScoreboard", "copyActionBar", "mobDeathLogging")) { @Override void processSubCommand(ICommandSender sender, String subCommand, String[] args) { StringSelection clipboard = null; @@ -47,17 +49,20 @@ public class Commands { case "copyActionBar": clipboard = new StringSelection(ActionBarParsing.lastLowActionBar); break; + case "mobDeathLogging": + DevModeConstants.mobDeathLogging = !DevModeConstants.mobDeathLogging; + sendSBHMessage(sender,"Mob Death Logging " + (DevModeConstants.mobDeathLogging?"Enabled!":"Disabled!")); } if (clipboard != null) { Toolkit.getDefaultToolkit().getSystemClipboard().setContents(clipboard, clipboard); - sender.addChatMessage(new ChatComponentText("[" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "SkyBlockHud" + EnumChatFormatting.RESET + "] : " + EnumChatFormatting.GRAY + "Info copied to clipboard!")); + sendSBHMessage(sender,"Info copied to clipboard!"); } } @Override void processNoSubCommand(ICommandSender sender) { devMode = !devMode; - sender.addChatMessage(new ChatComponentText("Dev Mode " + (devMode ? "Enabled" : "Disabled") + "!")); + sender.addChatMessage(new ChatComponentText("Dev Mode " + (devMode ? "Enabled!" : "Disabled!"))); } }; @@ -81,4 +86,9 @@ public class Commands { ClientCommandHandler.instance.registerCommand(mapCommand); ClientCommandHandler.instance.registerCommand(devCommand); } + + + private static void sendSBHMessage(ICommandSender sender, String message){ + sender.addChatMessage(new ChatComponentText("[" + EnumChatFormatting.RED + EnumChatFormatting.BOLD + "SkyBlockHud" + EnumChatFormatting.RESET + "] : " + EnumChatFormatting.GRAY + message)); + } } |