mirror of
https://github.com/MilkBowl/VaultAPI.git
synced 2024-11-25 03:45:12 +01:00
Merge pull request #41 from FlyingPikachu/master
Correct itemByStack(), fixes #10 and #36
This commit is contained in:
commit
bf98e28a93
3
.gitignore
vendored
3
.gitignore
vendored
@ -2,4 +2,5 @@
|
||||
/dependency-reduced-pom.xml
|
||||
/.classpath
|
||||
/.project
|
||||
/.settings
|
||||
/.settings
|
||||
/bin/
|
||||
|
@ -817,10 +817,16 @@ public class Items {
|
||||
}
|
||||
|
||||
for (ItemInfo item : items) {
|
||||
if (itemStack.getType().equals(item.getType()) && item.isDurable()) {
|
||||
return item;
|
||||
} else if (itemStack.getType().equals(item.getType()) && item.getSubTypeId() == itemStack.getDurability()) {
|
||||
return item;
|
||||
if (itemStack.getType().equals(item.getType())) {
|
||||
if (itemStack.getType().isSolid() && item.getType().isSolid()) {
|
||||
//Solid, so check durability (Podzol, Colored Wool, et al.)
|
||||
if (item.isDurable()) {
|
||||
return item;
|
||||
}
|
||||
} else {
|
||||
//Not solid, so ignore durability (Stick, Stone Button, et al.)
|
||||
return item;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user