From 83e35f21bdd805f0f512504f6309ef670779ac4d Mon Sep 17 00:00:00 2001 From: Marc Baloup Date: Thu, 25 Aug 2022 01:06:36 +0200 Subject: [PATCH] Fix ItemStackBuilder#displayName method --- .../java/fr/pandacube/lib/paper/util/ItemStackBuilder.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/util/ItemStackBuilder.java b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/util/ItemStackBuilder.java index b863273..8b7d748 100644 --- a/pandalib-paper/src/main/java/fr/pandacube/lib/paper/util/ItemStackBuilder.java +++ b/pandalib-paper/src/main/java/fr/pandacube/lib/paper/util/ItemStackBuilder.java @@ -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);