Class endstone::Plugin¶
Represents a Plugin .
- #include <endstone/plugin/plugin.h>
Inherits the following classes: endstone::CommandExecutor
Public Functions¶
| Type | Name | 
|---|---|
| Plugin () = default | |
| Plugin (const Plugin &) = delete | |
| PluginCommand * | getCommand (std::string name) const Gets the command with the given name, specific to this plugin. | 
| const std::filesystem::path & | getDataFolder () const Returns the folder that the plugin data's files are located in. The folder may not yet exist. | 
| virtual const PluginDescription & | getDescription () const = 0 Returns the details of this plugin. | 
| Logger & | getLogger () const Returns the plugin logger associated with this server's logger. The returned logger automatically tags all log messages with the plugin's name. | 
| std::string | getName () const Returns the name of the plugin. | 
| PluginLoader & | getPluginLoader () const Gets the associated PluginLoader responsible for this plugin. | 
| Server & | getServer () const Returns the Server instance currently running this plugin. | 
| bool | isEnabled () const Returns a value indicating whether this plugin is currently enabled. | 
| virtual void | onDisable () Called when this plugin is disabled. | 
| virtual void | onEnable () Called when this plugin is enabled. | 
| virtual void | onLoad () Called after a plugin is loaded but before it has been enabled. | 
| Plugin & | operator= (const Plugin &) = delete | 
| void | registerEvent (void(T::*)(EventType &) func, T & instance, EventPriority priority=EventPriority::Normal, bool ignore_cancelled=false) | 
| void | registerEvent (std::function< void(EventType &)> func, EventPriority priority=EventPriority::Normal, bool ignore_cancelled=false) | 
| ~Plugin () override | 
Public Functions inherited from endstone::CommandExecutor¶
| Type | Name | 
|---|---|
| virtual bool | onCommand (CommandSender & sender, const Command & command, const std::vector< std::string > & args) | 
| virtual | ~CommandExecutor () = default | 
Protected Functions¶
| Type | Name | 
|---|---|
| void | setEnabled (bool enabled) | 
Public Functions Documentation¶
function Plugin [½]¶
function Plugin [2/2]¶
function getCommand¶
Gets the command with the given name, specific to this plugin.
Parameters:
- namename or alias of the command
Returns:
the plugin command if found, otherwise null
function getDataFolder¶
Returns the folder that the plugin data's files are located in. The folder may not yet exist.
Returns:
The folder
function getDescription¶
Returns the details of this plugin.
Returns:
Details of this plugin
function getLogger¶
Returns the plugin logger associated with this server's logger. The returned logger automatically tags all log messages with the plugin's name.
Returns:
Logger associated with this plugin
function getName¶
Returns the name of the plugin.
This should return the bare name of the plugin and should be used for comparison.
Returns:
name of the plugin
function getPluginLoader¶
Gets the associated PluginLoader responsible for this plugin.
Returns:
PluginLoader that controls this plugin
function getServer¶
Returns the Server instance currently running this plugin.
Returns:
Server running this plugin
function isEnabled¶
Returns a value indicating whether this plugin is currently enabled.
Returns:
true if this plugin is enabled, otherwise false
function onDisable¶
Called when this plugin is disabled.
function onEnable¶
Called when this plugin is enabled.
function onLoad¶
Called after a plugin is loaded but before it has been enabled.
When multiple plugins are loaded, the onLoad() for all plugins is called before any onEnable() is called.
function operator=¶
function registerEvent [½]¶
template<typename EventType, typename T>
inline void endstone::Plugin::registerEvent (
    void(T::*)(EventType &) func,
    T & instance,
    EventPriority priority=EventPriority::Normal,
    bool ignore_cancelled=false
) 
function registerEvent [2/2]¶
template<typename EventType>
inline void endstone::Plugin::registerEvent (
    std::function< void(EventType &)> func,
    EventPriority priority=EventPriority::Normal,
    bool ignore_cancelled=false
) 
function ~Plugin¶
Protected Functions Documentation¶
function setEnabled¶
Sets the enabled state of this plugin
Parameters:
- enabledtrue if enabled, otherwise false
Friends Documentation¶
friend EndstonePluginManager¶
The documentation for this class was generated from the following file include/endstone/plugin/plugin.h