From 837afab0dbe0d1eb245e16494acfc7783300597d Mon Sep 17 00:00:00 2001 From: Rothes <47097395+Rothes@users.noreply.github.com> Date: Tue, 20 Apr 2021 22:43:37 +0800 Subject: [PATCH] Update AutoEnchanter.java --- .../electric/machines/enchanting/AutoEnchanter.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AutoEnchanter.java b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AutoEnchanter.java index fc7f65ded..239654b47 100644 --- a/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AutoEnchanter.java +++ b/src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AutoEnchanter.java @@ -135,10 +135,13 @@ public class AutoEnchanter extends AContainer { return false; } else { ItemMeta itemMeta = item.getItemMeta(); - if (itemMeta != null && itemMeta.hasLore()) { - for (String lore : cantEnchantLores.getValue()) { - if (itemMeta.getLore().contains(ChatColors.color(lore))) { - return false; + if (itemMeta != null) { + List lores = itemMeta.getLore(); + if (lores != null) { + for (String lore : cantEnchantLores.getValue()) { + if (lore.contains(ChatColors.color(lore))) { + return false; + } } } }