mworzala / canary

4 stars 1 forks source link

Detect extension.json automatically on start #3

Open mworzala opened 3 years ago

mworzala commented 3 years ago

We have the source project resources so we can load the file named extension.json and locate the extension main. The trickier part here is making the ExtensionManager load it (perhaps will require a mixin).

The alternative is to use the system arguments: minestom.extension.indevfolder.classes minestom.extension.indevfolder.resources These require us to specify the location of those, which are build config dependent (however we may be able to get them from gradle, in which case this is probably acceptable)

mworzala commented 2 years ago

This can be done by checking the classpath for extension.json (since the extension classpath will be added) or assuming its a server otherwise. In Minestom/Minestom#529 we will be able to load that directly using the "autoscan" mechanic.