From e20bcd19b97392a4823212a5a9b54b8eb22af109 Mon Sep 17 00:00:00 2001 From: NuclearW Date: Tue, 22 May 2012 00:57:24 -0400 Subject: [PATCH] Make our RepairManager, load configs, and register them all --- src/main/java/com/gmail/nossr50/mcMMO.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/main/java/com/gmail/nossr50/mcMMO.java b/src/main/java/com/gmail/nossr50/mcMMO.java index 3eab5ad50..981a93e63 100644 --- a/src/main/java/com/gmail/nossr50/mcMMO.java +++ b/src/main/java/com/gmail/nossr50/mcMMO.java @@ -8,11 +8,15 @@ import com.gmail.nossr50.commands.party.*; import com.gmail.nossr50.commands.general.*; import com.gmail.nossr50.config.Config; import com.gmail.nossr50.config.HiddenConfig; +import com.gmail.nossr50.config.RepairConfigManager; import com.gmail.nossr50.config.TreasuresConfig; import com.gmail.nossr50.config.mods.CustomBlocksConfig; import com.gmail.nossr50.config.mods.CustomArmorConfig; import com.gmail.nossr50.config.mods.CustomToolsConfig; import com.gmail.nossr50.runnables.*; +import com.gmail.nossr50.skills.repair.RepairManager; +import com.gmail.nossr50.skills.repair.RepairManagerFactory; +import com.gmail.nossr50.skills.repair.Repairable; import com.gmail.nossr50.util.Database; import com.gmail.nossr50.util.Leaderboard; import com.gmail.nossr50.util.Metrics; @@ -33,6 +37,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.util.HashMap; +import java.util.List; import org.bukkit.OfflinePlayer; import org.bukkit.plugin.PluginDescriptionFile; @@ -59,6 +64,7 @@ public class mcMMO extends JavaPlugin { public static mcMMO p; public static ChunkletManager placeStore; + public static RepairManager repairManager; /* Jar Stuff */ public File mcmmo; @@ -78,6 +84,12 @@ public class mcMMO extends JavaPlugin { TreasuresConfig.getInstance(); HiddenConfig.getInstance(); + //Load repair configs and register them + RepairConfigManager rManager = new RepairConfigManager(this); + List repairables = rManager.getLoadedRepairables(); + repairManager = RepairManagerFactory.getRepairManager(repairables.size()); + repairManager.registerRepairables(repairables); + if (configInstance.getToolModsEnabled()) { CustomToolsConfig.getInstance().load(); }