Skip to content

Commit

Permalink
Add WE //clear_trees command.
Browse files Browse the repository at this point in the history
  • Loading branch information
alek13 committed Jan 7, 2024
1 parent 89c7840 commit a2f1d9e
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions mods/lord/World/worldedit_ext/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
})

0 comments on commit a2f1d9e

Please sign in to comment.