Minetest-WorldEditAdditions/worldeditadditions_commands/commands/uasparse.lua

30 lines
1.4 KiB
Lua
Raw Normal View History

2024-09-19 04:00:51 +00:00
local wea_c = worldeditadditions_core
-- local Vector3 = wea_c.Vector3
-- ██ ██ █████ ███████ ██████ █████ ██████ ███████ ███████
-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
-- ██ ██ ███████ ███████ ██████ ███████ ██████ ███████ █████
-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
-- ██████ ██ ██ ███████ ██ ██ ██ ██ ██ ███████ ███████
worldeditadditions_core.register_command("uasparse", {
params = "<unified axis syntax>",
description = "Debug command. Returns min and max vectors for given inputs",
2024-09-19 04:00:51 +00:00
privs = { worldedit = true },
-- require_pos = 2,
parse = function(params_text)
local ret = wea_c.split(params_text)
if #ret < 1 then return false, "Error: No params found!"
2024-09-19 04:00:51 +00:00
else return true, ret end
end,
func = function(name, params_text)
local facing = wea_c.player_dir(name)
local min, max = wea_c.parse.directions(params_text, facing)
if not min then
return false, max
else
return true, "Min: "..min.." Max: "..max
end
end
})