]> git.lizzy.rs Git - worldedit.git/blobdiff - worldedit_commands/cuboid.lua
Dual-based cylinder
[worldedit.git] / worldedit_commands / cuboid.lua
index 24dad28b3ced4ea3cb1ee4c6fa783a954eeff628..88f026087074c3673c3c6f9b4e5380b8d9b4f8c9 100644 (file)
@@ -1,6 +1,3 @@
-dofile(minetest.get_modpath("worldedit_commands") .. "/cuboidapi.lua")
-
-
 minetest.register_chatcommand("/outset", {
        params = "[h|v] <amount>",
        description = "outset the selection",
@@ -114,10 +111,12 @@ minetest.register_chatcommand("/shift", {
                end
                
                local axis, dir
-               if direction ~= "?" then
-                       axis, dir = worldedit.translate_direction(name, direction)
-               else
+               if direction == "x" or direction == "y" or direction == "z" then
+                       axis, dir = direction, 1
+               elseif direction == "?" then
                        axis, dir = worldedit.player_axis(name)
+               else
+                       axis, dir = worldedit.translate_direction(name, direction)
                end
                
                if axis == nil or dir == nil then
@@ -127,7 +126,7 @@ minetest.register_chatcommand("/shift", {
                assert(worldedit.cuboid_shift(name, axis, amount * dir))
                worldedit.marker_update(name)
                
-               return true, "region shifted by " .. amount .. " nodes"
+               return true, "Region shifted by " .. amount .. " nodes"
       end,
   }
 )
@@ -181,6 +180,7 @@ minetest.register_chatcommand("/expand", {
        worldedit.cuboid_linear_expand(name, axis, dir, amount)
        worldedit.cuboid_linear_expand(name, axis, -dir, rev_amount)
        worldedit.marker_update(name)
+       return true, "Region expanded by " .. (amount + rev_amount) .. " nodes"
       end,
   }
 )
@@ -234,6 +234,7 @@ minetest.register_chatcommand("/contract", {
        worldedit.cuboid_linear_expand(name, axis, dir, -amount)
        worldedit.cuboid_linear_expand(name, axis, -dir, -rev_amount)
        worldedit.marker_update(name)
+       return true, "Region contracted by " .. (amount + rev_amount) .. " nodes"
       end,
   }
-)
\ No newline at end of file
+)