diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java index e5d916400..e76b7e488 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -1,5 +1,7 @@ package com.gmail.nossr50.skills.repair; +import java.util.List; + import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -11,6 +13,13 @@ public interface RepairManager { */ public void registerRepairable(Repairable repairable); + /** + * Register a list of repairables with the RepairManager + * + * @param repairable List to register + */ + public void registerRepairables(List repairables); + /** * Checks if an item is repairable * diff --git a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java index 0ce262529..a92682f99 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java @@ -1,6 +1,7 @@ package com.gmail.nossr50.skills.repair; import java.util.HashMap; +import java.util.List; import org.bukkit.entity.Player; import org.bukkit.inventory.ItemStack; @@ -18,13 +19,20 @@ public class SimpleRepairManager implements RepairManager { @Override public void registerRepairable(Repairable repairable) { - // TODO Auto-generated method stub + Integer itemId = repairable.getItemId(); + repairables.put(itemId, repairable); + } + + @Override + public void registerRepairables(List repairables) { + for(Repairable repairable : repairables) { + registerRepairable(repairable); + } } @Override public boolean isRepairable(int itemId) { - // TODO Auto-generated method stub - return false; + return repairables.containsKey(itemId); } @Override