2021-02-24 16:40:53 +00:00
|
|
|
-- ██████ █████ ███████ ███████ ███ ██ █████ ███ ███ ███████
|
|
|
|
-- ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ████ ████ ██
|
|
|
|
-- ██████ ███████ ███████ █████ ██ ██ ██ ███████ ██ ████ ██ █████
|
|
|
|
-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
|
|
|
|
-- ██████ ██ ██ ███████ ███████ ██ ████ ██ ██ ██ ██ ███████
|
|
|
|
worldedit.register_command("basename", {
|
|
|
|
params = "<nodealias>",
|
|
|
|
description = "Returns the base name of nodes that use a given alias.",
|
|
|
|
privs = {worldedit = true},
|
2021-02-25 03:35:20 +00:00
|
|
|
parse = function(params_text)
|
|
|
|
if params_text == "" or not params_text then
|
|
|
|
return false, "Node not specified."
|
|
|
|
end
|
|
|
|
return true, params_text
|
2021-02-24 16:40:53 +00:00
|
|
|
end,
|
|
|
|
func = function(name, params_text)
|
2021-02-25 03:35:20 +00:00
|
|
|
if name == nil then return end
|
2021-07-28 17:15:03 +00:00
|
|
|
return true, worldedit.normalize_nodename(params_text) or 'Error 404: "'..params_text..'" not found!'
|
2021-02-24 16:40:53 +00:00
|
|
|
end
|
|
|
|
})
|