diff --git a/src/main/java/io/wdsj/asw/listener/PlayerItemListener.java b/src/main/java/io/wdsj/asw/listener/PlayerItemListener.java index 511a4e7..51964ea 100644 --- a/src/main/java/io/wdsj/asw/listener/PlayerItemListener.java +++ b/src/main/java/io/wdsj/asw/listener/PlayerItemListener.java @@ -36,8 +36,8 @@ public void onPlayerHeldItem(PlayerItemHeldEvent event) { ItemStack item = player.getInventory().getItem(event.getNewSlot()); if (item != null && item.hasItemMeta()) { ItemMeta meta = item.getItemMeta(); - if (NORMAL_ITEM_META.contains(meta)) return; if (meta != null && meta.hasDisplayName()) { + if (NORMAL_ITEM_META.contains(meta)) return; String originalName = meta.getDisplayName(); long startTime = System.currentTimeMillis(); if (settingsManager.getProperty(PluginSettings.IGNORE_FORMAT_CODE)) originalName = originalName.replaceAll(Utils.getIgnoreFormatCodeRegex(), ""); @@ -79,8 +79,8 @@ public void onDrop(PlayerDropItemEvent event) { ItemStack item = event.getItemDrop().getItemStack(); if (item.hasItemMeta()) { ItemMeta meta = item.getItemMeta(); - if (NORMAL_ITEM_META.contains(meta)) return; if (meta != null && meta.hasDisplayName()) { + if (NORMAL_ITEM_META.contains(meta)) return; String originalName = meta.getDisplayName(); long startTime = System.currentTimeMillis(); if (settingsManager.getProperty(PluginSettings.IGNORE_FORMAT_CODE)) originalName = originalName.replaceAll(Utils.getIgnoreFormatCodeRegex(), "");