The goal would be to do the least modification possible. For instance, cuberite continues to generate worlds and calculate projectiles the way it does now, the difference would be it now exposes those events to luaJIT, which would then “translate” and send these events.
This way, multiple luaJIT vms, light threads or whatever can run simultaneously, serving different protocols, without affecting each other.
Another example: Protocol1_8.lua has a table whitelisting which blocks it “knows” about, any other block_id gets converted to, let’s say 1, before sending the update to the client that is connected to this protocol.
Yeah, there needs to be some kind of routing code so each client gets the right treatment. I think ProtocolSupport (spigot) has implemented something like that.
This way, multiple luaJIT vms, light threads or whatever can run simultaneously, serving different protocols, without affecting each other.
Another example: Protocol1_8.lua has a table whitelisting which blocks it “knows” about, any other block_id gets converted to, let’s say 1, before sending the update to the client that is connected to this protocol.
Yeah, there needs to be some kind of routing code so each client gets the right treatment. I think ProtocolSupport (spigot) has implemented something like that.