接口 PluginLoader
- 所有已知实现类:
JavaPluginLoader
public interface PluginLoader
Represents a plugin loader, which handles direct access to specific types
of plugins
-
方法概要
修饰符和类型方法说明Map<Class<? extends Event>,
Set<RegisteredListener>> createRegisteredListeners
(Listener listener, Plugin plugin) Creates and returns registered listeners for the event classes used in this listenervoid
disablePlugin
(Plugin plugin) Disables the specified pluginvoid
enablePlugin
(Plugin plugin) Enables the specified plugingetPluginDescription
(File file) Loads a PluginDescriptionFile from the specified filePattern[]
Returns a list of all filename filters expected by this PluginLoaderloadPlugin
(File file) Loads the plugin contained in the specified file
-
方法详细资料
-
loadPlugin
Loads the plugin contained in the specified file- 参数:
file
- File to attempt to load- 返回:
- Plugin that was contained in the specified file, or null if unsuccessful
- 抛出:
InvalidPluginException
- Thrown when the specified file is not a pluginUnknownDependencyException
- If a required dependency could not be found
-
getPluginDescription
Loads a PluginDescriptionFile from the specified file- 参数:
file
- File to attempt to load from- 返回:
- A new PluginDescriptionFile loaded from the plugin.yml in the specified file
- 抛出:
InvalidDescriptionException
- If the plugin description file could not be created
-
getPluginFileFilters
Pattern[] getPluginFileFilters()Returns a list of all filename filters expected by this PluginLoader- 返回:
- The filters
-
createRegisteredListeners
Map<Class<? extends Event>,Set<RegisteredListener>> createRegisteredListeners(Listener listener, Plugin plugin) Creates and returns registered listeners for the event classes used in this listener- 参数:
listener
- The object that will handle the eventual call backplugin
- The plugin to use when creating registered listeners- 返回:
- The registered listeners.
-
enablePlugin
Enables the specified pluginAttempting to enable a plugin that is already enabled will have no effect
- 参数:
plugin
- Plugin to enable
-
disablePlugin
Disables the specified pluginAttempting to disable a plugin that is not enabled will have no effect
- 参数:
plugin
- Plugin to disable
-