From 27b1fabd72eec88b456321eb8d61de86c44fa356 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beatrice=20Dellac=C3=A0?= Date: Mon, 24 Oct 2022 23:02:18 +0200 Subject: [PATCH] Allow coloring pronoun formats --- .../nounspicker/commands/subcommands/NounsCreateSubCommand.java | 2 +- .../nounspicker/commands/subcommands/NounsUpdateSubCmd.java | 2 +- 2 files changed, 2 insertions(+), 2 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 91fddde..d60a70f 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsCreateSubCommand.java @@ -34,7 +34,7 @@ public class NounsCreateSubCommand return true; } - String format = args[2]; + String format = ChatColor.translateAlternateColorCodes('&', args[2]); if(Cache.dbManager.addNewPronoun(pronoun, format)) { 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 b1f2a90..ca43f01 100644 --- a/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java +++ b/src/main/java/wtf/beatrice/nounspicker/commands/subcommands/NounsUpdateSubCmd.java @@ -34,7 +34,7 @@ public class NounsUpdateSubCmd int pronounId = Cache.dbManager.getPronounId(pronoun); String oldFormat = Cache.dbManager.getPronounFormat(pronounId); - String newFormat = args[2]; + String newFormat = ChatColor.translateAlternateColorCodes('&', args[2]); if(Cache.dbManager.updatePronounFormat(pronounId, newFormat)) { sender.sendMessage("Format of pronoun " + pronoun + " updated from " + oldFormat + " to " + newFormat + "!");