Introduce type parameter for worldedit.player_notify

This commit is contained in:
sfan5
2024-04-22 17:33:16 +02:00
parent d13ba673fe
commit 1d8d9a704f
12 changed files with 235 additions and 212 deletions

View File

@ -249,14 +249,14 @@ worldedit.register_command("cubeapply", {
end,
nodes_needed = function(name, sidex, sidey, sidez, cmd, parsed)
-- its not possible to defer to the target command at this point
-- FIXME: why not?
return sidex * sidey * sidez
end,
func = function(name, sidex, sidey, sidez, cmd, parsed)
local cmddef = assert(worldedit.registered_commands[cmd])
local success, missing_privs = minetest.check_player_privs(name, cmddef.privs)
if not success then
worldedit.player_notify(name, S("Missing privileges: @1", table.concat(missing_privs, ", ")))
return
return false, S("Missing privileges: @1", table.concat(missing_privs, ", "))
end
-- update region to be the cuboid the user wanted