10-06-2019, 08:16 PM
This seems to work pretty well to count all the blocks:
local BlockArea = cBlockArea() BlockArea:Read(World, SrcCuboid, cBlockArea.baTypes + cBlockArea.baMetas) local output = {}; for X = SrcCuboid.p1.x, SrcCuboid.p2.x do for Y = SrcCuboid.p1.y, SrcCuboid.p2.y do for Z = SrcCuboid.p1.z, SrcCuboid.p2.z do local blocktype, meta = BlockArea:GetBlockTypeMeta(X, Y, Z); local type = output[blocktype] or {}; type[meta] = (type[meta] or 0) + 1; output[blocktype] = type; end end end for blocktype, metas in pairs(output) do print(blocktype); for meta, num in pairs(metas) do print("\t" .. meta .. ": " .. num); end end