From 1dea0f6c6a217a71d812a06020c614f67280a4e5 Mon Sep 17 00:00:00 2001 From: EpicKnarvik97 Date: Mon, 8 Aug 2022 19:33:51 +0200 Subject: [PATCH] Adds a response message when a setting has been changed, and adds some coloring --- .../net/knarcraft/blacksmith/command/BlackSmithCommand.java | 2 +- .../net/knarcraft/blacksmith/command/NPCSettingCommand.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/net/knarcraft/blacksmith/command/BlackSmithCommand.java b/src/main/java/net/knarcraft/blacksmith/command/BlackSmithCommand.java index cc34467..0a491ee 100644 --- a/src/main/java/net/knarcraft/blacksmith/command/BlackSmithCommand.java +++ b/src/main/java/net/knarcraft/blacksmith/command/BlackSmithCommand.java @@ -12,7 +12,7 @@ public class BlackSmithCommand implements CommandExecutor { public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { if (!sender.hasPermission("blacksmith.admin")) { - sender.sendMessage(ChatColor.RED + "You don't have the necessary permission for using this command."); + sender.sendMessage(ChatColor.DARK_RED + "You don't have the necessary permission for using this command."); return true; } diff --git a/src/main/java/net/knarcraft/blacksmith/command/NPCSettingCommand.java b/src/main/java/net/knarcraft/blacksmith/command/NPCSettingCommand.java index 50a75cd..3e32fea 100644 --- a/src/main/java/net/knarcraft/blacksmith/command/NPCSettingCommand.java +++ b/src/main/java/net/knarcraft/blacksmith/command/NPCSettingCommand.java @@ -4,6 +4,7 @@ import net.citizensnpcs.api.CitizensAPI; import net.citizensnpcs.api.npc.NPC; import net.knarcraft.blacksmith.config.NPCSetting; import net.knarcraft.blacksmith.trait.BlacksmithTrait; +import org.bukkit.ChatColor; import org.bukkit.command.Command; import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandSender; @@ -15,7 +16,7 @@ public class NPCSettingCommand implements CommandExecutor { public boolean onCommand(@NotNull CommandSender sender, @NotNull Command command, @NotNull String label, @NotNull String[] args) { NPC npc = CitizensAPI.getDefaultNPCSelector().getSelected(sender); if (npc == null || !npc.hasTrait(BlacksmithTrait.class)) { - sender.sendMessage("You must select an NPC before running this command"); + sender.sendMessage(ChatColor.DARK_RED + "You must select an NPC before running this command"); return true; } BlacksmithTrait blacksmithTrait = npc.getTrait(BlacksmithTrait.class); @@ -24,10 +25,11 @@ public class NPCSettingCommand implements CommandExecutor { String commandName = npcSetting.getCommandName(); if (commandName.equalsIgnoreCase(args[0])) { if (args.length < 2) { - sender.sendMessage("Current value of " + commandName + ": " + + sender.sendMessage(ChatColor.GREEN + "Current value of " + commandName + ": " + blacksmithTrait.getSettings().getRawValue(npcSetting)); } else { blacksmithTrait.getSettings().changeSetting(npcSetting, args[1]); + sender.sendMessage(ChatColor.GREEN + npcSetting.name() + " set to " + args[1]); } return true; }