mirror of
https://github.com/GeyserMC/Geyser.git
synced 2024-08-14 23:57:35 +00:00
DataComponentType.ITEM_NAME should remove italics
This commit is contained in:
parent
a12d60d27f
commit
21ccafc40c
1 changed files with 6 additions and 4 deletions
|
@ -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()) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue