Skip to content

Commit bea38a1

Browse files
committedFeb 20, 2015
Add //deleteblocks command
1 parent 4336e7c commit bea38a1

File tree

2 files changed

+21
-0
lines changed

2 files changed

+21
-0
lines changed
 

Diff for: ‎ChatCommands.md

+6
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,12 @@ Display the volume of the current WorldEdit region.
9898

9999
//volume
100100

101+
### `//deleteblocks`
102+
103+
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. Also, mapgen can trigger mechanisms like mud reflow or cavegen, which affects nodes (up to 112 nodes away) outside the MapBlock, so dont use this near buildings.
104+
105+
//deleteblocks
106+
101107
### `//set <node>`
102108

103109
Set the current WorldEdit region to `<node>`.

Diff for: ‎worldedit_commands/init.lua

+15
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,21 @@ minetest.register_chatcommand("/volume", {
277277
end,
278278
})
279279

280+
minetest.register_chatcommand("/deleteblocks", {
281+
params = "",
282+
description = "remove all MapBlocks (16x16x16) containing the selected area from the map",
283+
privs = {worldedit=true},
284+
func = safe_region(function(name, param)
285+
local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]
286+
local success = minetest.delete_area(pos1, pos2)
287+
if success then
288+
worldedit.player_notify(name, "Area deleted.")
289+
else
290+
worldedit.player_notify(name, "There was an error during deletion of the area.")
291+
end
292+
end),
293+
})
294+
280295
minetest.register_chatcommand("/set", {
281296
params = "<node>",
282297
description = "Set the current WorldEdit region to <node>",

0 commit comments

Comments
 (0)
Please sign in to comment.