Advertisement
Guest User

Untitled

a guest
Dec 15th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. public static boolean isSpecialItem(Material material, String name, ItemStack itemStack) {
  2. if (itemStack == null) {
  3. return false;
  4. }
  5.  
  6. if (!itemStack.getType().equals(material)) {
  7. return false;
  8. }
  9.  
  10. if (itemStack.getEnchantments().getOrDefault(Enchantment.DURABILITY, -1) != 10) {
  11. return false;
  12. }
  13.  
  14. return itemStack.hasItemMeta() && itemStack.getItemMeta().hasDisplayName() && itemStack.getItemMeta().getDisplayName().equalsIgnoreCase(ChatColor.translateAlternateColorCodes('&', name));
  15. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement