File tree Expand file tree Collapse file tree 2 files changed +7
-18
lines changed
java/org/maxgamer/quickshop/util/matcher/item Expand file tree Collapse file tree 2 files changed +7
-18
lines changed Original file line number Diff line number Diff line change 2727import org .maxgamer .quickshop .QuickShop ;
2828import org .maxgamer .quickshop .api .shop .ItemMatcher ;
2929
30- import java .util .Objects ;
31-
3230/**
3331 * A simple impl for ItemMatcher
3432 *
@@ -68,21 +66,12 @@ public class BukkitItemMatcherImpl implements ItemMatcher {
6866 */
6967 @ Override
7068 public boolean matches (@ Nullable ItemStack original , @ Nullable ItemStack tester ) {
71- return Objects .equals (original , tester );
72- /*
73- @Override
74- @Utility
75- public boolean equals(Object obj) {
76- if (this == obj) {
77- return true;
78- }
79- if (!(obj instanceof ItemStack)) {
80- return false;
81- }
82-
83- ItemStack stack = (ItemStack) obj;
84- return getAmount() == stack.getAmount() && isSimilar(stack);
69+ if (original == null && tester == null ) {
70+ return true ;
71+ }
72+ if ((original == null ) != (tester == null )) {
73+ return false ;
8574 }
86- */
75+ return tester . isSimilar ( original );
8776 }
8877}
Original file line number Diff line number Diff line change @@ -480,7 +480,7 @@ matcher:
480480 # 1= Bukkit item matcher, can be more accurate.
481481 # 2= Stricter Bukkit matcher, equals method.
482482 work-type : 0
483- # For Item
483+ # For Item (Only works under QuickShop ItemMatcher)
484484 item :
485485 # Should the Plugin check the item damage?
486486 damage : true
You can’t perform that action at this time.
0 commit comments