This commit is contained in:
Logan Magnan 2024-09-22 10:45:46 -04:00
parent d87c25fcb2
commit 568fe21af6

View File

@ -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<Player, PlayerMenuUtil> 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;