mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 05:06:45 +01:00
Fixed bug with repairing using materials with byte metadata
This commit is contained in:
parent
e5f6da01ec
commit
5f4e269efa
@ -9,6 +9,7 @@ Key:
|
|||||||
|
|
||||||
Version 1.4.03-dev
|
Version 1.4.03-dev
|
||||||
= Fixed bug where players were unable to salvage leather armor
|
= Fixed bug where players were unable to salvage leather armor
|
||||||
|
= Fixed bug with repairing using materials with byte metadata
|
||||||
|
|
||||||
Version 1.4.02
|
Version 1.4.02
|
||||||
+ Added API to get the skill and power level caps.
|
+ Added API to get the skill and power level caps.
|
||||||
|
@ -82,13 +82,17 @@ public class Repair {
|
|||||||
protected static int findInInventory(PlayerInventory inventory, int itemId, byte metadata) {
|
protected static int findInInventory(PlayerInventory inventory, int itemId, byte metadata) {
|
||||||
int location = -1;
|
int location = -1;
|
||||||
|
|
||||||
for (ItemStack item : inventory.getContents()) {
|
ItemStack[] contents = inventory.getContents();
|
||||||
|
|
||||||
|
for (int i = 0; i < contents.length; i++) {
|
||||||
|
ItemStack item = contents[i];
|
||||||
|
|
||||||
if (item == null) {
|
if (item == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (item.getTypeId() == itemId && item.getData().getData() == metadata) {
|
if (item.getTypeId() == itemId && item.getData().getData() == metadata) {
|
||||||
return location;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user