Skip to content

Commit

Permalink
Update PluginManager.java
Browse files Browse the repository at this point in the history
  • Loading branch information
KingRainbow44 committed May 7, 2022
1 parent 5cc9ecf commit f133a8b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/emu/grasscutter/plugin/PluginManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ private void loadPlugins() {
plugins.forEach(plugin -> {
try {
pluginNames[plugins.indexOf(plugin)] = plugin.toURI().toURL();
} catch (MalformedURLException e) {
e.printStackTrace();
} catch (MalformedURLException exception) {
Grasscutter.getLogger().warn("Unable to load plugin.", exception);
}
});

Expand All @@ -79,7 +79,7 @@ private void loadPlugins() {
JarEntry entry = entries.nextElement();
if(entry.isDirectory() || !entry.getName().endsWith(".class") || entry.getName().contains("module-info")) continue;
String className = entry.getName().replace(".class", "").replace("/", ".");
classLoader.loadClass(className); //For all plugin we use the same class loader.
classLoader.loadClass(className); // Use the same class loader for ALL plugins.
}

Class<?> pluginClass = classLoader.loadClass(pluginConfig.mainClass);
Expand Down Expand Up @@ -182,4 +182,4 @@ private <T extends Event> void invokeHandler(Event event, EventHandler<T> handle
(event.isCanceled() && handler.ignoresCanceled())
) handler.getCallback().consume((T) event);
}
}
}

0 comments on commit f133a8b

Please sign in to comment.