]> git.lizzy.rs Git - worldedit.git/commitdiff
Add //deleteblocks command
authorest31 <MTest31@outlook.com>
Sun, 8 Feb 2015 00:38:05 +0000 (01:38 +0100)
committerest31 <MTest31@outlook.com>
Fri, 20 Feb 2015 21:30:34 +0000 (22:30 +0100)
ChatCommands.md
worldedit_commands/init.lua

index 07bcfd61016380d5ea7efd4a39928dbc3b668408..0c8b3a111886b68afe2c59b0fbc9fee751dbd54e 100644 (file)
@@ -98,6 +98,12 @@ Display the volume of the current WorldEdit region.
 \r
     //volume\r
 \r
+### `//deleteblocks`\r
+\r
+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.\r
+\r
+    //deleteblocks\r
+\r
 ### `//set <node>`\r
 \r
 Set the current WorldEdit region to `<node>`.\r
index 424082fdaf33d58aefeed44702ee292c06ac7e08..e97f304be24287ac638ea4a286c4e0974012ebc2 100644 (file)
@@ -277,6 +277,21 @@ minetest.register_chatcommand("/volume", {
        end,\r
 })\r
 \r
+minetest.register_chatcommand("/deleteblocks", {\r
+       params = "",\r
+       description = "remove all MapBlocks (16x16x16) containing the selected area from the map",\r
+       privs = {worldedit=true},\r
+       func = safe_region(function(name, param)\r
+               local pos1, pos2 = worldedit.pos1[name], worldedit.pos2[name]\r
+               local success = minetest.delete_area(pos1, pos2)\r
+               if success then\r
+                       worldedit.player_notify(name, "Area deleted.")\r
+               else\r
+                       worldedit.player_notify(name, "There was an error during deletion of the area.")\r
+               end\r
+       end),\r
+})\r
+\r
 minetest.register_chatcommand("/set", {\r
        params = "<node>",\r
        description = "Set the current WorldEdit region to <node>",\r