diamonddevv / luafy

lua scripting language in minecraft datapacks
Creative Commons Zero v1.0 Universal
5 stars 2 forks source link

Add command execution batching #8

Open MulverineX opened 1 month ago

MulverineX commented 1 month ago

Allow us to construct an ordered list of pre-parsed command references and submit it through the Luafy API to be executed either globally or as/at an entity or entity group, with a callback from Luafy when the commands have been executed.

This would allow for more efficient scripts, because language-barrier communication frequency would be reduced, and waiting for commands to be executed wouldn't hault the main script thread.

Stretch goal: allow return commands that are executed within this context to work

In the future this could be extended to work for all Luafy API actions, where a script would batch a bunch of one-way (no response) API calls in a serialized form, to be then iterated through and executed in Java.