\r
### `//about`\r
\r
-Get information about the mod.\r
+Get information about the WorldEdit mod.\r
\r
//about\r
\r
-### `//inspect on/off/1/0/true/false/yes/no/enable/disable/<blank>`\r
+### `//help [all/<cmd>]`\r
+\r
+Get help for WorldEdit commands. `all` shows all WorldEdit commands, `<cmd>`\r
+the help text for the given command.\r
+\r
+ //help\r
+ //help all\r
+ //help hollowpyramid\r
+\r
+\r
+### `//inspect [on/off/1/0/true/false/yes/no/enable/disable]`\r
\r
Enable or disable node inspection.\r
\r
//inspect on\r
//inspect off\r
- //inspect 1\r
- //inspect 0\r
- //inspect true\r
- //inspect false\r
- //inspect yes\r
- //inspect no\r
- //inspect enable\r
- //inspect disable\r
//inspect\r
\r
### `//reset`\r
\r
### `//p set/set1/set2/get`\r
\r
-Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by punching nodes, or display the current WorldEdit region.\r
+Set WorldEdit region, WorldEdit position 1, or WorldEdit position 2 by\r
+punching nodes, or print the current WorldEdit region.\r
\r
//p set\r
//p set1\r
//p set2\r
//p get\r
\r
-### `//fixedpos set1 x y z`\r
+### `//fixedpos set1/set2 <x> <y> <z>`\r
\r
-Set a WorldEdit region position to the position at (`<x>`, `<y>`, `<z>`).\r
+Set the WorldEdit region position 1 or 2 to the position (`<x>`, `<y>`, `<z>`).\r
\r
- //fixedpos set1 0 0 0\r
+ //fixedpos set1 0 0 0\r
//fixedpos set1 -30 5 28\r
//fixedpos set2 1004 -200 432\r
\r
\r
Set the param2 value of all nodes in the current WorldEdit region to `<param2>`.\r
\r
-### `//mix <node1> [<count1>] <node2> [<count2>]...`\r
+ //param2 8\r
\r
-Fill the current WorldEdit region with a random mix of `<node1>`, `<node2>`, `...`. Weightings can be optionally specified via a number after a node name.\r
+### `//mix <node1> [count1] <node2> [count2] ...`\r
+\r
+Fill the current WorldEdit region with a random mix of `<node1>`, `<node2>`, `...`.\r
+Weightings can be optionally specified via the `[count1]`, `[count2]`, `...` parameters after a node name.\r
\r
//mix air\r
//mix cactus stone glass sandstone\r
\r
### `//hollowcube <width> <height> <length> <node>`\r
\r
-Adds a hollow cube with its ground level centered at WorldEdit position 1 with dimensions `<width>` x `<height>` x `<length>`, composed of `<node>`.\r
+Adds a hollow cube with its ground level centered at WorldEdit position 1 with\r
+dimensions `<width>` x `<height>` x `<length>`, composed of `<node>`.\r
\r
//hollowcube 6 5 6 Diamond Block\r
\r
### `//cube <width> <height> <length> <node>`\r
\r
-Adds a cube with its ground level centered at WorldEdit position 1 with dimensions `<width>` x `<height>` x `<length>`, composed of `<node>`.\r
+Adds a cube with its ground level centered at WorldEdit position 1 with\r
+dimensions `<width>` x `<height>` x `<length>`, composed of `<node>`.\r
\r
//cube 6 5 6 Diamond Block\r
//cube 7 2 1 default:cobble\r
\r
### `//hollowcylinder x/y/z/? <length> <radius1> [radius2] <node>`\r
\r
-Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length `<length>`, base radius `<radius1>` (and top radius `[radius2]`), composed of `<node>`.\r
+Add hollow cylinder at WorldEdit position 1 along the given axis with length `<length>`,\r
+base radius `<radius1>` (and top radius `[radius2]`), composed of `<node>`.\r
\r
Despite its name this command allows you to create cones (`radius2` = 0) as well as any shapes inbetween (0 < `radius2` < `radius1`).\r
Swapping `radius1` and `radius2` will create the same object but upside-down.\r
\r
### `//cylinder x/y/z/? <length> <radius1> [radius2] <node>`\r
\r
-Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length `<length>`, base radius `<radius1>` (and top radius `[radius2]`), composed of `<node>`.\r
+Add cylinder at WorldEdit position 1 along the given axis with length `<length>`,\r
+base radius `<radius1>` (and top radius `[radius2]`), composed of `<node>`.\r
Can also create shapes other than cylinders, e.g. cones (see documentation above).\r
\r
//cylinder x +5 8 Bronze Block\r
//cylinder x 6 0 5 Dirt\r
//cylinder z 20 10 20 default:desert_stone\r
\r
-### `//hollowpyramid x/y/z? <height> <node>`\r
+### `//hollowpyramid x/y/z/? <height> <node>`\r
\r
-Add hollow pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height `<height>`, composed of `<node>`.\r
+Add hollow pyramid centered at WorldEdit position 1 along the given axis with height `<height>` composed of `<node>`.\r
\r
//hollowpyramid x 8 Diamond Block\r
//hollowpyramid y -5 glass\r
//hollowpyramid z 2 mesecons:wire_00000000_off\r
//hollowpyramid ? 12 mesecons:wire_00000000_off\r
\r
-### `//pyramid x/y/z? <height> <node>`\r
+### `//pyramid x/y/z/? <height> <node>`\r
\r
-Add pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height `<height>`, composed of `<node>`.\r
+Add pyramid centered at WorldEdit position 1 along the given axis with height `<height>` composed of `<node>`.\r
\r
//pyramid x 8 Diamond Block\r
//pyramid y -5 glass\r
\r
### `//spiral <length> <height> <spacer> <node>`\r
\r
-Add spiral centered at WorldEdit position 1 with side length `<length>`, height `<height>`, space between walls `<spacer>`, composed of `<node>`.\r
+Add spiral centered at WorldEdit position 1 with side length `<length>`,\r
+height `<height>`, space between walls `<spacer>`, composed of `<node>`.\r
\r
//spiral 20 5 3 Diamond Block\r
//spiral 5 2 1 glass\r
\r
### `//copy x/y/z/? <amount>`\r
\r
-Copy the current WorldEdit region along the x/y/z/? axis by `<amount>` nodes.\r
+Copy the current WorldEdit region along the given axis by `<amount>` nodes.\r
\r
//copy x 15\r
//copy y -7\r
\r
### `//move x/y/z/? <amount>`\r
\r
-Move the current WorldEdit positions and region along the x/y/z/? axis by `<amount>` nodes.\r
+Move the current WorldEdit positions and region along the given axis by `<amount>` nodes.\r
\r
//move x 15\r
//move y -7\r
\r
### `//stack x/y/z/? <count>`\r
\r
-Stack the current WorldEdit region along the x/y/z/? axis `<count>` times.\r
+Stack the current WorldEdit region along the given axis `<count>` times.\r
\r
//stack x 3\r
//stack y -1\r
\r
### `//stretch <stretchx> <stretchy> <stretchz>`\r
\r
-Scale the current WorldEdit positions and region by a factor of `<stretchx>`, `<stretchy>`, `<stretchz>` along the X, Y, and Z axes, repectively, with position 1 as the origin.\r
+Scale the current WorldEdit positions and region by a factor of\r
+`<stretchx>`, `<stretchy>`, `<stretchz>` along the X, Y, and Z axes,\r
+respectively, with position 1 as the origin.\r
\r
//stretch 2 2 2\r
//stretch 1 2 1\r
\r
### `//transpose x/y/z/? x/y/z/?`\r
\r
-Transpose the current WorldEdit positions and region along the x/y/z/? and x/y/z/? axes.\r
+Transpose the current WorldEdit positions and region along given axes.\r
\r
//transpose x y\r
- //transpose x z\r
//transpose y z\r
//transpose ? y\r
\r
### `//flip x/y/z/?`\r
\r
-Flip the current WorldEdit region along the x/y/z/? axis.\r
+Flip the current WorldEdit region along the given axis.\r
\r
//flip x\r
- //flip y\r
- //flip z\r
//flip ?\r
\r
### `//rotate x/y/z/? <angle>`\r
\r
-Rotate the current WorldEdit positions and region along the x/y/z/? axis by angle `<angle>` (90 degree increment).\r
+Rotate the current WorldEdit positions and region along the given axis by angle `<angle>` (90 degree increment).\r
\r
//rotate x 90\r
//rotate y 180\r
\r
//clearcut\r
\r
-\r
### `//hide`\r
\r
Hide all nodes in the current WorldEdit region non-destructively.\r
\r
### `//suppress <node>`\r
\r
-Suppress all <node> in the current WorldEdit region non-destructively.\r
+Suppress all `<node>` in the current WorldEdit region non-destructively.\r
\r
//suppress Diamond Block\r
//suppress glass\r
\r
### `//highlight <node>`\r
\r
-Highlight <node> in the current WorldEdit region by hiding everything else non-destructively.\r
+Highlight `<node>` in the current WorldEdit region by hiding everything else non-destructively.\r
\r
//highlight Diamond Block\r
//highlight glass\r
\r
Executes `<code>` as a Lua chunk in the global namespace with the variable pos available, for each node in the current WorldEdit region.\r
\r
- //luatransform minetest.add_node(pos, {name="default:stone"})\r
- //luatransform if minetest.get_node(pos).name == "air" then minetest.add_node(pos, {name="default:water_source"})\r
+ //luatransform minetest.swap_node(pos, {name="default:stone"})\r
+ //luatransform if minetest.get_node(pos).name == "air" then minetest.add_node(pos, {name="default:water_source"}) end\r
\r
### `//mtschemcreate <file>`\r
\r
\r
//clearobjects\r
\r
-### `//shift x/y/z/?/up/down/left/right/front/back [+|-]<amount>`\r
+### `//shift x/y/z/?/up/down/left/right/front/back [+/-]<amount>`\r
\r
-Shifts the selection area by `[+|-]<amount>` without touching its contents. The shifting axis can be absolute (`x/y/z`) or \r
-relative (`up/down/left/right/front/back`). \r
+Shifts the selection area by `[+|-]<amount>` without moving its contents.\r
+The shifting axis can be absolute (`x/y/z`) or relative (`up/down/left/right/front/back`). \r
\r
//shift left 5\r
\r
-### `//expand [+|-]x/y/z/?/up/down/left/right/front/back <amount> [reverse-amount]`\r
+### `//expand [+/-]x/y/z/?/up/down/left/right/front/back <amount> [reverse amount]`\r
\r
-Expands the selection by `<amount>` in the selected absolute or relative axis. If specified, the selection can be expanded in the\r
-opposite direction over the same axis by `[reverse-amount]`.\r
+Expands the selection by `<amount>` in the selected absolute or relative axis.\r
+If specified, the selection can be expanded in the opposite direction over the same axis by `[reverse amount]`.\r
\r
//expand right 7 5\r
\r
-### `//contract [+|-]x/y/z/?/up/down/left/right/front/back <amount> [reverse-amount]`\r
+### `//contract [+/-]x/y/z/?/up/down/left/right/front/back <amount> [reverse amount]`\r
\r
-Contracts the selection by `<amount>` in the selected absolute or relative axis. If specified, the selection can be contracted in the\r
-opposite direction over the same axis by `[reverse-amount]`.\r
+Contracts the selection by `<amount>` in the selected absolute or relative axis.\r
+If specified, the selection can be contracted in the opposite direction over the same axis by `[reverse amount]`.\r
\r
//expand right 7 5\r
\r
-### `//outset [hv] <amount>`\r
+### `//outset [h/v] <amount>`\r
\r
-Expands the selection in all directions by `<amount>`. If specified, the selection can be expanded horizontally in the x and z axes `[h]`\r
-or vertically in the y axis `[v]`.\r
+Expands the selection in all directions by `<amount>`. If specified,\r
+the selection can be expanded horizontally in the x and z axes using `h`\r
+or vertically in the y axis using `v`.\r
\r
//outset v 5\r
\r
-### `//inset [hv] <amount>`\r
+### `//inset [h/v] <amount>`\r
\r
-Contracts the selection in all directions by `<amount>`. If specified, the selection can be contracted horizontally in the x and z axes `[h]`\r
-or vertically in the y axis `[v]`.\r
+Contracts the selection in all directions by `<amount>`. If specified,\r
+the selection can be contracted horizontally in the x and z axes using `h`\r
+or vertically in the y axis using `v`.\r
\r
- //outset v 5\r
+ //inset h 5\r
\r
-### `//brush none/<command> [parameters]`\r
+### `//brush none/(<command> [parameters])`\r
\r
Assigns the given `<command>` to the currently held brush item, it will be ran with the first pointed solid node (as determined via raycast) as\r
WorldEdit position 1 when using that specific brush item.\r
worldedit.register_command("outset", {
- params = "[h|v] <amount>",
+ params = "[h/v] <amount>",
description = "Outset the selected region.",
privs = {worldedit=true},
require_pos = 2,
worldedit.register_command("inset", {
- params = "[h|v] <amount>",
+ params = "[h/v] <amount>",
description = "Inset the selected region.",
privs = {worldedit=true},
require_pos = 2,
if find == nil then
return false
end
-
- local hv_test = dir:find("[^hv]+")
- if hv_test ~= nil then
+ if dir:find("[^hv]") ~= nil then
return false, "Invalid direction."
end
worldedit.register_command("shift", {
- params = "[x|y|z|?|up|down|left|right|front|back] [+|-]<amount>",
- description = "Moves the selection region. Does not move contents.",
+ params = "x/y/z/?/up/down/left/right/front/back [+/-]<amount>",
+ description = "Shifts the selection area without moving its contents",
privs = {worldedit=true},
require_pos = 2,
parse = function(param)
worldedit.register_command("expand", {
- params = "[+|-]<x|y|z|?|up|down|left|right|front|back> <amount> [reverse-amount]",
- description = "expand the selection in one or two directions at once",
+ params = "[+/-]x/y/z/?/up/down/left/right/front/back <amount> [reverse amount]",
+ description = "Expands the selection in the selected absolute or relative axis",
privs = {worldedit=true},
require_pos = 2,
parse = function(param)
worldedit.register_command("contract", {
- params = "[+|-]<x|y|z|?|up|down|left|right|front|back> <amount> [reverse-amount]",
- description = "contract the selection in one or two directions at once",
+ params = "[+/-]x/y/z/?/up/down/left/right/front/back <amount> [reverse amount]",
+ description = "Contracts the selection in the selected absolute or relative axis",
privs = {worldedit=true},
require_pos = 2,
parse = function(param)
params = "",\r
description = "Get information about the WorldEdit mod",\r
func = function(name)\r
- worldedit.player_notify(name, "WorldEdit " .. worldedit.version_string .. " is available on this server. Type //help to get a list of commands, or get more information at https://github.com/Uberi/Minetest-WorldEdit")\r
+ worldedit.player_notify(name, "WorldEdit " .. worldedit.version_string..\r
+ " is available on this server. Type //help to get a list of "..\r
+ "commands, or get more information at "..\r
+ "https://github.com/Uberi/Minetest-WorldEdit")\r
end,\r
})\r
\r
})\r
\r
worldedit.register_command("fixedpos", {\r
- params = "set1/set2 x y z",\r
+ params = "set1/set2 <x> <y> <z>",\r
description = "Set a WorldEdit region position to the position at (<x>, <y>, <z>)",\r
privs = {worldedit=true},\r
parse = function(param)\r
parse = function(param)\r
local param2 = tonumber(param)\r
if not param2 then\r
- return false, "Invalid or missing param2 argument"\r
+ return false\r
elseif param2 < 0 or param2 > 255 then\r
return false, "Param2 is out of range (must be between 0 and 255 inclusive!)"\r
end\r
})\r
\r
worldedit.register_command("mix", {\r
- params = "<node1> [<weighting1>] [<node2> [<weighting2>]] ...",\r
+ params = "<node1> [count1] <node2> [count2] ...",\r
description = "Fill the current WorldEdit region with a random mix of <node1>, ...",\r
privs = {worldedit=true},\r
require_pos = 2,\r
\r
worldedit.register_command("hollowcylinder", {\r
params = "x/y/z/? <length> <radius1> [radius2] <node>",\r
- description = "Add hollow cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length>, base radius <radius1> (and top radius [radius2]), composed of <node>",\r
+ description = "Add hollow cylinder at WorldEdit position 1 along the given axis with length <length>, base radius <radius1> (and top radius [radius2]), composed of <node>",\r
privs = {worldedit=true},\r
require_pos = 1,\r
parse = check_cylinder,\r
\r
worldedit.register_command("cylinder", {\r
params = "x/y/z/? <length> <radius1> [radius2] <node>",\r
- description = "Add cylinder at WorldEdit position 1 along the x/y/z/? axis with length <length>, base radius <radius1> (and top radius [radius2]), composed of <node>",\r
+ description = "Add cylinder at WorldEdit position 1 along the given axis with length <length>, base radius <radius1> (and top radius [radius2]), composed of <node>",\r
privs = {worldedit=true},\r
require_pos = 1,\r
parse = check_cylinder,\r
\r
worldedit.register_command("hollowpyramid", {\r
params = "x/y/z/? <height> <node>",\r
- description = "Add hollow pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height <height>, composed of <node>",\r
+ description = "Add hollow pyramid centered at WorldEdit position 1 along the given axis with height <height>, composed of <node>",\r
privs = {worldedit=true},\r
require_pos = 1,\r
parse = check_pyramid,\r
\r
worldedit.register_command("pyramid", {\r
params = "x/y/z/? <height> <node>",\r
- description = "Add pyramid centered at WorldEdit position 1 along the x/y/z/? axis with height <height>, composed of <node>",\r
+ description = "Add pyramid centered at WorldEdit position 1 along the given axis with height <height>, composed of <node>",\r
privs = {worldedit=true},\r
require_pos = 1,\r
parse = check_pyramid,\r
\r
worldedit.register_command("copy", {\r
params = "x/y/z/? <amount>",\r
- description = "Copy the current WorldEdit region along the x/y/z/? axis by <amount> nodes",\r
+ description = "Copy the current WorldEdit region along the given axis by <amount> nodes",\r
privs = {worldedit=true},\r
require_pos = 2,\r
parse = function(param)\r
\r
worldedit.register_command("move", {\r
params = "x/y/z/? <amount>",\r
- description = "Move the current WorldEdit region along the x/y/z/? axis by <amount> nodes",\r
+ description = "Move the current WorldEdit region along the given axis by <amount> nodes",\r
privs = {worldedit=true},\r
require_pos = 2,\r
parse = function(param)\r
\r
worldedit.register_command("stack", {\r
params = "x/y/z/? <count>",\r
- description = "Stack the current WorldEdit region along the x/y/z/? axis <count> times",\r
+ description = "Stack the current WorldEdit region along the given axis <count> times",\r
privs = {worldedit=true},\r
require_pos = 2,\r
parse = function(param)\r
\r
worldedit.register_command("transpose", {\r
params = "x/y/z/? x/y/z/?",\r
- description = "Transpose the current WorldEdit region along the x/y/z/? and x/y/z/? axes",\r
+ description = "Transpose the current WorldEdit region along the given axes",\r
privs = {worldedit=true},\r
require_pos = 2,\r
parse = function(param)\r
\r
worldedit.register_command("flip", {\r
params = "x/y/z/?",\r
- description = "Flip the current WorldEdit region along the x/y/z/? axis",\r
+ description = "Flip the current WorldEdit region along the given axis",\r
privs = {worldedit=true},\r
require_pos = 2,\r
parse = function(param)\r
})\r
\r
worldedit.register_command("rotate", {\r
- params = "<axis> <angle>",\r
- description = "Rotate the current WorldEdit region around the axis <axis> by angle <angle> (90 degree increment)",\r
+ params = "x/y/z/? <angle>",\r
+ description = "Rotate the current WorldEdit region around the given axis by angle <angle> (90 degree increment)",\r
privs = {worldedit=true},\r
require_pos = 2,\r
parse = function(param)\r