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 TypeMethodDescriptionvoid
Deprecated.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.void
init
(JavaPlugin plugin) Methods inherited from class io.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
close, getGroup, getResource, getResources, loadClass, loadClass, refreshClassloaderDependencyTree, toString
Methods inherited from class java.net.URLClassLoader
definePackage, 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, 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:
init
in interfaceio.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader
- Overrides:
init
in classio.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
-
getPluginJarFile
Description copied from interface:IScalaPluginClassLoader
Get the jar file of the ScalaPlugin.- Specified by:
getPluginJarFile
in interfaceIScalaPluginClassLoader
- Returns:
- the jar file
-
getConfiguration
- Specified by:
getConfiguration
in interfaceio.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader
- Overrides:
getConfiguration
in classio.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
-
getMainClassName
Description copied from interface:IScalaPluginClassLoader
Get the name of the main class of the plugin.- Specified by:
getMainClassName
in interfaceIScalaPluginClassLoader
- Returns:
- the main class name
-
getApiVersion
Description copied from interface:IScalaPluginClassLoader
Get the bukkit api version.- Specified by:
getApiVersion
in interfaceIScalaPluginClassLoader
- Returns:
- the bukkit api version
-
getScalaVersion
-
getExtraPluginYaml
-
getDataDirectory
-
getServer
Description copied from interface:IScalaPluginClassLoader
Get the Server the associated plugin runs on.- Specified by:
getServer
in interfaceIScalaPluginClassLoader
- Returns:
- the server
-
getPlugin
Description copied from interface:IScalaPluginClassLoader
Get the ScalaPlugin instance loaded by this ClassLoader.- Specified by:
getPlugin
in interfaceio.papermc.paper.plugin.provider.classloader.ConfiguredPluginClassLoader
- Specified by:
getPlugin
in interfaceIScalaPluginClassLoader
- Overrides:
getPlugin
in classio.papermc.paper.plugin.entrypoint.classloader.PaperPluginClassLoader
- Returns:
- the ScalaPlugin
-
getPluginLoader
Description copied from interface:IScalaPluginClassLoader
Get the PluginLoader that constructed this ClassLoader.- Specified by:
getPluginLoader
in interfaceIScalaPluginClassLoader
- Returns:
- the PluginLoader.
-
findClass
- Overrides:
findClass
in classio.papermc.paper.plugin.entrypoint.classloader.PaperSimplePluginClassLoader
- Throws:
ClassNotFoundException
-
getOrDefineClass
public ClassDefineResult getOrDefineClass(String className, ClassGenerator classGenerator, boolean persist) Description copied from interface:IScalaPluginClassLoader
Gets or defines a class using this ClassLoader.- Specified by:
getOrDefineClass
in 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:
addURL
in classURLClassLoader
-