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