fix: messages not read with MiniMessage

This commit is contained in:
ineanto 2024-08-29 16:02:36 +02:00
parent 0ef5766004
commit c99c31ba37
Signed by: ineanto
GPG key ID: E511F9CAA2F9CE84
3 changed files with 15 additions and 15 deletions

View file

@ -30,16 +30,16 @@ public class ResetItem {
final Optional<NickoProfile> optionalProfile = NickoProfile.get(player); final Optional<NickoProfile> optionalProfile = NickoProfile.get(player);
optionalProfile.ifPresent(profile -> { optionalProfile.ifPresent(profile -> {
if (!profile.hasData()) { if (!profile.hasData()) {
player.sendMessage(playerLanguage.translate(LanguageKey.Event.Appearance.Remove.MISSING, true)); player.sendMessage(playerLanguage.translateWithOops(LanguageKey.Event.Appearance.Remove.MISSING));
event.getEvent().getView().close(); event.getEvent().getView().close();
return; return;
} }
final AppearanceManager appearanceManager = new AppearanceManager(player); final AppearanceManager appearanceManager = new AppearanceManager(player);
if (!appearanceManager.reset().isError()) { if (!appearanceManager.reset().isError()) {
player.sendMessage(playerLanguage.translate(LanguageKey.Event.Appearance.Remove.OK, true)); player.sendMessage(playerLanguage.translateWithWhoosh(LanguageKey.Event.Appearance.Remove.OK));
} else { } else {
player.sendMessage(playerLanguage.translate(LanguageKey.Event.Appearance.Remove.ERROR, true)); player.sendMessage(playerLanguage.translateWithOops(LanguageKey.Event.Appearance.Remove.ERROR));
} }
}); });
return true; return true;

View file

@ -114,7 +114,7 @@ public class PlayerLanguage {
} }
public String translate(String key, boolean prefix, Object... arguments) { public String translate(String key, boolean prefix, Object... arguments) {
final String translation = readString(key); final String translation = readStringWithMiniMessage(key);
try { try {
formatter.applyPattern(translation); formatter.applyPattern(translation);

View file

@ -8,25 +8,25 @@ whoosh: "<b><gradient:#01a97c:#8ffd54>WHOOSH!</gradient></b>"
oops: "<b><color:#ff4640>OOPS!</color></b>" oops: "<b><color:#ff4640>OOPS!</color></b>"
error: error:
permission: "<gray>You're missing the permission to do that.<gray>" permission: "<gray>You're missing the permission to do that.</gray>"
invalid_username: "<gray>This is an invalid Minecraft username.<gray>" invalid_username: "<gray>This is an invalid Minecraft username.</gray>"
mojang_name: "<gray>There's is not Minecraft account with this username.<gray>" mojang_name: "<gray>There's is not Minecraft account with this username.</gray>"
mojang_skin: "<gray>This Minecraft account has no skin.<gray>" mojang_skin: "<gray>This Minecraft account has no skin.</gray>"
cache: "<gray>Unable to get data from the cache.<gray>" cache: "<gray>Unable to get data from the cache.</gray>"
event: event:
settings: settings:
error: "<gray>Wasn't able to update your settings! ({0})</gray>" error: "<gray>Wasn''t able to update your settings! ({0})</gray>"
appearance: appearance:
set: set:
error: "<gray>Wasn't able to apply your disguise! ({0})</gray>" error: "<gray>Wasn''t able to apply your disguise! ({0})</gray>"
ok: "<gray>You're now disguised.</gray>" ok: "<gray>You're now disguised.</gray>"
restore: restore:
error: "<gray>Wasn't able to apply the previous disguise! ({0})</gray>" error: "<gray>Wasn''t able to apply the previous disguise! ({0})</gray>"
ok: "<gray>Disguise restored from last time.<gray>" ok: "<gray>Disguise restored from last time.</gray>"
remove: remove:
error: "<gray>Wasn't able to remove your disguise!.</gray>" error: "<gray>Wasn''t able to remove your disguise!.</gray>"
missing: "<gray>You're not currently disguised.</gray>" missing: "<gray>You''re not currently disguised.</gray>"
ok: "<gray>Undisguised successfully.</gray>" ok: "<gray>Undisguised successfully.</gray>"
admin: admin:
cache: cache: