From a9295751c851e01ddd2d81df85234912b5bc5ccc Mon Sep 17 00:00:00 2001 From: NuclearW Date: Thu, 17 May 2012 04:32:14 -0400 Subject: [PATCH] Beginnings of RepairManager interface Not sure yet exactly what to leave in Repair and what to have in the Manager implementation. I'm fairly sure that the xpHandler should be in Repair, but that's private at the moment so usage from the Manager is impossible except with public modifier, which is unacceptable. Considering moving Repair to the new repair package, perhaps eventually all skills will have packages and skills. Moving it seems like the logical solution with protected modifier. --- .../nossr50/skills/repair/RepairManager.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java diff --git a/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java new file mode 100644 index 000000000..e5d916400 --- /dev/null +++ b/src/main/java/com/gmail/nossr50/skills/repair/RepairManager.java @@ -0,0 +1,29 @@ +package com.gmail.nossr50.skills.repair; + +import org.bukkit.entity.Player; +import org.bukkit.inventory.ItemStack; + +public interface RepairManager { + /** + * Register a repairable with the RepairManager + * + * @param repairable Repairable to register + */ + public void registerRepairable(Repairable repairable); + + /** + * Checks if an item is repairable + * + * @param itemId id to check if repairable + * @return true if repairable, false if not + */ + public boolean isRepairable(int itemId); + + /** + * Handle the repairing of this object + * + * @param player Player that is repairing an item + * @param item ItemStack that is being repaired + */ + public void handleRepair(Player player, ItemStack item); +}