mirror of
				https://github.com/mcMMO-Dev/mcMMO.git
				synced 2025-11-04 11:03:43 +01:00 
			
		
		
		
	Minor tweaks
This commit is contained in:
		@@ -60,6 +60,7 @@ import com.gmail.nossr50.datatypes.skills.subskills.taming.TamingSummon;
 | 
				
			|||||||
import com.gmail.nossr50.mcMMO;
 | 
					import com.gmail.nossr50.mcMMO;
 | 
				
			||||||
import com.gmail.nossr50.skills.repair.RepairCost;
 | 
					import com.gmail.nossr50.skills.repair.RepairCost;
 | 
				
			||||||
import com.gmail.nossr50.skills.repair.RepairTransaction;
 | 
					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.repair.repairables.Repairable;
 | 
				
			||||||
import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
 | 
					import com.gmail.nossr50.skills.salvage.salvageables.Salvageable;
 | 
				
			||||||
import com.gmail.nossr50.util.nbt.RawNBT;
 | 
					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(ItemMatch.class), new CustomItemTargetSerializer());
 | 
				
			||||||
        customSerializers.registerType(TypeToken.of(RepairTransaction.class), new RepairTransactionSerializer());
 | 
					        customSerializers.registerType(TypeToken.of(RepairTransaction.class), new RepairTransactionSerializer());
 | 
				
			||||||
        customSerializers.registerType(TypeToken.of(RawNBT.class), new RawNBTSerializer());
 | 
					        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;
 | 
					package com.gmail.nossr50.skills.repair.repairables;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import com.gmail.nossr50.datatypes.items.ItemMatch;
 | 
				
			||||||
import org.bukkit.Material;
 | 
					import org.bukkit.Material;
 | 
				
			||||||
import org.bukkit.inventory.ItemStack;
 | 
					import org.bukkit.inventory.ItemStack;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -7,7 +8,7 @@ import java.util.HashMap;
 | 
				
			|||||||
import java.util.List;
 | 
					import java.util.List;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
public class RepairableManager {
 | 
					public class RepairableManager {
 | 
				
			||||||
    private HashMap<Material, Repairable> repairables;
 | 
					    private HashMap<ItemMatch<?>, Repairable> repairables;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public RepairableManager(List<Repairable> repairablesCollection) {
 | 
					    public RepairableManager(List<Repairable> repairablesCollection) {
 | 
				
			||||||
        this.repairables = new HashMap<>(repairablesCollection.size());
 | 
					        this.repairables = new HashMap<>(repairablesCollection.size());
 | 
				
			||||||
@@ -15,8 +16,7 @@ public class RepairableManager {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void registerRepairable(Repairable repairable) {
 | 
					    public void registerRepairable(Repairable repairable) {
 | 
				
			||||||
        Material item = repairable.getItem().getType();
 | 
					        repairables.put(repairable.getItemMatch(), repairable);
 | 
				
			||||||
        repairables.put(item, repairable);
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public void registerRepairables(List<Repairable> repairables) {
 | 
					    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) {
 | 
					    public boolean isRepairable(Material type) {
 | 
				
			||||||
        return repairables.containsKey(type);
 | 
					        return repairables.containsKey(type);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user