@@ -624,8 +624,8 @@ public int interestInterval(final @NotNull Account.Type type) {
624624 // messages.errors.disallowed-characters
625625 public @ NotNull Component messagesErrorsDisallowedCharacters (final @ NotNull String characters ) {
626626 return MiniMessage .miniMessage ().deserialize (
627- Objects .requireNonNull (config .getString ("messages.errors.disallowed-characters" ))
628- . replace ( "< characters> " , characters )
627+ Objects .requireNonNull (config .getString ("messages.errors.disallowed-characters" )),
628+ Placeholder . unparsed ( " characters" , characters )
629629 );
630630 }
631631
@@ -799,10 +799,12 @@ public int interestInterval(final @NotNull Account.Type type) {
799799 .replace ("<to-balance-short>" , BankAccounts .formatCurrencyShort (from .balance ))
800800 .replace ("<amount>" , amount .toPlainString ())
801801 .replace ("<amount-formatted>" , BankAccounts .formatCurrency (amount ))
802- .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (amount ))
803- .replace ("<description>" , description == null ? "<gray><i>no description</i>" : description )
804- .replace ("<confirm-command>" , "/bank transfer --confirm " + from .id + " " + to .id + " " + amount .toPlainString () + (description == null ? "" : " " + description ))
805- );
802+ .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (amount )),
803+ Placeholder .component ("description" , description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (description ))
804+ ).replaceText (configurer -> {
805+ configurer .matchLiteral ("<confirm-command>" );
806+ configurer .replacement (Component .text ("/bank transfer --confirm " + from .id + " " + to .id + " " + amount .toPlainString () + (description == null ? "" : " " + description )));
807+ });
806808 }
807809
808810 // messages.transfer-sent
@@ -826,9 +828,9 @@ public int interestInterval(final @NotNull Account.Type type) {
826828 .replace ("<amount>" , transaction .amount .toPlainString ())
827829 .replace ("<amount-formatted>" , BankAccounts .formatCurrency (transaction .amount ))
828830 .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (transaction .amount ))
829- .replace ("<description>" , transaction .description == null ? "<gray><i>no description</i>" : transaction .description )
830831 .replace ("<transaction-id>" , String .valueOf (transaction .getId ()))
831- .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument )
832+ .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument ),
833+ Placeholder .component ("description" , transaction .description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (transaction .description ))
832834 );
833835 }
834836
@@ -853,9 +855,9 @@ public int interestInterval(final @NotNull Account.Type type) {
853855 .replace ("<amount>" , transaction .amount .toPlainString ())
854856 .replace ("<amount-formatted>" , BankAccounts .formatCurrency (transaction .amount ))
855857 .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (transaction .amount ))
856- .replace ("<description>" , transaction .description == null ? "<gray><i>no description</i>" : transaction .description )
857858 .replace ("<transaction-id>" , String .valueOf (transaction .getId ()))
858- .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument )
859+ .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument ),
860+ Placeholder .component ("description" , transaction .description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (transaction .description ))
859861 );
860862 }
861863
@@ -903,12 +905,12 @@ public int interestInterval(final @NotNull Account.Type type) {
903905 .replace ("<amount>" , amount .toPlainString ())
904906 .replace ("<amount-formatted>" , BankAccounts .formatCurrency (amount ))
905907 .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (amount ))
906- .replace ("<description>" , transaction .description == null ? "<gray><i>no description</i></gray>" : transaction .description )
907908 .replace ("<transaction-id>" , String .valueOf (transaction .getId ()))
908909 .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument )
909910 .replace ("<full_date>" , sdf .format (transaction .time ) + " UTC" )
910911 .replace ("<full-date>" , sdf .format (transaction .time ) + " UTC" ),
911- Formatter .date ("date" , transaction .time .toInstant ().atZone (ZoneOffset .UTC ).toLocalDateTime ())
912+ Formatter .date ("date" , transaction .time .toInstant ().atZone (ZoneOffset .UTC ).toLocalDateTime ()),
913+ Placeholder .component ("description" , transaction .description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (transaction .description ))
912914 );
913915 }
914916
@@ -954,12 +956,12 @@ public int interestInterval(final @NotNull Account.Type type) {
954956 .replace ("<price>" , pos .price .toPlainString ())
955957 .replace ("<price-formatted>" , BankAccounts .formatCurrency (pos .price ))
956958 .replace ("<price-short>" , BankAccounts .formatCurrencyShort (pos .price ))
957- .replace ("<description>" , pos .description == null ? "<gray><i>no description</i></gray>" : pos .description )
958959 .replace ("<x>" , String .valueOf (pos .x ))
959960 .replace ("<y>" , String .valueOf (pos .y ))
960961 .replace ("<z>" , String .valueOf (pos .z ))
961962 .replace ("<pos>" , "X: " + pos .x + " Y: " + pos .y + " Z: " + pos .z + " in " + pos .world .getName ())
962- .replace ("<world>" , pos .world .getName ())
963+ .replace ("<world>" , pos .world .getName ()),
964+ Placeholder .component ("description" , pos .description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (pos .description ))
963965 );
964966 }
965967
@@ -989,11 +991,11 @@ public int interestInterval(final @NotNull Account.Type type) {
989991 .replace ("<amount>" , transaction .amount .toPlainString ())
990992 .replace ("<amount-formatted>" , BankAccounts .formatCurrency (transaction .amount ))
991993 .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (transaction .amount ))
992- .replace ("<description>" , transaction .description == null ? "<gray><i>no description</i>" : transaction .description )
993994 .replace ("<transaction-id>" , String .valueOf (transaction .getId ()))
994995 .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument )
995996 .replace ("<items>" , String .valueOf (items .length ))
996- .replace ("<items-formatted>" , items .length == 1 ? "1 item" : items .length + " items" )
997+ .replace ("<items-formatted>" , items .length == 1 ? "1 item" : items .length + " items" ),
998+ Placeholder .component ("description" , transaction .description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (transaction .description ))
997999 );
9981000 }
9991001
@@ -1018,11 +1020,11 @@ public int interestInterval(final @NotNull Account.Type type) {
10181020 .replace ("<amount>" , transaction .amount .toPlainString ())
10191021 .replace ("<amount-formatted>" , BankAccounts .formatCurrency (transaction .amount ))
10201022 .replace ("<amount-short>" , BankAccounts .formatCurrencyShort (transaction .amount ))
1021- .replace ("<description>" , transaction .description == null ? "<gray><i>no description</i>" : transaction .description )
10221023 .replace ("<transaction-id>" , String .valueOf (transaction .getId ()))
10231024 .replace ("<instrument>" , transaction .instrument == null ? "direct transfer" : transaction .instrument )
10241025 .replace ("<items>" , String .valueOf (items .length ))
1025- .replace ("<items-formatted>" , items .length == 1 ? "1 item" : items .length + " items" )
1026+ .replace ("<items-formatted>" , items .length == 1 ? "1 item" : items .length + " items" ),
1027+ Placeholder .component ("description" , transaction .description == null ? MiniMessage .miniMessage ().deserialize ("<gray><i>no description</i>" ) : Component .text (transaction .description ))
10261028 );
10271029 }
10281030
@@ -1046,9 +1048,13 @@ public int interestInterval(final @NotNull Account.Type type) {
10461048 Objects .requireNonNull (config .getString ("messages.baltop.header" ))
10471049 .replace ("<category>" , category )
10481050 .replace ("<page>" , String .valueOf (page ))
1049- .replace ("<cmd-prev>" , cmdPrev )
1050- .replace ("<cmd-next>" , cmdNext )
1051- );
1051+ ).replaceText (configurer -> {
1052+ configurer .matchLiteral ("<cmd-prev>" );
1053+ configurer .replacement (cmdPrev );
1054+ }).replaceText (configurer -> {
1055+ configurer .matchLiteral ("<cmd-next>" );
1056+ configurer .replacement (cmdNext );
1057+ });
10521058 }
10531059
10541060 // messages.baltop.entry
0 commit comments