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

Update src/main/java/io/github/thebusybiscuit/slimefun4/implementation/items/electric/machines/enchanting/AutoEnchanter.java

Co-authored-by: Riley <69326411+Mooy1@users.noreply.github.com>
This commit is contained in:
Rothes 2021-04-21 12:20:08 +08:00 committed by GitHub
parent 837afab0db
commit 807c442930
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -133,19 +133,17 @@ public class AutoEnchanter extends AContainer {
private boolean isEnchantable(@Nullable ItemStack item) { private boolean isEnchantable(@Nullable ItemStack item) {
if (item == null) { if (item == null) {
return false; return false;
} else { }
ItemMeta itemMeta = item.getItemMeta(); if (item.hasItemMeta()) {
if (itemMeta != null) { List<String> lores = item.getItemMeta().getLore();
List<String> lores = itemMeta.getLore();
if (lores != null) { if (lores != null) {
for (String lore : cantEnchantLores.getValue()) { for (String lore : cantEnchantLores.getValue()) {
if (lore.contains(ChatColors.color(lore))) { if (lores.contains(ChatColors.color(lore))) {
return false; return false;
} }
} }
} }
} }
}
// stops endless checks of getByItem for enchanted book stacks. // stops endless checks of getByItem for enchanted book stacks.
if (item.getType() != Material.ENCHANTED_BOOK) { if (item.getType() != Material.ENCHANTED_BOOK) {
SlimefunItem sfItem = SlimefunItem.getByItem(item); SlimefunItem sfItem = SlimefunItem.getByItem(item);