1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-07-29 04:40:23 +02:00

Updated WorldEdit

This commit is contained in:
LeMagnesium
2015-05-19 20:28:05 +02:00
parent cee9c73216
commit 0f6e885b4f
4 changed files with 42 additions and 28 deletions

View File

@ -1,7 +1,7 @@
local safe_region_callback = {}
local safe_region_param = {}
check_region = function(name, param)
function check_region(name, param)
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name] --obtain positions
if pos1 == nil or pos2 == nil then
worldedit.player_notify(name, "no region selected")
@ -12,7 +12,7 @@ end
--`callback` is a callback to run when the user confirms
--`nodes_needed` is a function accepting `param`, `pos1`, and `pos2` to calculate the number of nodes needed
safe_region = function(callback, nodes_needed)
function safe_region(callback, nodes_needed)
--default node volume calculation
nodes_needed = nodes_needed or check_region
@ -63,3 +63,5 @@ minetest.register_chatcommand("/n", {
safe_region_callback[name], safe_region_param[name] = nil, nil
end,
})
return safe_region, check_region