From 5e94dace5426c9187ff5d6a0ece4d88bf2f33cda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 24 Oct 2022 22:59:57 +0200 Subject: [PATCH] Make messages fancier --- .../commands/subcommands/NounsCreateSubCommand.java | 3 ++- .../commands/subcommands/NounsDeleteSubCommand.java | 3 ++- .../commands/subcommands/NounsListSubCommand.java | 3 ++- .../commands/subcommands/NounsSetSubCommand.java | 12 +++++++----- .../commands/subcommands/NounsUpdateSubCmd.java | 3 ++- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java index 8ca4100..91fddde 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java @@ -1,5 +1,6 @@ package wtf.beatrice.nounspicker.commands.subcommands; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import wtf.beatrice.nounspicker.objects.Permission; @@ -21,7 +22,7 @@ public class NounsCreateSubCommand if(args.length < 3) { - sender.sendMessage("usage: /nouns create "); + sender.sendMessage(ChatColor.RED + "Usage: /nouns create "); return true; } diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java index c03f9b8..5e28b88 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsDeleteSubCommand.java @@ -1,5 +1,6 @@ package wtf.beatrice.nounspicker.commands.subcommands; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import wtf.beatrice.nounspicker.objects.Permission; @@ -19,7 +20,7 @@ public class NounsDeleteSubCommand } if(args.length < 2) { - sender.sendMessage("usage: /nouns delete "); + sender.sendMessage(ChatColor.RED + "Usage: /nouns delete "); return true; } diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java index 731b84d..e8cfae8 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsListSubCommand.java @@ -1,5 +1,6 @@ package wtf.beatrice.nounspicker.commands.subcommands; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import wtf.beatrice.nounspicker.objects.Permission; @@ -20,7 +21,7 @@ public class NounsListSubCommand return true; } - sender.sendMessage("Pronouns List:"); + sender.sendMessage(ChatColor.YELLOW + "Pronouns List:"); for(int i = 0; i < Cache.pronouns.size(); i++) { String pronoun = Cache.pronouns.get(i); int pronounId = Cache.dbManager.getPronounId(pronoun); diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java index 1b7b1ef..2dd58f2 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsSetSubCommand.java @@ -1,5 +1,6 @@ package wtf.beatrice.nounspicker.commands.subcommands; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import wtf.beatrice.nounspicker.objects.Permission; @@ -20,7 +21,7 @@ public class NounsSetSubCommand if(args.length < 3) { - sender.sendMessage("usage: /nouns set
"); + sender.sendMessage(ChatColor.RED + "Usage: /nouns set
"); return true; } @@ -29,13 +30,13 @@ public class NounsSetSubCommand if(!Cache.dbManager.isPronounValid(mainPronoun)) { - sender.sendMessage("Invalid main pronoun!"); + sender.sendMessage(ChatColor.RED + "Main pronoun '" + mainPronoun + "' not recognized!"); return true; } if(!Cache.dbManager.isPronounValid(secondaryPronoun)) { - sender.sendMessage("Invalid secondary pronoun!"); + sender.sendMessage(ChatColor.RED + "Secondary pronoun '" + secondaryPronoun + "' not recognized!"); return true; } @@ -45,10 +46,11 @@ public class NounsSetSubCommand mainPronoun = Cache.dbManager.getPronounFormat(Cache.dbManager.getPronounId(mainPronoun)); secondaryPronoun = Cache.dbManager.getPronounFormat(Cache.dbManager.getPronounId(secondaryPronoun)); - sender.sendMessage("Your pronouns have correctly been set to " + mainPronoun + "/" + secondaryPronoun + "!"); + sender.sendMessage(ChatColor.YELLOW + "Your pronouns have correctly been set to " + + mainPronoun + ChatColor.YELLOW + "/" + secondaryPronoun + ChatColor.YELLOW + "!"); return true; } else { - sender.sendMessage("Error updating pronouns! Please contact an administrator."); + sender.sendMessage(ChatColor.RED + "Error updating pronouns! Please contact an administrator."); return true; } } diff --git a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java index d0a8c48..b1f2a90 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java @@ -1,5 +1,6 @@ package wtf.beatrice.nounspicker.commands.subcommands; +import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; import org.jetbrains.annotations.NotNull; import wtf.beatrice.nounspicker.objects.Permission; @@ -21,7 +22,7 @@ public class NounsUpdateSubCmd if (args.length < 3) { - sender.sendMessage("usage: /nouns update "); + sender.sendMessage(ChatColor.RED + "Usage: /nouns update "); return true; }