Fix ItemStackBuilder#displayName method

This commit is contained in:
Marc Baloup 2022-08-25 01:06:36 +02:00
parent 5ab7b0e252
commit 83e35f21bd

View File

@ -98,9 +98,10 @@ public class ItemStackBuilder {
public ItemStackBuilder displayName(ComponentLike displayName) {
if (displayName != null) {
if (displayName.asComponent().style().decoration(TextDecoration.ITALIC) == State.NOT_SET)
((FormatableChat)displayName).italic(false);
return rawDisplayName(displayName.asComponent());
Component cmp = displayName.asComponent();
if (cmp.style().decoration(TextDecoration.ITALIC) == State.NOT_SET)
cmp.style().decoration(TextDecoration.ITALIC, State.FALSE);
return rawDisplayName(cmp);
}
else
return rawDisplayName(null);