Package org.bukkit.plugin.java
Class JavaPluginLoader
java.lang.Object
org.bukkit.plugin.java.JavaPluginLoader
- All Implemented Interfaces:
PluginLoader
public final class JavaPluginLoader extends Object implements PluginLoader
Represents a Java plugin loader, allowing plugins in the form of .jar
-
Field Summary
Fields Modifier and Type Field Description static CustomTimingsHandler
pluginParentTimer
-
Constructor Summary
Constructors Constructor Description JavaPluginLoader(Server instance)
Deprecated. -
Method Summary
Modifier and Type Method Description 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 pluginPluginDescriptionFile
getPluginDescription(File file)
Loads a PluginDescriptionFile from the specified filePattern[]
getPluginFileFilters()
Returns a list of all filename filters expected by this PluginLoaderPlugin
loadPlugin(File file)
Loads the plugin contained in the specified file
-
Field Details
-
Constructor Details
-
JavaPluginLoader
Deprecated.This class was not meant to be constructed explicitly- Parameters:
instance
- the server instance
-
-
Method Details
-
loadPlugin
Description copied from interface:PluginLoader
Loads the plugin contained in the specified file- Specified by:
loadPlugin
in interfacePluginLoader
- 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
-
getPluginDescription
@NotNull public PluginDescriptionFile getPluginDescription(@NotNull File file) throws InvalidDescriptionExceptionDescription copied from interface:PluginLoader
Loads a PluginDescriptionFile from the specified file- Specified by:
getPluginDescription
in interfacePluginLoader
- 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
Description copied from interface:PluginLoader
Returns a list of all filename filters expected by this PluginLoader- Specified by:
getPluginFileFilters
in interfacePluginLoader
- Returns:
- The filters
-
createRegisteredListeners
@NotNull public Map<Class<? extends Event>,Set<RegisteredListener>> createRegisteredListeners(@NotNull Listener listener, @NotNull Plugin plugin)Description copied from interface:PluginLoader
Creates and returns registered listeners for the event classes used in this listener- Specified by:
createRegisteredListeners
in interfacePluginLoader
- Parameters:
listener
- The object that will handle the eventual call backplugin
- The plugin to use when creating registered listeners- Returns:
- The registered listeners.
-
enablePlugin
Description copied from interface:PluginLoader
Enables the specified pluginAttempting to enable a plugin that is already enabled will have no effect
- Specified by:
enablePlugin
in interfacePluginLoader
- Parameters:
plugin
- Plugin to enable
-
disablePlugin
Description copied from interface:PluginLoader
Disables the specified pluginAttempting to disable a plugin that is not enabled will have no effect
- Specified by:
disablePlugin
in interfacePluginLoader
- Parameters:
plugin
- Plugin to disable
-