Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
ziqian zhang
Grasscutter
Commits
84c1cd7a
Commit
84c1cd7a
authored
May 07, 2022
by
Magix
Committed by
GitHub
May 07, 2022
Browse files
Update PluginManager.java
parent
f8bc471d
Changes
1
Show whitespace changes
Inline
Side-by-side
src/main/java/emu/grasscutter/plugin/PluginManager.java
View file @
84c1cd7a
...
@@ -52,8 +52,8 @@ public final class PluginManager {
...
@@ -52,8 +52,8 @@ public final class PluginManager {
plugins
.
forEach
(
plugin
->
{
plugins
.
forEach
(
plugin
->
{
try
{
try
{
pluginNames
[
plugins
.
indexOf
(
plugin
)]
=
plugin
.
toURI
().
toURL
();
pluginNames
[
plugins
.
indexOf
(
plugin
)]
=
plugin
.
toURI
().
toURL
();
}
catch
(
MalformedURLException
e
)
{
}
catch
(
MalformedURLException
e
xception
)
{
e
.
printStackTrace
(
);
Grasscutter
.
getLogger
().
warn
(
"Unable to load plugin."
,
exception
);
}
}
});
});
...
@@ -79,7 +79,7 @@ public final class PluginManager {
...
@@ -79,7 +79,7 @@ public final class PluginManager {
JarEntry
entry
=
entries
.
nextElement
();
JarEntry
entry
=
entries
.
nextElement
();
if
(
entry
.
isDirectory
()
||
!
entry
.
getName
().
endsWith
(
".class"
)
||
entry
.
getName
().
contains
(
"module-info"
))
continue
;
if
(
entry
.
isDirectory
()
||
!
entry
.
getName
().
endsWith
(
".class"
)
||
entry
.
getName
().
contains
(
"module-info"
))
continue
;
String
className
=
entry
.
getName
().
replace
(
".class"
,
""
).
replace
(
"/"
,
"."
);
String
className
=
entry
.
getName
().
replace
(
".class"
,
""
).
replace
(
"/"
,
"."
);
classLoader
.
loadClass
(
className
);
//
For all plugin we u
se the same class loader.
classLoader
.
loadClass
(
className
);
//
U
se the same class loader
for ALL plugins
.
}
}
Class
<?>
pluginClass
=
classLoader
.
loadClass
(
pluginConfig
.
mainClass
);
Class
<?>
pluginClass
=
classLoader
.
loadClass
(
pluginConfig
.
mainClass
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment