diff --git a/src/main/java/com/gmail/nossr50/skills/repair/Repairable.java b/src/main/java/com/gmail/nossr50/skills/repair/Repairable.java index 4cd070eb4..45926b5d5 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repairable.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repairable.java @@ -15,6 +15,13 @@ public interface Repairable { */ public int getRepairMaterialId(); + /** + * Gets the metadata byte value of the material used to repair this item + * + * @return the byte metadata of the repair material + */ + public byte getRepairMaterialMetadata(); + /** * Gets the minimum quantity of repair materials ignoring all other repair bonuses * diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairableFactory.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairableFactory.java index 4aac4b5c4..4ecab3a31 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairableFactory.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairableFactory.java @@ -1,8 +1,8 @@ package com.gmail.nossr50.skills.repair; public class RepairableFactory { - public static Repairable getRepairable(int itemId, int repairMaterialId, int minimumLevel, int minimumQuantity, short maximumDurability) { + public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability) { // TODO: Add in loading from config what type of manager we want. - return new SimpleRepairable(itemId, repairMaterialId, minimumLevel, minimumQuantity, maximumDurability); + return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability); } } diff --git a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairable.java b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairable.java index 1fd0cdf6e..fd9721387 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairable.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairable.java @@ -3,10 +3,12 @@ package com.gmail.nossr50.skills.repair; public class SimpleRepairable implements Repairable { private final int itemId, repairMaterialId, minimumQuantity, minimumLevel; private final short maximumDurability, baseRepairDurability; + private final byte repairMetadata; - protected SimpleRepairable(int itemId, int repairMaterialId, int minimumLevel, int minimumQuantity, short maximumDurability) { + protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability) { this.itemId = itemId; this.repairMaterialId = repairMaterialId; + this.repairMetadata = repairMetadata; this.minimumLevel = minimumLevel; this.minimumQuantity = minimumQuantity; this.maximumDurability = maximumDurability; @@ -23,6 +25,11 @@ public class SimpleRepairable implements Repairable { return repairMaterialId; } + @Override + public byte getRepairMaterialMetadata() { + return repairMetadata; + } + @Override public int getMinimumQuantity() { return minimumQuantity;