diff --git a/src/main/java/com/loganmagnan/pluginbase/PluginBase.java b/src/main/java/com/loganmagnan/pluginbase/PluginBase.java index 2632407..dc5f300 100644 --- a/src/main/java/com/loganmagnan/pluginbase/PluginBase.java +++ b/src/main/java/com/loganmagnan/pluginbase/PluginBase.java @@ -17,60 +17,73 @@ import java.util.HashMap; @Setter public class PluginBase extends JavaPlugin { - // Main Class Instance + // Main class instance @Getter private static PluginBase instance; - // Configuration Files + // Configuration files private Config mainConfig; private FileConfig messagesConfig; // Managers - // Menu System + // Menu system private HashMap playerMenuUtilMap = new HashMap<>(); - // Command Framework + // Command framework private CommandFramework commandFramework = new CommandFramework(this); + // On enable function @Override public void onEnable() { + // Initialize the main class instance instance = this; + // Initialize all of the configuration files this.saveDefaultConfig(); this.mainConfig = new Config("config", this); this.messagesConfig = new FileConfig(this, "messages.yml"); + // Say the plugin's name this.getServer().getConsoleSender().sendMessage(Utils.chatBar); this.getServer().getConsoleSender().sendMessage(ColorUtils.getMessageType("&dPluginBase &7- &av" + this.getDescription().getVersion())); this.getServer().getConsoleSender().sendMessage(ColorUtils.getMessageType("&7Made by &eLoganM Development")); this.getServer().getConsoleSender().sendMessage(Utils.chatBar); + + // Load all of the functions this.loadCommands(); this.loadManagers(); this.loadListeners(); this.loadRunnables(); } + // On disable function @Override public void onDisable() { + // Remove the main class instance instance = null; } + // Load commands function private void loadCommands() { ClassRegistrationUtils.loadCommands("com.loganmagnan.pluginbase.commands"); } + // Load managers function private void loadManagers() { } + // Load listeners function private void loadListeners() { ClassRegistrationUtils.loadListeners("com.loganmagnan.pluginbase.listeners"); } + // Load runnables function private void loadRunnables() { } + // Menu system function public PlayerMenuUtil getPlayerMenuUtil(Player player) { PlayerMenuUtil playerMenuUtil;