parent
e82831db0d
commit
6f7cd753c3
|
@ -54,7 +54,8 @@ public class ItemsConfig extends ConfigLoader {
|
|||
Material itemMaterial = Material.matchMaterial(itemInfo[0]);
|
||||
|
||||
if (itemMaterial == null) {
|
||||
plugin.getLogger().warning("Invalid material name. This item will be skipped. - " + itemInfo[0]);
|
||||
plugin.getLogger().warning(
|
||||
"Invalid material name. This item will be skipped. - " + itemInfo[0]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -71,7 +72,8 @@ public class ItemsConfig extends ConfigLoader {
|
|||
|
||||
String name = null;
|
||||
if (config.contains("Items." + itemName + ".Name")) {
|
||||
name = ChatColor.translateAlternateColorCodes('&', config.getString("Items." + itemName + ".Name"));
|
||||
name = ChatColor.translateAlternateColorCodes('&',
|
||||
config.getString("Items." + itemName + ".Name"));
|
||||
}
|
||||
|
||||
SoulbindItem soulbindItem = new SoulbindItem(itemMaterialData, name, lore);
|
||||
|
@ -133,23 +135,16 @@ public class ItemsConfig extends ConfigLoader {
|
|||
if (itemStack.getData().equals(soulbindItem.getMaterialData())) {
|
||||
if (itemStack.hasItemMeta()) {
|
||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||
|
||||
if (soulbindItem.getName() != null) {
|
||||
if (!itemMeta.getDisplayName().contains(soulbindItem.getName())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (soulbindItem.getLore() != null && !soulbindItem.getLore().isEmpty()) {
|
||||
if (itemMeta.hasLore() || !itemMeta.getLore().containsAll(soulbindItem.getLore())) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (itemMeta.getDisplayName().contains(soulbindItem.getName()))
|
||||
if (soulbindItem.getLore() != null && !soulbindItem.getLore().isEmpty())
|
||||
if (itemMeta.hasLore()
|
||||
&& itemMeta.getLore().containsAll(soulbindItem.getLore()))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue