Skip to content

Commit

Permalink
improve material matcher
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jun 25, 2018
1 parent 68bd74d commit c97dc7a
Showing 1 changed file with 13 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,13 @@ public boolean tryItem(dItem item, String comparedto) {
}
dMaterial quickOf = dMaterial.quickOfNamed(comparedto);
if (quickOf != null) {
return item.getMaterial().equals(quickOf);
dMaterial mat = item.getMaterial();
if (quickOf.getMaterial() != mat.getMaterial()) {
return false;
}
if (quickOf.equals(mat)) {
return true;
}
}
item = new dItem(item.getItemStack().clone());
item.setAmount(1);
Expand Down Expand Up @@ -143,7 +149,12 @@ public boolean tryMaterial(dMaterial mat, String comparedto) {
}
dMaterial quickOf = dMaterial.quickOfNamed(comparedto);
if (quickOf != null) {
return mat.equals(quickOf);
if (quickOf.getMaterial() != mat.getMaterial()) {
return false;
}
if (quickOf.equals(mat)) {
return true;
}
}
else if (CoreUtilities.toLowerCase(mat.realName()).equals(comparedto)) {
return true;
Expand Down

0 comments on commit c97dc7a

Please sign in to comment.