Fixes/improves some formatting

This commit is contained in:
Kristian Knarvik 2022-07-15 12:08:08 +02:00
parent 8b53182006
commit 26e4202541
2 changed files with 6 additions and 5 deletions

View File

@ -49,10 +49,10 @@ public class ListCommand extends TokenizedCommand {
Set<String> signNames = PaidSigns.getInstance().getSignManager().getAllPaidSigns().keySet(); Set<String> signNames = PaidSigns.getInstance().getSignManager().getAllPaidSigns().keySet();
List<String> signNameList = new ArrayList<>(signNames); List<String> signNameList = new ArrayList<>(signNames);
Collections.sort(signNameList); Collections.sort(signNameList);
String infoFormat = Translator.getTranslatedMessage(TranslatableMessage.PAID_SIGNS_INFO_FORMAT);
for (String signName : signNameList) { for (String signName : signNameList) {
signs.append(StringFormatter.replacePlaceholder(Translator.getTranslatedMessage( signs.append(StringFormatter.replacePlaceholder(infoFormat, "{name}", signName));
TranslatableMessage.PAID_SIGNS_INFO_FORMAT), "{name}", signName));
} }
sender.sendMessage(StringFormatter.replacePlaceholder(Translator.getTranslatedMessage( sender.sendMessage(StringFormatter.replacePlaceholder(Translator.getTranslatedMessage(
TranslatableMessage.PAID_SIGNS_INFO), "{signs}", signs.toString())); TranslatableMessage.PAID_SIGNS_INFO), "{signs}", signs.toString()));

View File

@ -10,10 +10,11 @@ en:
SUCCESS_PAID_FOR_SIGN: "&bYou paid &3{cost} {unit} &bto create the sign" SUCCESS_PAID_FOR_SIGN: "&bYou paid &3{cost} {unit} &bto create the sign"
SUCCESS_REFUNDED: "&bYou were refunded &3{cost} {unit} &bfor your broken sign" SUCCESS_REFUNDED: "&bYou were refunded &3{cost} {unit} &bfor your broken sign"
PAID_SIGNS_INFO: | PAID_SIGNS_INFO: |
&f---&3Paid signs&f---{signs} &f---&3Paid signs&f---
{signs}
&f----------- &f-----------
PAID_SIGNS_INFO_FORMAT: | PAID_SIGNS_INFO_FORMAT: |
&f| &3{name} &f| &b{name}
PAID_SIGN_INFO: | PAID_SIGN_INFO: |
&f---&3Paid sign&f--- &f---&3Paid sign&f---
&f| &bName: &3{name} &f| &bName: &3{name}