public class JavaPluginLoader extends Object implements PluginLoader
Constructor and Description |
---|
JavaPluginLoader(Server instance)
Deprecated.
|
Modifier and Type | Method and Description |
---|---|
Map<Class<? extends Event>,Set<RegisteredListener>> |
createRegisteredListeners(Listener listener,
Plugin plugin)
Creates and returns registered listeners for the event classes used in
this listener
|
void |
disablePlugin(Plugin plugin)
Disables the specified plugin
|
void |
disablePlugin(Plugin plugin,
boolean closeClassloader)
Disables the specified plugin
|
void |
enablePlugin(Plugin plugin)
Enables the specified plugin
|
protected Class<?> |
getClassByName(String name) |
PluginDescriptionFile |
getPluginDescription(File file)
Loads a PluginDescriptionFile from the specified file
|
Pattern[] |
getPluginFileFilters()
Returns a list of all filename filters expected by this PluginLoader
|
Plugin |
loadPlugin(File file)
Loads the plugin contained in the specified file
|
protected PluginClassLoader |
newPluginLoader(JavaPluginLoader loader,
ClassLoader parent,
PluginDescriptionFile description,
File dataFolder,
File file) |
@Deprecated public JavaPluginLoader(Server instance)
instance
- the server instancepublic Plugin loadPlugin(File file) throws InvalidPluginException
PluginLoader
loadPlugin
in interface PluginLoader
file
- File to attempt to loadInvalidPluginException
- Thrown when the specified file is not a
pluginprotected PluginClassLoader newPluginLoader(JavaPluginLoader loader, ClassLoader parent, PluginDescriptionFile description, File dataFolder, File file) throws Exception
Exception
public PluginDescriptionFile getPluginDescription(File file) throws InvalidDescriptionException
PluginLoader
getPluginDescription
in interface PluginLoader
file
- File to attempt to load fromInvalidDescriptionException
- If the plugin description file
could not be createdpublic Pattern[] getPluginFileFilters()
PluginLoader
getPluginFileFilters
in interface PluginLoader
public Map<Class<? extends Event>,Set<RegisteredListener>> createRegisteredListeners(Listener listener, Plugin plugin)
PluginLoader
createRegisteredListeners
in interface PluginLoader
listener
- The object that will handle the eventual call backplugin
- The plugin to use when creating registered listenerspublic void enablePlugin(Plugin plugin)
PluginLoader
Attempting to enable a plugin that is already enabled will have no effect
enablePlugin
in interface PluginLoader
plugin
- Plugin to enablepublic void disablePlugin(Plugin plugin)
PluginLoader
Attempting to disable a plugin that is not enabled will have no effect
disablePlugin
in interface PluginLoader
plugin
- Plugin to disablepublic void disablePlugin(Plugin plugin, boolean closeClassloader)
PluginLoader
Attempting to disable a plugin that is not enabled will have no effect
disablePlugin
in interface PluginLoader
plugin
- Plugin to disablecloseClassloader
- if the classloader for the Plugin should be closedCopyright © 2021. All rights reserved.