Package org.bukkit.plugin

# Interface PluginLoader

All Known Implementing Classes:
  `JavaPluginLoader`

@Deprecated(forRemoval=true) public interface PluginLoader
Deprecated, for removal: This API element is subject to removal in a future version.
Represents a plugin loader, which handles direct access to specific types of plugins

## Method Summary

Modifier and Type
Method
Description
`@NotNull Map<Class<? extends Event>,Set<RegisteredListener>>`
`createRegisteredListeners(@NotNull Listener listener, @NotNull Plugin plugin)`
Deprecated, for removal: This API element is subject to removal in a future version.
Creates and returns registered listeners for the event classes used in this listener
`void`
`disablePlugin(@NotNull Plugin plugin)`
Deprecated, for removal: This API element is subject to removal in a future version.
Disables the specified plugin
`default void`
`disablePlugin(@NotNull Plugin plugin, boolean closeClassloader)`
Deprecated, for removal: This API element is subject to removal in a future version.
Classloader is always closed by upstream now.
`void`
`enablePlugin(@NotNull Plugin plugin)`
Deprecated, for removal: This API element is subject to removal in a future version.
Enables the specified plugin
`@NotNull PluginDescriptionFile`
`getPluginDescription(@NotNull File file)`
Deprecated, for removal: This API element is subject to removal in a future version.
Loads a PluginDescriptionFile from the specified file
`@NotNull Pattern[]`
`getPluginFileFilters()`
Deprecated, for removal: This API element is subject to removal in a future version.
Returns a list of all filename filters expected by this PluginLoader
`@NotNull Plugin`
`loadPlugin(@NotNull File file)`
Deprecated, for removal: This API element is subject to removal in a future version.
Loads the plugin contained in the specified file

## Method Details

### loadPlugin

@NotNull @NotNull Plugin loadPlugin(@NotNull @NotNull File file) throws InvalidPluginException, UnknownDependencyException
Deprecated, for removal: This API element is subject to removal in a future version.
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 plugin
  `UnknownDependencyException` - If a required dependency could not be found

### getPluginDescription

@NotNull @NotNull PluginDescriptionFile getPluginDescription(@NotNull @NotNull File file) throws InvalidDescriptionException
Deprecated, for removal: This API element is subject to removal in a future version.
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

@NotNull @NotNull Pattern[] getPluginFileFilters()
Deprecated, for removal: This API element is subject to removal in a future version.
Returns a list of all filename filters expected by this PluginLoader

Returns:
  The filters

### createRegisteredListeners

@NotNull @NotNull Map<Class<? extends Event>,Set<RegisteredListener>> createRegisteredListeners(@NotNull @NotNull Listener listener, @NotNull @NotNull Plugin plugin)
Deprecated, for removal: This API element is subject to removal in a future version.
Creates and returns registered listeners for the event classes used in this listener

Parameters:
  `listener` - The object that will handle the eventual call back
  `plugin` - The plugin to use when creating registered listeners
Returns:
  The registered listeners.

### enablePlugin

void enablePlugin(@NotNull @NotNull Plugin plugin)
Deprecated, for removal: This API element is subject to removal in a future version.
Enables the specified plugin

Attempting to enable a plugin that is already enabled will have no effect

Parameters:
  `plugin` - Plugin to enable

### disablePlugin

void disablePlugin(@NotNull @NotNull Plugin plugin)
Deprecated, for removal: This API element is subject to removal in a future version.
Disables the specified plugin

Attempting to disable a plugin that is not enabled will have no effect

Parameters:
  `plugin` - Plugin to disable

### disablePlugin

@Deprecated(forRemoval=true) default void disablePlugin(@NotNull @NotNull Plugin plugin, boolean closeClassloader)
Deprecated, for removal: This API element is subject to removal in a future version.
Classloader is always closed by upstream now.
This method is no longer useful as upstream has made it so plugin classloaders are always closed on disable. Use `disablePlugin(Plugin)` instead.

Parameters:
  `plugin` - Plugin to disable
  `closeClassloader` - unused