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) { public ItemStackBuilder displayName(ComponentLike displayName) {
if (displayName != null) { if (displayName != null) {
if (displayName.asComponent().style().decoration(TextDecoration.ITALIC) == State.NOT_SET) Component cmp = displayName.asComponent();
((FormatableChat)displayName).italic(false); if (cmp.style().decoration(TextDecoration.ITALIC) == State.NOT_SET)
return rawDisplayName(displayName.asComponent()); cmp.style().decoration(TextDecoration.ITALIC, State.FALSE);
return rawDisplayName(cmp);
} }
else else
return rawDisplayName(null); return rawDisplayName(null);