mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Registration
This commit is contained in:
parent
d139146e0b
commit
bd3491d210
@ -1,5 +1,7 @@
|
|||||||
package com.gmail.nossr50.skills.repair;
|
package com.gmail.nossr50.skills.repair;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
|
|
||||||
@ -11,6 +13,13 @@ public interface RepairManager {
|
|||||||
*/
|
*/
|
||||||
public void registerRepairable(Repairable repairable);
|
public void registerRepairable(Repairable repairable);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Register a list of repairables with the RepairManager
|
||||||
|
*
|
||||||
|
* @param repairable List<Repairable> to register
|
||||||
|
*/
|
||||||
|
public void registerRepairables(List<Repairable> repairables);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Checks if an item is repairable
|
* Checks if an item is repairable
|
||||||
*
|
*
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package com.gmail.nossr50.skills.repair;
|
package com.gmail.nossr50.skills.repair;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import org.bukkit.entity.Player;
|
import org.bukkit.entity.Player;
|
||||||
import org.bukkit.inventory.ItemStack;
|
import org.bukkit.inventory.ItemStack;
|
||||||
@ -18,13 +19,20 @@ public class SimpleRepairManager implements RepairManager {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void registerRepairable(Repairable repairable) {
|
public void registerRepairable(Repairable repairable) {
|
||||||
// TODO Auto-generated method stub
|
Integer itemId = repairable.getItemId();
|
||||||
|
repairables.put(itemId, repairable);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerRepairables(List<Repairable> repairables) {
|
||||||
|
for(Repairable repairable : repairables) {
|
||||||
|
registerRepairable(repairable);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isRepairable(int itemId) {
|
public boolean isRepairable(int itemId) {
|
||||||
// TODO Auto-generated method stub
|
return repairables.containsKey(itemId);
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user