fix null values in the provider map
All checks were successful
Publish to snapshot maven / build (push) Successful in 30s

This commit is contained in:
moehreag 2024-06-17 18:29:18 +02:00
parent 511eb0c8b0
commit 0165161a9c
3 changed files with 3 additions and 7 deletions

View file

@ -7,7 +7,7 @@ plugins {
} }
group = "dev.frogmc" group = "dev.frogmc"
version = "0.0.1-alpha.6" version = "0.0.1-alpha.7"
repositories { repositories {
maven { maven {

View file

@ -78,11 +78,7 @@ public class FrogLoaderImpl implements FrogLoader {
modIds = collectModIds(); modIds = collectModIds();
LOGGER.info(ModUtil.getModList(getMods())); LOGGER.info(ModUtil.getModList(getMods()));
LOGGER.info("Launching..."); LOGGER.info("Launching...");
modProviders.forEach(plugin -> { modProviders.forEach(plugin -> plugin.preLaunch(mods.get(plugin.id()).values()));
if (mods.get(plugin.id()) != null) { // we don't like NPEs
plugin.preLaunch(mods.get(plugin.id()).values());
}
});
gamePlugin.run(); gamePlugin.run();
} catch (Throwable t) { } catch (Throwable t) {
LoaderGui.execReport(CrashReportGenerator.writeReport(t, getMods()), false); LoaderGui.execReport(CrashReportGenerator.writeReport(t, getMods()), false);

View file

@ -47,6 +47,7 @@ public class PluginLoader {
providers.add(provider); providers.add(provider);
size[0]++; size[0]++;
})); }));
modProviders.add(plugin);
} catch (Throwable e) { } catch (Throwable e) {
LOGGER.error("Error during plugin initialisation: ", e); LOGGER.error("Error during plugin initialisation: ", e);
} }
@ -61,7 +62,6 @@ public class PluginLoader {
c.forEach(p -> map.put(p.id(), p)); c.forEach(p -> map.put(p.id(), p));
}); });
modIds.addAll(solved.stream().map(ModProperties::id).toList()); modIds.addAll(solved.stream().map(ModProperties::id).toList());
modProviders.addAll(providers);
} catch (ModDependencyResolver.UnfulfilledDependencyException e) { } catch (ModDependencyResolver.UnfulfilledDependencyException e) {
LoaderGui.execUnfulfilledDep(CrashReportGenerator.writeReport(e, flattened), e, false); LoaderGui.execUnfulfilledDep(CrashReportGenerator.writeReport(e, flattened), e, false);
} catch (ModDependencyResolver.BreakingModException e) { } catch (ModDependencyResolver.BreakingModException e) {