-dofile(minetest.get_modpath("worldedit_commands") .. "/cuboidapi.lua")
-
-
minetest.register_chatcommand("/outset", {
params = "[h|v] <amount>",
description = "outset the selection",
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
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,
}
)
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,
}
)
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
+)