diff --git a/src/com/massivecraft/massivecore/util/InventoryUtil.java b/src/com/massivecraft/massivecore/util/InventoryUtil.java index 3c37bdb3..997f5001 100644 --- a/src/com/massivecraft/massivecore/util/InventoryUtil.java +++ b/src/com/massivecraft/massivecore/util/InventoryUtil.java @@ -1259,26 +1259,31 @@ public class InventoryUtil // LORE PREFIX // -------------------------------------------- // - public static void removeLoreMatching(ItemStack item, Predicate predicate) + // Return true on change + public static boolean removeLoreMatching(ItemStack item, Predicate predicate) { if (predicate == null) throw new NullPointerException("prefix"); List lore = getLore(item); - if (lore == null) return; + if (lore == null) return false; + boolean ret = false; for (Iterator it = lore.iterator(); it.hasNext();) { String line = it.next(); if (!predicate.apply(line)) continue; it.remove(); + ret = true; } setLore(item, lore); + + return ret; } - public static void removeLoreWithPrefix(ItemStack item, String prefix) + public static boolean removeLoreWithPrefix(ItemStack item, String prefix) { - removeLoreMatching(item, PredicateStringStartsWith.get(prefix)); + return removeLoreMatching(item, PredicateStringStartsWith.get(prefix)); } public static List getLoreMatching(ItemStack item, Predicate predicate)