08-05-2013, 12:30 AM
It seems that the basic line tracing works now. I'd like to export it to Lua for the plugins to use, but am still not sure on the interface.
The best candidate so far is the approach taken by LuaExpat: the Trace() function would take the callbacks wrapped as a table of named functions, so it would look something like this:
The best candidate so far is the approach taken by LuaExpat: the Trace() function would take the callbacks wrapped as a table of named functions, so it would look something like this:
local Callbacks = { OnNextBlock = function(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta) -- handle the block return false; end OnNoMoreHits = function() -- handle the end of tracing end OnNoChunk = function() -- handle out-of-loaded-chunks end } ; cLineBlockTracer.Trace(World, Callbacks, StartX, StartY, StartZ, EndX, EndY, EndZ);What do you think?