Minetest-WorldEditAdditions/worldeditadditions_commands/commands/extra/basename.lua
VorTechnix 489d856176 Added srect and basename
Also moved saplingaliases and corrected the block text in forest.lua
2021-02-24 08:40:53 -08:00

19 lines
1.2 KiB
Lua

-- ██████ █████ ███████ ███████ ███ ██ █████ ███ ███ ███████
-- ██ ██ ██ ██ ██ ██ ████ ██ ██ ██ ████ ████ ██
-- ██████ ███████ ███████ █████ ██ ██ ██ ███████ ██ ████ ██ █████
-- ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██ ██
-- ██████ ██ ██ ███████ ███████ ██ ████ ██ ██ ██ ██ ███████
worldedit.register_command("basename", {
params = "<nodealias>",
description = "Returns the base name of nodes that use a given alias.",
privs = {worldedit = true},
parse = function(params_text)
params_text = params_text or "air"
return true, params_text
end,
func = function(name, params_text)
if name == nil then return end
worldedit.player_notify(name, worldedit.normalize_nodename(params_text) or 'Error 404: "'..params_text..'" not found!')
end
})