From badb45d1030b863e8df322ba55ef4d410c2973a0 Mon Sep 17 00:00:00 2001 From: Bella Date: Mon, 9 Mar 2020 21:06:15 -0400 Subject: [PATCH] better naming and more feedback for xray --- .../kami/command/commands/XRayCommand.java | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/main/java/me/zeroeightsix/kami/command/commands/XRayCommand.java b/src/main/java/me/zeroeightsix/kami/command/commands/XRayCommand.java index 99894b44..08e18e31 100644 --- a/src/main/java/me/zeroeightsix/kami/command/commands/XRayCommand.java +++ b/src/main/java/me/zeroeightsix/kami/command/commands/XRayCommand.java @@ -21,20 +21,20 @@ public class XRayCommand extends Command { public void call(String[] args) { XRay xr = (XRay) ModuleManager.getModuleByName("XRay"); if (xr == null) { - Command.sendErrorMessage("&cThe XRay module is not available for some reason. Make sure the name you're calling is correct and that you have the module installed!!"); + Command.sendErrorMessage("&cThe module is not available for some reason. Make sure the name you're calling is correct and that you have the module installed!!"); return; } if (!xr.isEnabled()) { - Command.sendWarningMessage("&6Warning: The XRay module is not enabled!"); + Command.sendWarningMessage("&6Warning: The " + xr.getName() + " module is not enabled!"); Command.sendWarningMessage("These commands will still have effect, but will not visibly do anything."); } for (String s : args) { if (s == null) continue; if (s.equalsIgnoreCase("help")) { - Command.sendChatMessage("The XRay module has a list of blocks"); - Command.sendChatMessage("Normally, the XRay module hides these blocks"); - Command.sendChatMessage("When the Invert setting is on, the XRay only shows these blocks"); + Command.sendChatMessage("The " + xr.getName() + " module has a list of blocks"); + Command.sendChatMessage("Normally, the " + xr.getName() + " module hides these blocks"); + Command.sendChatMessage("When the Invert setting is on, the " + xr.getName() + " only shows these blocks"); Command.sendChatMessage("This command is a convenient way to quickly edit the list"); Command.sendChatMessage("Available options: \n" + "+block: Adds a block to the list\n" + @@ -42,28 +42,28 @@ public class XRayCommand extends Command { "=block: Changes the list to only that block\n" + "list: Prints the list of selected blocks\n" + "defaults: Resets the list to the default list\n" + - "clear: Removes all blocks from the XRay block list\n" + + "clear: Removes all blocks from the " + xr.getName() + " block list\n" + "invert: Quickly toggles the invert setting"); } else if (s.equalsIgnoreCase("clear")) { xr.extClear(); - Command.sendWarningMessage("Cleared the XRay block list"); + Command.sendWarningMessage("Cleared the " + xr.getName() + " block list"); } else if (s.equalsIgnoreCase("defaults")) { xr.extDefaults(); - Command.sendChatMessage("Reset the XRay block list to default"); + Command.sendChatMessage("Reset the " + xr.getName() + " block list to default"); } else if (s.equalsIgnoreCase("list")) { Command.sendChatMessage("\n" + xr.extGet()); } else if (s.equalsIgnoreCase("invert")) { if (xr.invert.getValue()) { xr.invert.setValue(false); - Command.sendChatMessage("Disabled XRay Invert"); + Command.sendChatMessage("Disabled " + xr.getName() + " Invert"); } else { xr.invert.setValue(true); - Command.sendChatMessage("Enabled XRay Invert"); + Command.sendChatMessage("Enabled " + xr.getName() + " Invert"); } } else if (s.startsWith("=")) { String sT = s.replace("=" ,""); xr.extSet(sT); - Command.sendChatMessage("Set the XRay block list to " + sT); + Command.sendChatMessage("Set the " + xr.getName() + " block list to " + sT); } else if (s.startsWith("+") || s.startsWith("-")) { String name = s.substring(1); Block b = Block.getBlockFromName(name); @@ -71,8 +71,10 @@ public class XRayCommand extends Command { Command.sendChatMessage("&cInvalid block name <" + name + ">"); } else { if (s.startsWith("+")) { + Command.sendChatMessage("Added <" + name + "> to the " + xr.getName() + " block list"); xr.extAdd(name); } else { + Command.sendChatMessage("Removed <" + name + "> from the " + xr.getName() + " block list"); xr.extRemove(name); } }