Class BasePlugin
java.lang.Object
org.bukkit.plugin.PluginBase
org.bukkit.plugin.java.JavaPlugin
io.github.projectunified.minelib.plugin.base.BasePlugin
- All Implemented Interfaces:
Loadable
,io.papermc.paper.plugin.lifecycle.event.LifecycleEventOwner
,org.bukkit.command.CommandExecutor
,org.bukkit.command.TabCompleter
,org.bukkit.command.TabExecutor
,org.bukkit.plugin.Plugin
Base plugin class that provides a simple way to manage components
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T> void
Call a consumer for each component of a given type.final <T> void
Call a consumer for each component of a given type.final <T> T
Get a component by its class.Get the components that should be managed by the plugin.final void
final void
onEnable()
final void
onLoad()
Methods inherited from class org.bukkit.plugin.java.JavaPlugin
getClassLoader, getCommand, getConfig, getDataFolder, getDefaultBiomeProvider, getDefaultWorldGenerator, getDescription, getFile, getLifecycleManager, getLogger, getPlugin, getPluginLoader, getPluginMeta, getProvidingPlugin, getResource, getServer, getTextResource, init, init, isEnabled, isNaggable, onCommand, onTabComplete, reloadConfig, saveConfig, saveDefaultConfig, saveResource, setEnabled, setNaggable, toString
Methods inherited from class org.bukkit.plugin.PluginBase
equals, getName, hashCode
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.projectunified.minelib.plugin.base.Loadable
disable, enable, load
Methods inherited from interface org.bukkit.plugin.Plugin
getComponentLogger, getLog4JLogger, getSLF4JLogger
-
Constructor Details
-
BasePlugin
public BasePlugin()Create a new plugin instance
-
-
Method Details
-
getComponents
Get the components that should be managed by the plugin. Plugins should override this method to provide their own components.- Returns:
- a list of components
-
get
Get a component by its class.- Type Parameters:
T
- the type of the component- Parameters:
type
- the class of the component- Returns:
- the component
-
call
Call a consumer for each component of a given type.- Type Parameters:
T
- the type of the component- Parameters:
type
- the class of the componentconsumer
- the consumer to callreverse
- whether to iterate in reverse order
-
call
Call a consumer for each component of a given type.- Type Parameters:
T
- the type of the component- Parameters:
type
- the class of the componentconsumer
- the consumer to call
-
onLoad
public final void onLoad()- Specified by:
onLoad
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onLoad
in classorg.bukkit.plugin.java.JavaPlugin
-
onEnable
public final void onEnable()- Specified by:
onEnable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onEnable
in classorg.bukkit.plugin.java.JavaPlugin
-
onDisable
public final void onDisable()- Specified by:
onDisable
in interfaceorg.bukkit.plugin.Plugin
- Overrides:
onDisable
in classorg.bukkit.plugin.java.JavaPlugin
-