mirror of
https://github.com/Grasscutters/Grasscutter.git
synced 2026-04-07 00:12:34 +02:00
Fix whitespace [skip actions]
This commit is contained in:
@@ -72,7 +72,7 @@ public final class PluginManager {
|
||||
List<PluginData> dependencies = new ArrayList<>();
|
||||
|
||||
// Initialize all plugins.
|
||||
for(var plugin : plugins) {
|
||||
for (var plugin : plugins) {
|
||||
try {
|
||||
URL url = plugin.toURI().toURL();
|
||||
try (URLClassLoader loader = new URLClassLoader(new URL[]{url})) {
|
||||
@@ -109,7 +109,7 @@ public final class PluginManager {
|
||||
fileReader.close();
|
||||
|
||||
// Check if the plugin has alternate dependencies.
|
||||
if(pluginConfig.loadAfter != null && pluginConfig.loadAfter.length > 0) {
|
||||
if (pluginConfig.loadAfter != null && pluginConfig.loadAfter.length > 0) {
|
||||
// Add the plugin to a "load later" list.
|
||||
dependencies.add(new PluginData(
|
||||
pluginInstance, PluginIdentifier.fromPluginConfig(pluginConfig),
|
||||
@@ -131,9 +131,9 @@ public final class PluginManager {
|
||||
|
||||
// Load plugins with dependencies.
|
||||
int depth = 0; final int maxDepth = 30;
|
||||
while(!dependencies.isEmpty()) {
|
||||
while (!dependencies.isEmpty()) {
|
||||
// Check if the depth is too high.
|
||||
if(depth >= maxDepth) {
|
||||
if (depth >= maxDepth) {
|
||||
Grasscutter.getLogger().error("Failed to load plugins with dependencies.");
|
||||
break;
|
||||
}
|
||||
@@ -143,7 +143,7 @@ public final class PluginManager {
|
||||
var pluginData = dependencies.get(0);
|
||||
|
||||
// Check if the plugin's dependencies are loaded.
|
||||
if(!this.plugins.keySet().containsAll(List.of(pluginData.getDependencies()))) {
|
||||
if (!this.plugins.keySet().containsAll(List.of(pluginData.getDependencies()))) {
|
||||
depth++; // Increase depth counter.
|
||||
continue; // Continue to next plugin.
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user