mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-22 21:26:46 +01:00
Remove RepairableManagerFactory until we actually need it
Let's hold off on the factory pattern until we actually offer choices.
This commit is contained in:
parent
766f1f4127
commit
476f426590
@ -38,7 +38,7 @@ import com.gmail.nossr50.skills.child.ChildConfig;
|
|||||||
import com.gmail.nossr50.skills.repair.config.RepairConfigManager;
|
import com.gmail.nossr50.skills.repair.config.RepairConfigManager;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
import com.gmail.nossr50.skills.repair.repairables.Repairable;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.RepairableManager;
|
import com.gmail.nossr50.skills.repair.repairables.RepairableManager;
|
||||||
import com.gmail.nossr50.skills.repair.repairables.RepairableManagerFactory;
|
import com.gmail.nossr50.skills.repair.repairables.SimpleRepairableManager;
|
||||||
import com.gmail.nossr50.util.ChimaeraWing;
|
import com.gmail.nossr50.util.ChimaeraWing;
|
||||||
import com.gmail.nossr50.util.LogFilter;
|
import com.gmail.nossr50.util.LogFilter;
|
||||||
import com.gmail.nossr50.util.Misc;
|
import com.gmail.nossr50.util.Misc;
|
||||||
@ -357,7 +357,7 @@ public class mcMMO extends JavaPlugin {
|
|||||||
// Load repair configs, make manager, and register them at this time
|
// Load repair configs, make manager, and register them at this time
|
||||||
RepairConfigManager rManager = new RepairConfigManager(this);
|
RepairConfigManager rManager = new RepairConfigManager(this);
|
||||||
repairables.addAll(rManager.getLoadedRepairables());
|
repairables.addAll(rManager.getLoadedRepairables());
|
||||||
repairableManager = RepairableManagerFactory.getRepairManager(repairables.size());
|
repairableManager = new SimpleRepairableManager(repairables.size());
|
||||||
repairableManager.registerRepairables(repairables);
|
repairableManager.registerRepairables(repairables);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,14 +0,0 @@
|
|||||||
package com.gmail.nossr50.skills.repair.repairables;
|
|
||||||
|
|
||||||
|
|
||||||
public class RepairableManagerFactory {
|
|
||||||
public static RepairableManager getRepairManager() {
|
|
||||||
// TODO: Add in loading from config what type of manager we want.
|
|
||||||
return new SimpleRepairableManager();
|
|
||||||
}
|
|
||||||
|
|
||||||
public static RepairableManager getRepairManager(int repairablesSize) {
|
|
||||||
// TODO: Add in loading from config what type of manager we want.
|
|
||||||
return new SimpleRepairableManager(repairablesSize);
|
|
||||||
}
|
|
||||||
}
|
|
@ -10,11 +10,11 @@ import org.bukkit.inventory.ItemStack;
|
|||||||
public class SimpleRepairableManager implements RepairableManager {
|
public class SimpleRepairableManager implements RepairableManager {
|
||||||
private HashMap<Material, Repairable> repairables;
|
private HashMap<Material, Repairable> repairables;
|
||||||
|
|
||||||
protected SimpleRepairableManager() {
|
public SimpleRepairableManager() {
|
||||||
this(55);
|
this(55);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected SimpleRepairableManager(int repairablesSize) {
|
public SimpleRepairableManager(int repairablesSize) {
|
||||||
this.repairables = new HashMap<Material, Repairable>(repairablesSize);
|
this.repairables = new HashMap<Material, Repairable>(repairablesSize);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user