You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Every time a change is made in Amethyst’s function parameters all mods break. While the community is small for now, hopefully it wont be in the future. If this is the case, it would be best to reduce future technical debt whenever we make a change to parameters so that mod developers don’t have to constantly make changes.
To go even further
Additionally, I personally think having so many extern "C" __declspec(dllexport) at the beginning of functions is a bit ugly. Perhaps we could allow people to register it themselves.
For example we could make recreate something similar to the C# delegate pattern (not sure if that is something C++ will allow, I haven’t really looked into it) or just continue with the observer pattern we currently have.
I agree with eventually trying to move a system that is more type-safe for mod function parameters, although I don't know exactly how I would want to do that.
I think the problem with the system proposed above is that now amethyst kind of has two stages before and after debugger, the RegisterInputs mod function is called before a debugger is able to be attached to the game.
Because we can't attach a debugger (because it's too slow), it could make developing using that approach hard to debug. We could also split this into two, but I'd rather have one consistent pattern then having two different ones
The extern "C" __declspec(dllexport) can be shortened down using a macro like #define ModFunction extern "C" __declspec(dllexport). Which results in being able to do the following syntax ModFunction void RegisterInputs()
I'm going to close this issue for now, I think this is something we are going to come back to in the future when amethyst starts to store more of the Minecraft state
About
Pass down an AmethystRuntime instance or some other "Manager" to the Initialize() function.
Why?
Every time a change is made in Amethyst’s function parameters all mods break. While the community is small for now, hopefully it wont be in the future. If this is the case, it would be best to reduce future technical debt whenever we make a change to parameters so that mod developers don’t have to constantly make changes.
To go even further
Additionally, I personally think having so many
extern "C" __declspec(dllexport)
at the beginning of functions is a bit ugly. Perhaps we could allow people to register it themselves.For example we could make recreate something similar to the C# delegate pattern (not sure if that is something C++ will allow, I haven’t really looked into it) or just continue with the observer pattern we currently have.
Post Scriptum
Btw this was written on mobile so forgive any typos (and I didn’t proof read this)
The text was updated successfully, but these errors were encountered: