How will calling of events etc work in the implementation?

I completely understand how Sponge is using Mixins to edit the Vanilla code to add their own features.

This is really easy for code going from API to Vanilla. All you have to do is convert any elements to their vanilla components (if that is even needed).

What I don’t get is how code going the other way will be handled. Bukkit and such had it easy - they could simply add a line to the Vanilla code and that was it. The event or other internal code would be called. How will this work with the mixin setup?

Will Sponge have to duplicate the code in a function they want to add code to? Or will there be more complex measures, such as inserting individual lines, to achieve this?

It appears that ASM will be used to insert the calls.

There’s an @Inject annotation which is used to add code in specific places in a target method in a mixin.

1 Like

Oh, nice! Thanks for that, should have done a bit more reading.