new config pt 10 - All configs are now managed by ConfigManager (WIP)

This commit is contained in:
nossr50
2019-02-17 08:59:09 -08:00
parent acf2bf362f
commit f4ba472403
30 changed files with 515 additions and 324 deletions

View File

@ -1,11 +1,12 @@
package com.gmail.nossr50.skills.salvage.salvageables;
import com.gmail.nossr50.config.Unload;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
import java.util.List;
public interface SalvageableManager {
public interface SalvageableManager extends Unload {
/**
* Register a salvageable with the SalvageManager
*

View File

@ -10,12 +10,18 @@ import java.util.List;
public class SimpleSalvageableManager implements SalvageableManager {
private HashMap<Material, Salvageable> salvageables;
public SimpleSalvageableManager() {
/*public SimpleSalvageableManager() {
this(55);
}*/
@Override
public void unload() {
salvageables.clear();
}
public SimpleSalvageableManager(int salvageablesSize) {
this.salvageables = new HashMap<Material, Salvageable>(salvageablesSize);
public SimpleSalvageableManager(List<Salvageable> salvageablesCollection) {
this.salvageables = new HashMap<Material, Salvageable>(salvageablesCollection.size());
registerSalvageables(salvageablesCollection);
}
@Override