diff --git a/CHANGELOG.md b/CHANGELOG.md index 52606e0..ee93284 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Note to self: See the bottom of this file for the release template text. - Add `//spush`, `//spop`, and `//sstack` - Add `//srect` (_select rectangle_), `//scol` (_select column_), `//scube` (_select cube_) - thanks, @VorTechnix! - Add `//scloud` (_select point cloud_), `//scentre` (_select centre node(s)_), `//srel` (_select relative_) - thanks, @VorTechnix! + - Add `//smake` (_selection make_) - thanks, @VorTechnix! - Significantly refactored backend utility functions (more to come in future updates) - `//bonemeal`: Try bonemealing everything that isn't an air block (#49) - Add new universal chance parsing diff --git a/Chat-Command-Reference.md b/Chat-Command-Reference.md index 6f2eba3..3629ed5 100644 --- a/Chat-Command-Reference.md +++ b/Chat-Command-Reference.md @@ -602,6 +602,55 @@ Short for _select relative_. Sets the pos2 at set distances along 3 axes relativ //scube -z 12 -y -2 x -2 ``` +## `//smake [ []]` +Short for _selection make_. Modifies existing selection by moving pos2. Allows you to make the selection an odd or even length on one or more axes or set two or more axes equal to each other or the longest, shortest or average of them. Implementation thanks to @VorTechnix. + +Usage examples: + +``` +//smake odd shrink +//smake even avg xz +//smake equal grow xy +//smake equal average +//smake equal zy x +``` + +### ``: odd/even/equal/factor + +|Value | Description | +| --- | --- | +odd: | round up or down, based on mode, all axes specified in `` to the nearest odd length relative to pos1 +even: | round up or down, based on mode, all axes specified in `` to the nearest even length relative to pos1 +equal: | set `` axes length equal to the length of `` axis if specified or to the length of the largest, smallest or average of the `` axes based on mode. + +### `:` grow/shrink/average + +#### *If `` == odd or even:* + +|Value | Description | +| --- | --- | +grow: | grow each axis specified in `` to the nearest odd/even number to itself +shrink: | shrink each axis specified in `` to the nearest odd/even number to itself +average/avg: | take the average of all axes specified in `` and then for each specified axis grow or shrink it, depending on weather it is less than or greater than the average, to the nearest odd/even number to itself + +#### *If `` == equal:* ^[1] + +|Value | Description | +| --- | --- | +grow: | grow each axis specified in `` to the length of the longest specified axis +shrink: | shrink each axis specified in `` to the length of the shortest specified axis +average/avg: | set each axis specified in `` to the average length of all the specified axes + +### Additional arguments: + +|Name | Description | +| --- | --- | +``: | Specify axes to perform operation on (default= xz)| +``: If `` == odd or even: | Does nothing +``: If `` == equal: | Overrides ``^[1] and sets all `` axes equal to itself + +^[1]: `` argument can be omitted and will not be parsed if present if `` is specified + ## `//sstack` Displays the contents of your per-user selection stack. This stack can be pushed to and popped from rather like a stack of plates. See also `//spush` (for pushing to the selection stack) and `//spop` (for popping from the selection stack). diff --git a/worldeditadditions_commands/commands/selectors/smake.lua b/worldeditadditions_commands/commands/selectors/smake.lua index 8b33bc4..46f1c64 100644 --- a/worldeditadditions_commands/commands/selectors/smake.lua +++ b/worldeditadditions_commands/commands/selectors/smake.lua @@ -61,7 +61,7 @@ worldedit.register_command("smake", { return false, "Error: Invalid operator \""..oper.."\". Expected \"odd\", \"even\" or \"equal\"." end - if false then + if false then -- Argument test return false, ": " .. oper .. ", : " .. tostring(mode) .. ", : " .. tostring(targ) .. ", : " .. tostring(base) end return true, oper, mode, targ, base