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 Plugin
s.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Collection
<JavaPlugin> getResources
(String pkg, Pattern pattern) getResources
(Pattern pattern) static void
Set 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, newInstance
Methods inherited from class java.security.SecureClassLoader
defineClass, defineClass
Methods 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
Plugin
of all files inside the provided folder.
-
getResources
-
getPlugins
- Returns:
A
List
of all loaded plugins. Sorted by plugin weight.
-
getJavaPlugins
- Returns:
A
List
of 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
-