Oh yeah, that's why.

This commit is contained in:
GJ 2013-09-18 15:42:54 -04:00
parent 14eb473355
commit 59a35b170c

View File

@ -83,10 +83,10 @@ public class RepairManager extends SkillManager {
ItemStack toRemove = new MaterialData(repairMaterialId, repairMaterialMetadata).toItemStack(1); ItemStack toRemove = new MaterialData(repairMaterialId, repairMaterialMetadata).toItemStack(1);
// Check if they have the proper material to repair with // Check if they have the proper material to repair with
if (!inventory.containsAtLeast(toRemove, 1)) { if (!inventory.contains(Material.getMaterial(repairMaterialId))) {
String message = LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(repairMaterialId)); String message = LocaleLoader.getString("Skills.NeedMore", StringUtils.getPrettyItemString(repairMaterialId));
if (repairMaterialMetadata > 0) { if (repairMaterialMetadata != (byte) -1 && !inventory.containsAtLeast(toRemove, 1)) {
message += ":" + repairMaterialMetadata; message += ":" + repairMaterialMetadata;
} }
@ -130,6 +130,11 @@ public class RepairManager extends SkillManager {
} }
// Remove the item // Remove the item
if (repairMaterialMetadata == -1) {
toRemove = inventory.getItem(inventory.first(Material.getMaterial(repairMaterialId))).clone();
toRemove.setAmount(1);
}
inventory.removeItem(toRemove); inventory.removeItem(toRemove);
// Give out XP like candy // Give out XP like candy