mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 13:16:45 +01:00
Oh yeah, that's why.
This commit is contained in:
parent
14eb473355
commit
59a35b170c
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user