Class ScalaPluginClassLoader
java.lang.Object
java.lang.ClassLoader
java.security.SecureClassLoader
java.net.URLClassLoader
io.papermc.paper.plugin.entrypoint.classloader.PaperSimplePluginClassLoader
io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
xyz.janboerman.scalaloader.paper.plugin.ScalaPluginClassLoader
- All Implemented Interfaces:
io.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader,Closeable,AutoCloseable,IScalaPluginClassLoader
public class ScalaPluginClassLoader
extends io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
implements IScalaPluginClassLoader
-
Field Summary
Fields inherited from class io.papermc.paper.plugin.entrypoint.classloader.PaperSimplePluginClassLoader
configuration, jar, jarManifest, jarUrl, source -
Constructor Summary
ConstructorsConstructorDescriptionScalaPluginClassLoader(Logger logger, File pluginJarFile, ScalaPluginMeta configuration, ClassLoader parent, URLClassLoader libraryLoader, ScalaPluginLoader pluginLoader, Map<String, Object> pluginYaml, TransformerRegistry transformerRegistry, Path dataDirectory) -
Method Summary
Modifier and TypeMethodDescriptionvoidDeprecated.Class<?> Get the bukkit api version.Get the name of the main class of the plugin.getOrDefineClass(String className, ClassGenerator classGenerator, boolean persist) Gets or defines a class using this ClassLoader.Get the ScalaPlugin instance loaded by this ClassLoader.Get the jar file of the ScalaPlugin.Get the PluginLoader that constructed this ClassLoader.Get the Server the associated plugin runs on.voidinit(JavaPlugin plugin) Methods inherited from class io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
close, getGroup, getResource, getResources, loadClass, loadClass, refreshClassloaderDependencyTree, toStringMethods inherited from class java.net.URLClassLoader
definePackage, 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, getSystemClassLoader, getSystemResource, getSystemResourceAsStream, getSystemResources, getUnnamedModule, isRegisteredAsParallelCapable, loadClass, registerAsParallelCapable, resolveClass, resources, setClassAssertionStatus, setDefaultAssertionStatus, setPackageAssertionStatus, setSigners
-
Constructor Details
-
ScalaPluginClassLoader
public ScalaPluginClassLoader(Logger logger, File pluginJarFile, ScalaPluginMeta configuration, ClassLoader parent, URLClassLoader libraryLoader, ScalaPluginLoader pluginLoader, Map<String, Object> pluginYaml, TransformerRegistry transformerRegistry, Path dataDirectory) throws IOException- Throws:
IOException
-
-
Method Details
-
init
- Specified by:
initin interfaceio.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader- Overrides:
initin classio.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
-
getPluginJarFile
Description copied from interface:IScalaPluginClassLoaderGet the jar file of the ScalaPlugin.- Specified by:
getPluginJarFilein interfaceIScalaPluginClassLoader- Returns:
- the jar file
-
getConfiguration
- Specified by:
getConfigurationin interfaceio.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader- Overrides:
getConfigurationin classio.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
-
getMainClassName
Description copied from interface:IScalaPluginClassLoaderGet the name of the main class of the plugin.- Specified by:
getMainClassNamein interfaceIScalaPluginClassLoader- Returns:
- the main class name
-
getApiVersion
Description copied from interface:IScalaPluginClassLoaderGet the bukkit api version.- Specified by:
getApiVersionin interfaceIScalaPluginClassLoader- Returns:
- the bukkit api version
-
getScalaVersion
-
getExtraPluginYaml
-
getDataDirectory
-
getServer
Description copied from interface:IScalaPluginClassLoaderGet the Server the associated plugin runs on.- Specified by:
getServerin interfaceIScalaPluginClassLoader- Returns:
- the server
-
getPlugin
Description copied from interface:IScalaPluginClassLoaderGet the ScalaPlugin instance loaded by this ClassLoader.- Specified by:
getPluginin interfaceio.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader- Specified by:
getPluginin interfaceIScalaPluginClassLoader- Overrides:
getPluginin classio.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader- Returns:
- the ScalaPlugin
-
getPluginLoader
Description copied from interface:IScalaPluginClassLoaderGet the PluginLoader that constructed this ClassLoader.- Specified by:
getPluginLoaderin interfaceIScalaPluginClassLoader- Returns:
- the PluginLoader.
-
findClass
- Overrides:
findClassin classio.papermc.paper.plugin.entrypoint.classloader.PaperSimplePluginClassLoader- Throws:
ClassNotFoundException
-
getOrDefineClass
public ClassDefineResult getOrDefineClass(String className, ClassGenerator classGenerator, boolean persist) Description copied from interface:IScalaPluginClassLoaderGets or defines a class using this ClassLoader.- Specified by:
getOrDefineClassin interfaceIScalaPluginClassLoader- Parameters:
className- the name of the classclassGenerator- the generator of the class' bytecodepersist- whether this class should be loaded again by the plugin after a server restart- Returns:
- the ClassDefineResult.
-
addURL
Deprecated.- Overrides:
addURLin classURLClassLoader
-