1
mirror of https://github.com/StarWishsama/Slimefun4.git synced 2024-09-20 03:35:51 +00:00

Re-added check null and empty.

This commit is contained in:
BuildTools 2021-04-23 19:29:36 +08:00
parent 07167442f9
commit a846d4ea1b

View File

@ -63,8 +63,15 @@ abstract class AbstractEnchantmentMachine extends AContainer {
protected boolean hasIgnoredLore(@Nonnull ItemStack itemStack) {
List<String> ignoredLore = ignoredLores.getValue();
// Skip the check if not set any ignored lore.
if (ignoredLore.isEmpty()) {
return false;
}
if (itemStack.hasItemMeta()) {
List<String> itemLore = itemStack.getItemMeta().getLore();
if (itemLore == null) {
return false;
}
for (String lore : ignoredLore) {
if (itemLore.contains(ChatColors.color(lore))) {
return true;