Package net.mcreator.plugin
Class PluginLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
net.mcreator.plugin.PluginLoader
- All Implemented Interfaces:
Closeable,AutoCloseable
This class detects and then try to load all builtin or custom Plugins.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Collection<JavaPlugin> getResources(String pkg, Pattern pattern) getResources(Pattern pattern) static voidSet the value to the INSTANCE variable, so we can access values everywhere in the code.Methods inherited from class java.net.URLClassLoader
addURL, close, definePackage, findClass, findResource, findResources, getPermissions, getResourceAsStream, getURLs, newInstance, newInstanceMethods inherited from class java.security.SecureClassLoader
defineClass, defineClassMethods inherited from class java.lang.ClassLoader
clearAssertionStatus, defineClass, defineClass, defineClass, defineClass, definePackage, findClass, findLibrary, findLoadedClass, findResource, findSystemClass, getClassLoadingLock, getDefinedPackage, getDefinedPackages, getName, getPackage, getPackages, getParent, getPlatformClassLoader, getResource, getResources, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
PluginLoader
public PluginLoader()The core of the detection and loading
-
-
Method Details
-
initInstance
public static void initInstance()Set the value to the INSTANCE variable, so we can access values everywhere in the code.
-
getResources
-
getResourcesInPackage
- Parameters:
pkg-The path of directories the method will use to access wanted files. Sub folders need to be split with a dot.
- Returns:
The path into a
Pluginof all files inside the provided folder.
-
getResources
-
getPlugins
- Returns:
A
Listof all loaded plugins. Sorted by plugin weight.
-
getJavaPlugins
- Returns:
A
Listof all loaded Java plugins. Sorted by plugin weight.
-
getPluginUpdates
- Returns:
A list of all plugin updates detected.
-
getPluginModules
- Returns:
A list of all plugin modules.
-
getFailedPlugins
-