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);
optionalProfile.ifPresent(profile -> {
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();
return;
}
final AppearanceManager appearanceManager = new AppearanceManager(player);
if (!appearanceManager.reset().isError()) {
player.sendMessage(playerLanguage.translate(LanguageKey.Event.Appearance.Remove.OK, true));
player.sendMessage(playerLanguage.translateWithWhoosh(LanguageKey.Event.Appearance.Remove.OK));
} else {
player.sendMessage(playerLanguage.translate(LanguageKey.Event.Appearance.Remove.ERROR, true));
player.sendMessage(playerLanguage.translateWithOops(LanguageKey.Event.Appearance.Remove.ERROR));
}
});
return true;

View file

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

View file

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