Fixed hardcoded chat colors for translations

This commit is contained in:
libraryaddict 2020-04-20 15:17:11 +12:00
parent a7014ec9e1
commit ad04185ff0
No known key found for this signature in database
GPG Key ID: 052E4FBCD257AEA4
9 changed files with 20 additions and 19 deletions

View File

@ -114,8 +114,8 @@ public class DisguiseCommand extends DisguiseBaseCommand implements TabCompleter
protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) { protected void sendCommandUsage(CommandSender sender, DisguisePermissions permissions) {
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DISG_HELP1.get()); sender.sendMessage(LibsMsg.DISG_HELP1.get());
sender.sendMessage(LibsMsg.CAN_USE_DISGS sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
if (allowedDisguises.contains("player")) { if (allowedDisguises.contains("player")) {
sender.sendMessage(LibsMsg.DISG_HELP2.get()); sender.sendMessage(LibsMsg.DISG_HELP2.get());

View File

@ -66,8 +66,8 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom
.addInteraction(sender.getName(), new DisguiseEntityInteraction(disguiseArgs), .addInteraction(sender.getName(), new DisguiseEntityInteraction(disguiseArgs),
DisguiseConfig.getDisguiseEntityExpire()); DisguiseConfig.getDisguiseEntityExpire());
sender.sendMessage(LibsMsg.DISG_ENT_CLICK sender.sendMessage(
.get(DisguiseConfig.getDisguiseEntityExpire(), testDisguise.getDisguiseName())); LibsMsg.DISG_ENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire(), testDisguise.getDisguiseName()));
return true; return true;
} }
@ -94,8 +94,8 @@ public class DisguiseEntityCommand extends DisguiseBaseCommand implements TabCom
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get()); sender.sendMessage(LibsMsg.DISG_ENT_HELP1.get());
sender.sendMessage(LibsMsg.CAN_USE_DISGS sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
if (allowedDisguises.contains("player")) { if (allowedDisguises.contains("player")) {
sender.sendMessage(LibsMsg.DISG_ENT_HELP3.get()); sender.sendMessage(LibsMsg.DISG_ENT_HELP3.get());

View File

@ -173,8 +173,8 @@ public class DisguisePlayerCommand extends DisguiseBaseCommand implements TabCom
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.D_HELP1.get()); sender.sendMessage(LibsMsg.D_HELP1.get());
sender.sendMessage(LibsMsg.CAN_USE_DISGS sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
if (allowedDisguises.contains("player")) { if (allowedDisguises.contains("player")) {
sender.sendMessage(LibsMsg.D_HELP3.get()); sender.sendMessage(LibsMsg.D_HELP3.get());

View File

@ -278,8 +278,8 @@ public class DisguiseRadiusCommand extends DisguiseBaseCommand implements TabCom
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius)); sender.sendMessage(LibsMsg.DRADIUS_HELP1.get(maxRadius));
sender.sendMessage(LibsMsg.CAN_USE_DISGS sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.CAN_USE_DISGS.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
if (allowedDisguises.contains("player")) { if (allowedDisguises.contains("player")) {
sender.sendMessage(LibsMsg.DRADIUS_HELP3.get()); sender.sendMessage(LibsMsg.DRADIUS_HELP3.get());

View File

@ -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()); sender.sendMessage(LibsMsg.DMODIFY_HELP3.get());
sender.sendMessage(LibsMsg.DMODIFY_HELP3 sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
} }
} }

View File

@ -81,6 +81,6 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements
sender.sendMessage(LibsMsg.DMODENT_HELP1.get()); sender.sendMessage(LibsMsg.DMODENT_HELP1.get());
sender.sendMessage(LibsMsg.DMODIFY_HELP3 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())));
} }
} }

View File

@ -163,7 +163,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODPLAYER_HELP1.get()); sender.sendMessage(LibsMsg.DMODPLAYER_HELP1.get());
sender.sendMessage(LibsMsg.DMODIFY_HELP3 sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
} }
} }

View File

@ -288,8 +288,8 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
ArrayList<String> allowedDisguises = getAllowedDisguises(permissions); ArrayList<String> allowedDisguises = getAllowedDisguises(permissions);
sender.sendMessage(LibsMsg.DMODRADIUS_HELP1.get(maxRadius)); sender.sendMessage(LibsMsg.DMODRADIUS_HELP1.get(maxRadius));
sender.sendMessage(LibsMsg.DMODIFY_HELP3 sender.sendMessage(
.get(ChatColor.GREEN + StringUtils.join(allowedDisguises, ChatColor.RED + ", " + ChatColor.GREEN))); LibsMsg.DMODIFY_HELP3.get(StringUtils.join(allowedDisguises, LibsMsg.CAN_USE_DISGS_SEPERATOR.get())));
sender.sendMessage(LibsMsg.DMODRADIUS_HELP2.get()); sender.sendMessage(LibsMsg.DMODRADIUS_HELP2.get());
sender.sendMessage(LibsMsg.DMODRADIUS_HELP3.get()); sender.sendMessage(LibsMsg.DMODRADIUS_HELP3.get());

View File

@ -10,7 +10,8 @@ import org.bukkit.ChatColor;
public enum LibsMsg { public enum LibsMsg {
BLOWN_DISGUISE(ChatColor.RED + "Your disguise was blown!"), BLOWN_DISGUISE(ChatColor.RED + "Your disguise was blown!"),
EXPIRED_DISGUISE(ChatColor.RED + "Your disguise has expired!"), 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(ChatColor.RED + "Cannot find the player/uuid '%s'"),
CANNOT_FIND_PLAYER_NAME(ChatColor.RED + "Cannot find the player '%s'"), CANNOT_FIND_PLAYER_NAME(ChatColor.RED + "Cannot find the player '%s'"),
CANNOT_FIND_PLAYER_UUID(ChatColor.RED + "Cannot find the uuid '%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!"), 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_HELP1(ChatColor.DARK_GREEN + "Modify your own disguise as you wear it!"),
DMODIFY_HELP2(ChatColor.DARK_GREEN + "/disguisemodify setBaby true setSprinting true"), 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_MODIFIED(ChatColor.RED + "Your disguise has been modified!"),
DMODIFY_NO_PERM(ChatColor.RED + "No permission to modify your disguise!"), 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!"), DMODIFYENT_CLICK(ChatColor.RED + "Right click a disguised entity in the next %s seconds to modify their disguise!"),