getRepairable by id

This commit is contained in:
NuclearW 2012-05-22 05:27:08 -04:00
parent 4e224d761e
commit 8feaf4410f
2 changed files with 13 additions and 0 deletions

View File

@ -36,6 +36,14 @@ public interface RepairManager {
*/ */
public boolean isRepairable(ItemStack itemStack); 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 * Handle the repairing of this object
* *

View File

@ -52,6 +52,11 @@ public class SimpleRepairManager implements RepairManager {
return isRepairable(itemStack.getTypeId()); return isRepairable(itemStack.getTypeId());
} }
@Override
public Repairable getRepairable(int id) {
return repairables.get(id);
}
@Override @Override
public void handleRepair(Player player, ItemStack item) { public void handleRepair(Player player, ItemStack item) {
// Load some variables for use // Load some variables for use