3
0
Mirror von https://github.com/GeyserMC/Geyser.git synchronisiert 2024-11-19 14:30:17 +01:00

DataComponentType.ITEM_NAME should remove italics

Dieser Commit ist enthalten in:
Camotoy 2024-06-21 13:53:38 -04:00
Ursprung a12d60d27f
Commit 21ccafc40c
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 7EEFB66FE798081F

Datei anzeigen

@ -418,13 +418,15 @@ public final class ItemTranslator {
if (components != null) { if (components != null) {
// ItemStack#getHoverName as of 1.20.5 // ItemStack#getHoverName as of 1.20.5
Component customName = components.get(DataComponentType.CUSTOM_NAME); Component customName = components.get(DataComponentType.CUSTOM_NAME);
if (customName == null) {
customName = components.get(DataComponentType.ITEM_NAME);
}
if (customName != null) { if (customName != null) {
// Get the translated name and prefix it with a reset char
return MessageTranslator.convertMessage(customName, session.locale()); return MessageTranslator.convertMessage(customName, session.locale());
} }
customName = components.get(DataComponentType.ITEM_NAME);
if (customName != null) {
// Get the translated name and prefix it with a reset char to prevent italics - matches Java Edition
// behavior as of 1.21
return ChatColor.RESET + ChatColor.ESCAPE + translationColor + MessageTranslator.convertMessage(customName, session.locale());
}
} }
if (mapping.hasTranslation()) { if (mapping.hasTranslation()) {