From 7f0803c3f6584110944701d289081baec9b2d027 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Thu, 17 May 2012 22:21:35 -0400 Subject: [PATCH] Add in xpMultiplier --- .../java/com/gmail/nossr50/skills/repair/Repairable.java | 7 +++++++ .../gmail/nossr50/skills/repair/RepairableFactory.java | 4 ++-- .../gmail/nossr50/skills/repair/SimpleRepairable.java | 9 ++++++++- 3 files changed, 17 insertions(+), 3 deletions(-) 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; + } }