From 8feaf4410fe8dd572d9545184f28888070b23a55 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Tue, 22 May 2012 05:27:08 -0400 Subject: [PATCH] getRepairable by id --- .../com/gmail/nossr50/skills/repair/RepairManager.java | 8 ++++++++ .../gmail/nossr50/skills/repair/SimpleRepairManager.java | 5 +++++ 2 files changed, 13 insertions(+) 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 ae8a5b28f..9469fbff3 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -36,6 +36,14 @@ public interface RepairManager { */ public boolean isRepairable(ItemStack itemStack); + /** + * Gets the repairable with this id + * + * @param id Id of the repairable to look for + * @return the repairable, can be null + */ + public Repairable getRepairable(int id); + /** * Handle the repairing of this object * 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 6c08a6405..0b55dd573 100644 --- a/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java +++ b/src/main/java/com/gmail/nossr50/skills/repair/SimpleRepairManager.java @@ -52,6 +52,11 @@ public class SimpleRepairManager implements RepairManager { return isRepairable(itemStack.getTypeId()); } + @Override + public Repairable getRepairable(int id) { + return repairables.get(id); + } + @Override public void handleRepair(Player player, ItemStack item) { // Load some variables for use