From ad04185ff08730ae7a6f854f508243d72a6fe500 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Mon, 20 Apr 2020 15:17:11 +1200 Subject: [PATCH] Fixed hardcoded chat colors for translations --- .../disguise/commands/disguise/DisguiseCommand.java | 4 ++-- .../disguise/commands/disguise/DisguiseEntityCommand.java | 8 ++++---- .../disguise/commands/disguise/DisguisePlayerCommand.java | 4 ++-- .../disguise/commands/disguise/DisguiseRadiusCommand.java | 4 ++-- .../disguise/commands/modify/DisguiseModifyCommand.java | 4 ++-- .../commands/modify/DisguiseModifyEntityCommand.java | 2 +- .../commands/modify/DisguiseModifyPlayerCommand.java | 4 ++-- .../commands/modify/DisguiseModifyRadiusCommand.java | 4 ++-- .../disguise/utilities/translations/LibsMsg.java | 5 +++-- 9 files changed, 20 insertions(+), 19 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java index 70888bc7..784a39e1 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseCommand.java @@ -114,8 +114,8 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { ArrayList allowedDisguises = getAllowedDisguises(permissions); sender.sendMessage(LibsMsg.DISG_HELP1.get()); - sender.sendMessage(LibsMsg.CAN_USE_DISGS - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); if (allowedDisguises.contains("player")) { sender.sendMessage(LibsMsg.DISG_HELP2.get()); diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java index a1f2d5cf..cd0e8c0b 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseEntityCommand.java @@ -66,8 +66,8 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom .addInteraction(sender.getName(), new DisguiseEntityInteraction(disguiseArgs), DisguiseConfig.getDisguiseEntityExpire()); - sender.sendMessage(LibsMsg.DISG_ENT_CLICK - .get(DisguiseConfig.getDisguiseEntityExpire(), testDisguise.getDisguiseName())); + sender.sendMessage( + LibsMsg.DISG_ENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire(), testDisguise.getDisguiseName())); return true; } @@ -94,8 +94,8 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom ArrayList allowedDisguises = getAllowedDisguises(permissions); sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get()); - sender.sendMessage(LibsMsg.CAN_USE_DISGS - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); if (allowedDisguises.contains("player")) { sender.sendMessage(LibsMsg.DISG_ENT_HELP3.get()); diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java index b424339d..a2960d5d 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguisePlayerCommand.java @@ -173,8 +173,8 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom ArrayList allowedDisguises = getAllowedDisguises(permissions); sender.sendMessage(LibsMsg.D_HELP1.get()); - sender.sendMessage(LibsMsg.CAN_USE_DISGS - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); if (allowedDisguises.contains("player")) { sender.sendMessage(LibsMsg.D_HELP3.get()); diff --git a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java index 884d942d..2850557a 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/disguise/DisguiseRadiusCommand.java @@ -278,8 +278,8 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom ArrayList allowedDisguises = getAllowedDisguises(permissions); sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius)); - sender.sendMessage(LibsMsg.CAN_USE_DISGS - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); if (allowedDisguises.contains("player")) { sender.sendMessage(LibsMsg.DRADIUS_HELP3.get()); diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java index a54b0c96..a671bdce 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyCommand.java @@ -109,7 +109,7 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom sender.sendMessage(LibsMsg.DMODIFY_HELP3.get()); sender.sendMessage(LibsMsg.DMODIFY_HELP3.get()); - sender.sendMessage(LibsMsg.DMODIFY_HELP3 - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java index 6f5a04f4..09663cf3 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyEntityCommand.java @@ -81,6 +81,6 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements sender.sendMessage(LibsMsg.DMODENT_HELP1.get()); sender.sendMessage(LibsMsg.DMODIFY_HELP3 - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + .get( StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java index bf9e33af..5faf7e19 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyPlayerCommand.java @@ -163,7 +163,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements ArrayList allowedDisguises = getAllowedDisguises(permissions); sender.sendMessage(LibsMsg.DMODPLAYER_HELP1.get()); - sender.sendMessage(LibsMsg.DMODIFY_HELP3 - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); } } diff --git a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java index d16ce364..2d334b23 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/modify/DisguiseModifyRadiusCommand.java @@ -288,8 +288,8 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements ArrayList allowedDisguises = getAllowedDisguises(permissions); sender.sendMessage(LibsMsg.DMODRADIUS_HELP1.get(maxRadius)); - sender.sendMessage(LibsMsg.DMODIFY_HELP3 - .get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); + sender.sendMessage( + LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get()))); sender.sendMessage(LibsMsg.DMODRADIUS_HELP2.get()); sender.sendMessage(LibsMsg.DMODRADIUS_HELP3.get()); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java b/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java index 19f44328..41026b03 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java @@ -10,7 +10,8 @@ import org.bukkit.ChatColor; public enum LibsMsg { BLOWN_DISGUISE(ChatColor.RED + "Your disguise was blown!"), EXPIRED_DISGUISE(ChatColor.RED + "Your disguise has expired!"), - CAN_USE_DISGS(ChatColor.DARK_GREEN + "You can use the disguises: %s"), + CAN_USE_DISGS(ChatColor.DARK_GREEN + "You can use the disguises:" + ChatColor.GREEN + " %s"), + CAN_USE_DISGS_SEPERATOR(ChatColor.RED + "," + ChatColor.GREEN), CANNOT_FIND_PLAYER(ChatColor.RED + "Cannot find the player/uuid '%s'"), CANNOT_FIND_PLAYER_NAME(ChatColor.RED + "Cannot find the player '%s'"), CANNOT_FIND_PLAYER_UUID(ChatColor.RED + "Cannot find the uuid '%s'"), @@ -59,7 +60,7 @@ public enum LibsMsg { DMODENT_HELP1(ChatColor.DARK_GREEN + "Choose the options for a disguise then right click a entity to modify it!"), DMODIFY_HELP1(ChatColor.DARK_GREEN + "Modify your own disguise as you wear it!"), DMODIFY_HELP2(ChatColor.DARK_GREEN + "/disguisemodify setBaby true setSprinting true"), - DMODIFY_HELP3(ChatColor.DARK_GREEN + "You can modify the disguises: %s"), + DMODIFY_HELP3(ChatColor.DARK_GREEN + "You can modify the disguises:" + ChatColor.GREEN + " %s"), DMODIFY_MODIFIED(ChatColor.RED + "Your disguise has been modified!"), DMODIFY_NO_PERM(ChatColor.RED + "No permission to modify your disguise!"), DMODIFYENT_CLICK(ChatColor.RED + "Right click a disguised entity in the next %s seconds to modify their disguise!"),