04-07-2015, 05:59 AM
(This post was last modified: 04-07-2015, 06:06 AM by DiamondToaster.)
So, something like:
Then the Lua bindings would send table full of these:
class cBlockToEntityData
{
public:
Vector3i Position;
int GetBlockType(); // returns E_BLOCK type
int GetMetaData(); // returns E_META data
cBlockInfo GetBlockInfo(); // returns a cBlockInfo
// Excuse my lack of knowledge of the internals of MCServer...
}
Then the Lua bindings would send table full of these:
function OnExploding(World, ExplosionSize, CanCauseFire, X, Y, Z, Source, SourceData, AffectedBlocks)
-- AffectedBlocks is a table full of cBlockToEntityData
for n, k in pairs(AffectedBlocks) do
if k:GetBlockType() == E_BLOCK_DIRT then
table.remove(AffectedBlocks, n)
end
end
-- send the modified table to the server to be processed
end

