Package com.bencodez.advancedcore
Class AdvancedCorePlugin
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
com.bencodez.advancedcore.AdvancedCorePlugin
- All Implemented Interfaces:
org.bukkit.command.CommandExecutor,org.bukkit.command.TabCompleter,org.bukkit.command.TabExecutor,org.bukkit.plugin.Plugin
public abstract class AdvancedCorePlugin
extends org.bukkit.plugin.java.JavaPlugin
Abstract base class for plugins that use AdvancedCore. Provides core
functionality for user management, rewards, permissions, and more.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddUserStartup(UserStartup start) Adds a user startup task to be executed on plugin startup.voidallowDownloadingFromSpigot(int resourceId) Allows downloading plugin updates from Spigot.voidChecks for plugin updates in the background.voidconvertDataStorage(UserStorage from, UserStorage to) Converts data from one storage type to another.voidLogs a debug message at the specified debug level.voidLogs a debug message at INFO level.voidShow exception in console if debug is onvoidLogs a debug message at DEV level.voidextraDebug(String debug) Logs a debug message at EXTRA level.static AdvancedCorePluginGets the singleton instance of this plugin.Gets the SQLite user table.Gets the current storage type configuration.Gets the user manager instance.booleanChecks if MySQL connection is okay.voidLoads AdvancedCore event listeners.voidloadHook()Load AdvancedCore hookvoidLoads tab completion options.voidloadUserAPI(UserStorage storageType) Loads user API for specified storage type.voidLoads Vault integration.voidvoidonEnable()abstract voidCalled after plugin loads.abstract voidCalled before plugin loads.abstract voidonUnLoad()Called when plugin unloads.voidregisterBungeeChannels(String name) Registers BungeeCord messaging channels.voidregisterEvents(org.bukkit.event.Listener listener) Registers a listener.abstract voidreload()Reloads plugin configuration.voidDeprecated.voidreloadAdvancedCore(boolean userStorage) Reloads AdvancedCore configuration.voidsetConfigData(com.bencodez.simpleapi.file.YMLConfig ymlConfig) Sets configuration data.voidsetConfigData(org.bukkit.configuration.ConfigurationSection configData) Deprecated.static voidsetInstance(AdvancedCorePlugin plugin) Sets the singleton instance of this plugin.voidSets the MySQL database connection.voidRuns user startup tasks.Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLogger, getPlugin, getPluginLoader, getProvidingPlugin, getResource, getServer, getTextResource, isEnabled, isNaggable, onCommand, onLoad, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toStringMethods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
-
Field Details
-
vaultHandler
Handler for Vault integration.
-
-
Constructor Details
-
AdvancedCorePlugin
public AdvancedCorePlugin()
-
-
Method Details
-
getInstance
Gets the singleton instance of this plugin.- Returns:
- the plugin instance
-
setInstance
Sets the singleton instance of this plugin.- Parameters:
plugin- the plugin instance to set
-
addUserStartup
Adds a user startup task to be executed on plugin startup.- Parameters:
start- the startup task to add
-
allowDownloadingFromSpigot
public void allowDownloadingFromSpigot(int resourceId) Allows downloading plugin updates from Spigot.- Parameters:
resourceId- the Spigot resource ID
-
checkPluginUpdate
public void checkPluginUpdate()Checks for plugin updates in the background. -
convertDataStorage
Converts data from one storage type to another.- Parameters:
from- the source storage typeto- the target storage type
-
debug
Logs a debug message at the specified debug level.- Parameters:
debugLevel- the debug leveldebug- the debug message
-
debug
Show exception in console if debug is on- Parameters:
e- Exception
-
debug
Logs a debug message at INFO level.- Parameters:
debug- the debug message
-
devDebug
Logs a debug message at DEV level.- Parameters:
debug- the debug message
-
extraDebug
Logs a debug message at EXTRA level.- Parameters:
debug- the debug message
-
getSQLiteUserTable
Gets the SQLite user table.- Returns:
- the user table, or null if not using SQLite
-
getStorageType
Gets the current storage type configuration.- Returns:
- the storage type
-
getUserManager
Gets the user manager instance.- Returns:
- the user manager
-
isMySQLOkay
public boolean isMySQLOkay()Checks if MySQL connection is okay.- Returns:
- true if not using MySQL or if MySQL is connected, false otherwise
-
loadAdvancedCoreEvents
public void loadAdvancedCoreEvents()Loads AdvancedCore event listeners. -
loadHook
public void loadHook()Load AdvancedCore hook -
loadTabComplete
public void loadTabComplete()Loads tab completion options. -
loadUserAPI
Loads user API for specified storage type.- Parameters:
storageType- the storage type to load
-
loadVault
public void loadVault()Loads Vault integration. -
onDisable
public void onDisable()- Specified by:
onDisablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onDisablein classorg.bukkit.plugin.java.JavaPlugin
-
onEnable
public void onEnable()- Specified by:
onEnablein interfaceorg.bukkit.plugin.Plugin- Overrides:
onEnablein classorg.bukkit.plugin.java.JavaPlugin
-
onPostLoad
public abstract void onPostLoad()Called after plugin loads. Subclasses must implement this method. -
onPreLoad
public abstract void onPreLoad()Called before plugin loads. Subclasses must implement this method. -
onUnLoad
public abstract void onUnLoad()Called when plugin unloads. Subclasses must implement this method. -
registerBungeeChannels
Registers BungeeCord messaging channels.- Parameters:
name- the channel name
-
registerEvents
public void registerEvents(org.bukkit.event.Listener listener) Registers a listener.- Parameters:
listener- the listener to register
-
reload
public abstract void reload()Reloads plugin configuration. Subclasses must implement this method. -
reloadAdvancedCore
Deprecated.usereloadAdvancedCore(boolean)insteadReloads AdvancedCore configuration. -
reloadAdvancedCore
public void reloadAdvancedCore(boolean userStorage) Reloads AdvancedCore configuration.- Parameters:
userStorage- whether to reload user storage
-
setConfigData
Deprecated.- Parameters:
configData- the configData to set
-
setConfigData
public void setConfigData(com.bencodez.simpleapi.file.YMLConfig ymlConfig) Sets configuration data.- Parameters:
ymlConfig- the configuration to set
-
setMysql
Sets the MySQL database connection.- Parameters:
mysql- the mysql connection to set
-
userStartup
public void userStartup()Runs user startup tasks.
-
reloadAdvancedCore(boolean)instead