File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
LavalinkServer/src/main/java/lavalink/server Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -143,7 +143,7 @@ object Launcher {
143
143
.properties(properties)
144
144
.web(WebApplicationType .SERVLET )
145
145
.bannerMode(Banner .Mode .OFF )
146
- .resourceLoader(DefaultResourceLoader (pluginManager:: class .java .classLoader))
146
+ .resourceLoader(DefaultResourceLoader (pluginManager.classLoader))
147
147
.listeners(
148
148
ApplicationListener { event: Any ->
149
149
when (event) {
Original file line number Diff line number Diff line change @@ -21,12 +21,17 @@ class PluginManager(val config: PluginsConfig) {
21
21
22
22
final val pluginManifests: MutableList <PluginManifest > = mutableListOf ()
23
23
24
+ var classLoader = javaClass.classLoader
25
+
24
26
init {
25
27
manageDownloads()
28
+
26
29
pluginManifests.apply {
27
30
addAll(readClasspathManifests())
28
31
addAll(loadJars())
29
32
}
33
+
34
+ println (pluginManifests)
30
35
}
31
36
32
37
private fun manageDownloads () {
@@ -104,12 +109,12 @@ class PluginManager(val config: PluginsConfig) {
104
109
?.takeIf { it.isNotEmpty() }
105
110
? : return emptyList()
106
111
107
- val classLoader = URLClassLoader .newInstance(
112
+ classLoader = URLClassLoader .newInstance(
108
113
jarsToLoad.map { URL (" jar:file:${it.absolutePath} !/" ) }.toTypedArray(),
109
114
javaClass.classLoader
110
115
)
111
116
112
- return jarsToLoad.flatMap { loadJar(it, classLoader) }
117
+ return jarsToLoad.flatMap { loadJar(it, classLoader as URLClassLoader ) }
113
118
}
114
119
115
120
private fun loadJar (file : File , cl : URLClassLoader ): List <PluginManifest > {
You can’t perform that action at this time.
0 commit comments