Require extensions to be namespaced #14

Merged
owlsys merged 2 commits from TheKodeToad/extension-namespace into main 2024-09-02 12:08:59 -04:00
Owner
No description provided.
kode added 1 commit 2024-09-01 09:14:45 -04:00
Author
Owner

I changed handleReference to not create an instance for method reference as IMO it's confusing and you can just use implements

I changed handleReference to not create an instance for method reference as IMO it's confusing and you can just use implements
owlsys reviewed 2024-09-02 10:30:26 -04:00
@ -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]++;
Owner

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)

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)
Author
Owner

I think it is still needed as it is a callback to runIfPresent

I think it is still needed as it is a callback to runIfPresent
Owner

I tried to look for other usages already but it's fairly possible I missed something in the diff view.

I tried to look for other usages already but it's fairly possible I missed something in the diff view.
owlsys marked this conversation as resolved
@ -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 {
Owner

the exception should probably be handled inside the loop to just skip the faulty mod instead of breaking and propagating the error upwards

the exception should probably be handled inside the loop to just skip the faulty mod instead of breaking and propagating the error upwards
Author
Owner

If a mod wants to handle an error without crashing, shouldn't it have a try catch block in its prelaunch handler?

If a mod wants to handle an error without crashing, shouldn't it have a try catch block in its prelaunch handler?
Owner

it may still be okay like this considering mod devs should definitely know when their stuff is malformed or throwing errors

it may still be okay like this considering mod devs should definitely know when their stuff is malformed or throwing errors
owlsys marked this conversation as resolved
owlsys approved these changes 2024-09-02 12:06:54 -04:00
kode added 1 commit 2024-09-02 12:08:15 -04:00
owlsys merged commit bc520da577 into main 2024-09-02 12:08:59 -04:00
owlsys deleted branch TheKodeToad/extension-namespace 2024-09-02 12:09:28 -04:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: frogmc/FrogLoader#14
No description provided.