From 8136db80ef7767286718cd2a22c2c213c96f56db Mon Sep 17 00:00:00 2001 From: KisaragiEffective <48310258+KisaragiEffective@users.noreply.github.com> Date: Sat, 14 Nov 2020 12:50:51 +0900 Subject: [PATCH] Update MenuLoader.java It has to be done by using `ItemMeta#hasDisplayName` to check if it has display-name --- src/thirtyvirus/sbbp/MenuLoader.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/thirtyvirus/sbbp/MenuLoader.java b/src/thirtyvirus/sbbp/MenuLoader.java index 9a74709..f9a4604 100644 --- a/src/thirtyvirus/sbbp/MenuLoader.java +++ b/src/thirtyvirus/sbbp/MenuLoader.java @@ -19,8 +19,12 @@ public static Inventory createShulkerBoxInventory(Player player, ItemStack shulk if(im.getBlockState() instanceof ShulkerBox) { ShulkerBox shulker = (ShulkerBox) im.getBlockState(); - String name = shulkerBoxItemStack.getItemMeta().getDisplayName(); - if (name.equals("")) name = shulkerBoxItemStack.getType().name(); + String name; + if (shulkerBoxItemStack.getItemMeta().hasDisplayName()) { + name = shulkerBoxItemStack.getItemMeta().getDisplayName(); + } else { + name = shulkerBoxItemStack.getType().name(); + } Inventory inv = Bukkit.createInventory(null, 27, "Holding: " + name); inv.setContents(shulker.getInventory().getContents());