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