MCPcopy Create free account
hub / github.com/boxbeam/RedLib / compare

Method compare

src/redempt/redlib/itemutils/ItemUtils.java:559–572  ·  view source on GitHub ↗

Compares the traits of two items @param first The first ItemStack @param second The second ItemStack @param traits The ItemTraits to compare @return Whether the two items are identical in terms of the traits provided. Returns true if both items are null, and false if only one is null.

(ItemStack first, ItemStack second, ItemTrait... traits)

Source from the content-addressed store, hash-verified

557 * @return Whether the two items are identical in terms of the traits provided. Returns true if both items are null, and false if only one is null.
558 */
559 public static boolean compare(ItemStack first, ItemStack second, ItemTrait... traits) {
560 if (first == second) {
561 return true;
562 }
563 if (first == null || second == null) {
564 return false;
565 }
566 for (ItemTrait trait : traits) {
567 if (!trait.compare(first, second)) {
568 return false;
569 }
570 }
571 return true;
572 }
573
574 /**
575 * Compares the type, name, and lore of two items

Callers 4

countMethod · 0.95
removeMethod · 0.95
countAndRemoveMethod · 0.95
onClickMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected