From a00887c9e4a74682b9269a9a0cbb268dfbe34b43 Mon Sep 17 00:00:00 2001 From: Fulminazzo Date: Mon, 23 Dec 2024 01:56:53 +0100 Subject: [PATCH] Fixed itemToItemStack method setting displayname in case of empty --- item/bukkit/src/main/java/it/fulminazzo/yagl/ItemAdapter.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/item/bukkit/src/main/java/it/fulminazzo/yagl/ItemAdapter.java b/item/bukkit/src/main/java/it/fulminazzo/yagl/ItemAdapter.java index d389bf7b..32b79156 100644 --- a/item/bukkit/src/main/java/it/fulminazzo/yagl/ItemAdapter.java +++ b/item/bukkit/src/main/java/it/fulminazzo/yagl/ItemAdapter.java @@ -83,7 +83,8 @@ public final class ItemAdapter { }, () -> itemStack.setDurability((short) item.getDurability())); if (meta != null) { - meta.setDisplayName(item.getDisplayName()); + String displayName = item.getDisplayName(); + if (!displayName.isEmpty()) meta.setDisplayName(displayName); meta.setLore(item.getLore()); item.getEnchantments().forEach(e -> { @NotNull Tuple tuple = WrappersAdapter.wEnchantToEnchant(e);