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)
| 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 |
no outgoing calls
no test coverage detected