summaryrefslogtreecommitdiff
path: root/worldedit_commands
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 22:10:20 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 22:42:02 -0400
commit86ad3e7c6a37699f7f8297a387bf08af74e36629 (patch)
treedc368b1eaf2cc09b9df2200250890b3038d8cf2d /worldedit_commands
parent888b0ebfec8c2eff9015163549a7e47443cb8665 (diff)
downloaddreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.gz
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.bz2
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.tar.xz
dreambuilder_modpack-86ad3e7c6a37699f7f8297a387bf08af74e36629.zip
Update all core mods
Diffstat (limited to 'worldedit_commands')
-rw-r--r--worldedit_commands/init.lua24
1 files changed, 24 insertions, 0 deletions
diff --git a/worldedit_commands/init.lua b/worldedit_commands/init.lua
index 83a127e..c93a760 100644
--- a/worldedit_commands/init.lua
+++ b/worldedit_commands/init.lua
@@ -838,6 +838,30 @@ minetest.register_chatcommand("/fixlight", {
end),
})
+minetest.register_chatcommand("/drain", {
+ params = "",
+ description = "Remove any fluid node within the current WorldEdit region",
+ privs = {worldedit=true},
+ func = safe_region(function(name, param)
+ -- TODO: make an API function for this
+ local count = 0
+ local pos1, pos2 = worldedit.sort_pos(worldedit.pos1[name], worldedit.pos2[name])
+ for x = pos1.x, pos2.x do
+ for y = pos1.y, pos2.y do
+ for z = pos1.z, pos2.z do
+ local n = minetest.get_node({x=x, y=y, z=z}).name
+ local d = minetest.registered_nodes[n]
+ if d ~= nil and (d["drawtype"] == "liquid" or d["drawtype"] == "flowingliquid") then
+ minetest.remove_node({x=x, y=y, z=z})
+ count = count + 1
+ end
+ end
+ end
+ end
+ worldedit.player_notify(name, count .. " nodes updated")
+ end),
+})
+
minetest.register_chatcommand("/hide", {
params = "",
description = "Hide all nodes in the current WorldEdit region non-destructively",