Add //deleteblocks command
This commit is contained in:
parent
bb8456b711
commit
4f1fe44ece
|
@ -98,6 +98,12 @@ Display the volume of the current WorldEdit region.
|
|||
|
||||
//volume
|
||||
|
||||
### `//deleteblocks`
|
||||
|
||||
Delete the mapblocks (16x16x16 units) that contain the selected region. This means that mapgen will be invoked for that area. As only whole mapblocks get removed, the deleted area is usually larger than the selected one.
|
||||
|
||||
//deleteblocks
|
||||
|
||||
### `//set <node>`
|
||||
|
||||
Set the current WorldEdit region to `<node>`.
|
||||
|
|
|
@ -277,6 +277,21 @@ minetest.register_chatcommand("/volume", {
|
|||
end,
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("/deleteblocks", {
|
||||
params = "",
|
||||
description = "remove all mapblocks (16x16x16) containing the selected area from the map",
|
||||
privs = {worldedit=true},
|
||||
func = safe_region(function(name, param)
|
||||
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
|
||||
local success = minetest.delete_area(pos1, pos2)
|
||||
if success then
|
||||
worldedit.player_notify(name, "Area deleted.")
|
||||
else
|
||||
worldedit.player_notify(name, "There was an error during deletion of the area.")
|
||||
end
|
||||
end),
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("/set", {
|
||||
params = "<node>",
|
||||
description = "Set the current WorldEdit region to <node>",
|
||||
|
|
Loading…
Reference in New Issue