mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-25 06:36:45 +01:00
Minor tweaks
This commit is contained in:
parent
20b9b0d0fe
commit
f1de5484ec
@ -60,6 +60,7 @@ import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
|
||||
import com.gmail.nossr50.mcMMO;
|
||||
import com.gmail.nossr50.skills.repair.RepairCost;
|
||||
import com.gmail.nossr50.skills.repair.RepairTransaction;
|
||||
import com.gmail.nossr50.skills.repair.SimpleRepairCost;
|
||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
|
||||
import com.gmail.nossr50.util.nbt.RawNBT;
|
||||
@ -276,7 +277,7 @@ public final class ConfigManager {
|
||||
customSerializers.registerType(TypeToken.of(ItemMatch.class), new CustomItemTargetSerializer());
|
||||
customSerializers.registerType(TypeToken.of(RepairTransaction.class), new RepairTransactionSerializer());
|
||||
customSerializers.registerType(TypeToken.of(RawNBT.class), new RawNBTSerializer());
|
||||
customSerializers.registerType(TypeToken.of(RepairCost.class), new SimpleRepairCostSerializer());
|
||||
customSerializers.registerType(TypeToken.of(SimpleRepairCost.class), new SimpleRepairCostSerializer());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.gmail.nossr50.skills.repair.repairables;
|
||||
|
||||
import com.gmail.nossr50.datatypes.items.ItemMatch;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
|
||||
@ -7,7 +8,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class RepairableManager {
|
||||
private HashMap<Material, Repairable> repairables;
|
||||
private HashMap<ItemMatch<?>, Repairable> repairables;
|
||||
|
||||
public RepairableManager(List<Repairable> repairablesCollection) {
|
||||
this.repairables = new HashMap<>(repairablesCollection.size());
|
||||
@ -15,8 +16,7 @@ public class RepairableManager {
|
||||
}
|
||||
|
||||
public void registerRepairable(Repairable repairable) {
|
||||
Material item = repairable.getItem().getType();
|
||||
repairables.put(item, repairable);
|
||||
repairables.put(repairable.getItemMatch(), repairable);
|
||||
}
|
||||
|
||||
public void registerRepairables(List<Repairable> repairables) {
|
||||
@ -25,6 +25,16 @@ public class RepairableManager {
|
||||
}
|
||||
}
|
||||
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
//TODO: Make these use item matching
|
||||
public boolean isRepairable(Material type) {
|
||||
return repairables.containsKey(type);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user