diff --git a/mods/lord/World/worldedit_ext/init.lua b/mods/lord/World/worldedit_ext/init.lua index 95d8e0f4c..518c40d33 100644 --- a/mods/lord/World/worldedit_ext/init.lua +++ b/mods/lord/World/worldedit_ext/init.lua @@ -26,3 +26,28 @@ worldedit.register_command('select_chunks', { }) worldedit.alias_command('sc', 'select_chunks') + + + +local trees_nodes = { + "default:tree", "default:jungletree", "default:leaves", "default:apple", "lottplants:plum", + "lottplants:aldertree", "lottplants:birchtree", "lottplants:firtree", "lottplants:lebethrontree", + "lottplants:mallorntree", "lottplants:mallorntree_young", "lottplants:pinetree", "lottplants:alderleaf", + "lottplants:appleleaf", "lottplants:beechleaf", "lottplants:birchleaf", "lottplants:culumaldaleaf", + "lottplants:elmleaf", "lottplants:firleaf", "lottplants:lebethronleaf", "lottplants:mallornleaf", + "lottplants:mirkleaf", "lottplants:pineleaf", "lottplants:plumleaf", "lottplants:rowanberry", + "lottplants:rowanleaf", "lottplants:whiteleaf", "lottplants:yavannamireleaf", "lottplants:yellowflowers", +} +worldedit.register_command('clear_trees', { + params = "", + description = S(""), + privs = { worldedit = true }, + require_pos = 2, + func = function(name) + local count = 0 + for _, search_node_name in pairs(trees_nodes) do + count = count + worldedit.replace(worldedit.pos1[name], worldedit.pos2[name], search_node_name, "air") + end + worldedit.player_notify(name, S("@1 nodes replaced", count)) + end +})