Package org.bukkit.plugin
Interface PluginLoader
- All Known Implementing Classes:
JavaPluginLoader
public interface PluginLoader
Represents a plugin loader, which handles direct access to specific types
of plugins
-
Method Summary
Modifier and Type Method Description java.util.Map<java.lang.Class<? extends Event>,java.util.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 pluginPluginDescriptionFile
getPluginDescription(java.io.File file)
Loads a PluginDescriptionFile from the specified filejava.util.regex.Pattern[]
getPluginFileFilters()
Returns a list of all filename filters expected by this PluginLoaderPlugin
loadPlugin(java.io.File file)
Loads the plugin contained in the specified file
-
Method Details
-
loadPlugin
Loads the plugin contained in the specified file- Parameters:
file
- File to attempt to load- Returns:
- Plugin that was contained in the specified file, or null if unsuccessful
- Throws:
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- Parameters:
file
- File to attempt to load from- Returns:
- A new PluginDescriptionFile loaded from the plugin.yml in the specified file
- Throws:
InvalidDescriptionException
- If the plugin description file could not be created
-
getPluginFileFilters
java.util.regex.Pattern[] getPluginFileFilters()Returns a list of all filename filters expected by this PluginLoader- Returns:
- The filters
-
createRegisteredListeners
java.util.Map<java.lang.Class<? extends Event>,java.util.Set<RegisteredListener>> createRegisteredListeners(Listener listener, Plugin plugin)Creates and returns registered listeners for the event classes used in this listener- Parameters:
listener
- The object that will handle the eventual call backplugin
- The plugin to use when creating registered listeners- Returns:
- The registered listeners.
-
enablePlugin
Enables the specified pluginAttempting to enable a plugin that is already enabled will have no effect
- Parameters:
plugin
- Plugin to enable
-
disablePlugin
Disables the specified pluginAttempting to disable a plugin that is not enabled will have no effect
- Parameters:
plugin
- Plugin to disable
-