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 ddd225dea..db0716589 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/Repairable.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/Repairable.java @@ -67,4 +67,11 @@ public interface Repairable { * @return the minimum level to repair this item, or 0 for no minimum */ public int getMinimumLevel(); + + /** + * Gets the xpMultiplier for this repairable + * + * @return the xpMultiplier of this repairable + */ + public double getXpMultiplier(); } 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 dfe0caef0..0ee36f8dc 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, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType) { + public static Repairable getRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) { // TODO: Add in loading from config what type of manager we want. - return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType); + return new SimpleRepairable(itemId, repairMaterialId, repairMetadata, minimumLevel, minimumQuantity, maximumDurability, repairItemType, repairMaterialType, xpMultiplier); } } 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 94567b402..c2c5dea58 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairable.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairable.java @@ -6,8 +6,9 @@ public class SimpleRepairable implements Repairable { private final byte repairMetadata; private final RepairItemType repairItemType; private final RepairMaterialType repairMaterialType; + private final double xpMultiplier; - protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType) { + protected SimpleRepairable(int itemId, int repairMaterialId, byte repairMetadata, int minimumLevel, int minimumQuantity, short maximumDurability, RepairItemType repairItemType, RepairMaterialType repairMaterialType, double xpMultiplier) { this.itemId = itemId; this.repairMaterialId = repairMaterialId; this.repairMetadata = repairMetadata; @@ -17,6 +18,7 @@ public class SimpleRepairable implements Repairable { this.minimumQuantity = minimumQuantity; this.maximumDurability = maximumDurability; this.baseRepairDurability = (short) (maximumDurability / minimumQuantity); + this.xpMultiplier = xpMultiplier; } @Override @@ -63,4 +65,9 @@ public class SimpleRepairable implements Repairable { public int getMinimumLevel() { return minimumLevel; } + + @Override + public double getXpMultiplier() { + return xpMultiplier; + } }