2021-03-13 01:09:57 +00:00
|
|
|
-- ██████ ██████ ██ ██████ ██ ██ ██████
|
2021-03-12 23:47:10 +00:00
|
|
|
-- ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
|
|
-- ███████ ██ ██ ██ ██ ██ ██ ██ ██
|
|
|
|
-- ██ ██ ██ ██ ██ ██ ██ ██ ██
|
2021-03-13 01:09:57 +00:00
|
|
|
-- ██████ ██████ ███████ ██████ ██████ ██████
|
2021-03-12 23:47:10 +00:00
|
|
|
local wea = worldeditadditions
|
2021-03-13 02:01:17 +00:00
|
|
|
minetest.register_on_punchnode(function(pos, node, puncher)
|
|
|
|
local name = puncher:get_player_name()
|
|
|
|
if name ~= "" and wea.add_pos[name] ~= nil then
|
|
|
|
if wea.add_pos[name] > 0 then
|
|
|
|
wea.selection.add_point(name,pos)
|
|
|
|
wea.add_pos[name] = wea.add_pos[name] - 1
|
|
|
|
worldedit.player_notify(name, "You have "..wea.add_pos[name].." nodes left to punch")
|
|
|
|
else wea.add_pos[name] = nil end
|
|
|
|
end
|
|
|
|
end)
|
2022-05-19 21:10:09 +00:00
|
|
|
worldeditadditions_core.register_command("scloud", {
|
2021-03-13 01:55:10 +00:00
|
|
|
params = "<0-6|stop|reset>",
|
2021-03-13 01:03:37 +00:00
|
|
|
description = "Set and add to WorldEdit region by punching up to six nodes that define the maximums of your target",
|
2021-03-12 23:47:10 +00:00
|
|
|
privs = {worldedit=true},
|
|
|
|
parse = function(param)
|
|
|
|
return true, param
|
|
|
|
end,
|
|
|
|
func = function(name, param)
|
|
|
|
local que = tonumber(param)
|
|
|
|
if que then
|
|
|
|
if que > 0 then
|
|
|
|
wea.add_pos[name] = que < 7 and que or 6
|
|
|
|
return true, "create or add to selection by punching "..wea.add_pos[name].." nodes"
|
|
|
|
else
|
|
|
|
wea.add_pos[name] = nil
|
|
|
|
return true, "0 nodes to punch: operation canceled"
|
|
|
|
end
|
|
|
|
elseif param == "stop" then
|
|
|
|
wea.add_pos[name] = nil
|
|
|
|
return true, "selection operation stopped"
|
|
|
|
elseif param == "reset" then
|
|
|
|
wea.add_pos[name] = nil
|
2021-03-13 02:01:17 +00:00
|
|
|
wea.selection.clear_points(name)
|
2021-03-12 23:47:10 +00:00
|
|
|
return true, "selection cleared"
|
|
|
|
else
|
2021-03-13 03:26:38 +00:00
|
|
|
return false, (param == "" and "no input" or "invalid input: '"..param.."'").."! Allowed params are: 0-6, stop, or reset"
|
2021-03-12 23:47:10 +00:00
|
|
|
end
|
|
|
|
end,
|
|
|
|
})
|