mirror of
https://e.coding.net/circlecloud/Soulbound.git
synced 2026-02-16 11:20:03 +00:00
@@ -54,7 +54,8 @@ public class ItemsConfig extends ConfigLoader {
|
|||||||
Material itemMaterial = Material.matchMaterial(itemInfo[0]);
|
Material itemMaterial = Material.matchMaterial(itemInfo[0]);
|
||||||
|
|
||||||
if (itemMaterial == null) {
|
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;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +72,8 @@ public class ItemsConfig extends ConfigLoader {
|
|||||||
|
|
||||||
String name = null;
|
String name = null;
|
||||||
if (config.contains("Items." + itemName + ".Name")) {
|
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);
|
SoulbindItem soulbindItem = new SoulbindItem(itemMaterialData, name, lore);
|
||||||
@@ -133,23 +135,16 @@ public class ItemsConfig extends ConfigLoader {
|
|||||||
if (itemStack.getData().equals(soulbindItem.getMaterialData())) {
|
if (itemStack.getData().equals(soulbindItem.getMaterialData())) {
|
||||||
if (itemStack.hasItemMeta()) {
|
if (itemStack.hasItemMeta()) {
|
||||||
ItemMeta itemMeta = itemStack.getItemMeta();
|
ItemMeta itemMeta = itemStack.getItemMeta();
|
||||||
|
|
||||||
if (soulbindItem.getName() != null) {
|
if (soulbindItem.getName() != null) {
|
||||||
if (!itemMeta.getDisplayName().contains(soulbindItem.getName())) {
|
if (itemMeta.getDisplayName().contains(soulbindItem.getName()))
|
||||||
return false;
|
if (soulbindItem.getLore() != null && !soulbindItem.getLore().isEmpty())
|
||||||
}
|
if (itemMeta.hasLore()
|
||||||
}
|
&& itemMeta.getLore().containsAll(soulbindItem.getLore()))
|
||||||
|
|
||||||
if (soulbindItem.getLore() != null && !soulbindItem.getLore().isEmpty()) {
|
|
||||||
if (itemMeta.hasLore() || !itemMeta.getLore().containsAll(soulbindItem.getLore())) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user