mirror of
https://github.com/sbrl/Minetest-WorldEditAdditions.git
synced 2024-11-04 23:33:01 +00:00
Added //msize
This commit is contained in:
parent
f709d12b75
commit
e047372c22
2 changed files with 23 additions and 0 deletions
|
@ -10,3 +10,4 @@ local we_cm = worldeditadditions_commands.modpath .. "/commands/measure/"
|
||||||
|
|
||||||
dofile(we_cm.."mface.lua")
|
dofile(we_cm.."mface.lua")
|
||||||
dofile(we_cm.."midpos.lua")
|
dofile(we_cm.."midpos.lua")
|
||||||
|
dofile(we_cm.."msize.lua")
|
||||||
|
|
22
worldeditadditions_commands/commands/measure/msize.lua
Normal file
22
worldeditadditions_commands/commands/measure/msize.lua
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
-- ███ ███ ███████ ██ ███████ ███████
|
||||||
|
-- ████ ████ ██ ██ ███ ██
|
||||||
|
-- ██ ████ ██ ███████ ██ ███ █████
|
||||||
|
-- ██ ██ ██ ██ ██ ███ ██
|
||||||
|
-- ██ ██ ███████ ██ ███████ ███████
|
||||||
|
local wea = worldeditadditions
|
||||||
|
worldedit.register_command("msize", {
|
||||||
|
params = "",
|
||||||
|
description = "Return the length of each axis of current selection.",
|
||||||
|
privs = { worldedit = true },
|
||||||
|
require_pos = 2,
|
||||||
|
parse = function(params_text)
|
||||||
|
return true
|
||||||
|
end,
|
||||||
|
func = function(name, params_text)
|
||||||
|
local str = "The dimensions of the current selection are "
|
||||||
|
local vec = vector.subtract(worldedit.pos2[name],worldedit.pos1[name])
|
||||||
|
wea.vector.abs(vec)
|
||||||
|
|
||||||
|
return true, str .. wea.table.tostring(vec)
|
||||||
|
end,
|
||||||
|
})
|
Loading…
Reference in a new issue