Require extensions to be namespaced #14
Loading…
Reference in a new issue
No description provided.
Delete branch "TheKodeToad/extension-namespace"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I changed handleReference to not create an instance for method reference as IMO it's confusing and you can just use implements
@ -54,0 +49,4 @@
for (ModProperties p : loadedMods) {
p.extensions().runIfPresent(Constants.MOD_ID, Constants.EXTENSION_MOD_PROVIDER, ModProvider.class, provider -> {
providers.add(provider);
size[0]++;
this single-element array could be replaced with a normal int since it doesn't need to be used anymore (since the lambda was replaced with a loop)
I think it is still needed as it is a callback to runIfPresent
I tried to look for other usages already but it's fairly possible I missed something in the diff view.
@ -137,3 +138,2 @@
@Override
public void preLaunch(Collection<ModProperties> mods) {
mods.forEach(mod -> mod.extensions().runIfPresent(PreLaunchExtension.ID, PreLaunchExtension.class, PreLaunchExtension::onPreLaunch));
public void preLaunch(Collection<ModProperties> mods) throws ModExtensionResolutionException {
the exception should probably be handled inside the loop to just skip the faulty mod instead of breaking and propagating the error upwards
If a mod wants to handle an error without crashing, shouldn't it have a try catch block in its prelaunch handler?
it may still be okay like this considering mod devs should definitely know when their stuff is malformed or throwing errors