smake documentation

This commit is contained in:
VorTechnix 2021-06-25 13:29:27 -07:00
parent 8be867b2eb
commit e592e6746f
3 changed files with 51 additions and 1 deletions

@ -7,6 +7,7 @@ Note to self: See the bottom of this file for the release template text.
- Add `//spush`, `//spop`, and `//sstack` - Add `//spush`, `//spop`, and `//sstack`
- Add `//srect` (_select rectangle_), `//scol` (_select column_), `//scube` (_select cube_) - thanks, @VorTechnix! - 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 `//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) - Significantly refactored backend utility functions (more to come in future updates)
- `//bonemeal`: Try bonemealing everything that isn't an air block (#49) - `//bonemeal`: Try bonemealing everything that isn't an air block (#49)
- Add new universal chance parsing - Add new universal chance parsing

@ -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 //scube -z 12 -y -2 x -2
``` ```
## `//smake <operation> <mode> [<target=xz> [<base>]]`
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
```
### `<operation>`: odd/even/equal/factor
|Value | Description |
| --- | --- |
odd: | round up or down, based on mode, all axes specified in `<target>` to the nearest odd length relative to pos1
even: | round up or down, based on mode, all axes specified in `<target>` to the nearest even length relative to pos1
equal: | set `<target>` axes length equal to the length of `<base>` axis if specified or to the length of the largest, smallest or average of the `<target>` axes based on mode.
### `<mode>:` grow/shrink/average
#### *If `<operation>` == odd or even:*
|Value | Description |
| --- | --- |
grow: | grow each axis specified in `<target>` to the nearest odd/even number to itself
shrink: | shrink each axis specified in `<target>` to the nearest odd/even number to itself
average/avg: | take the average of all axes specified in `<target>` 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 `<operation>` == equal:* ^[1]
|Value | Description |
| --- | --- |
grow: | grow each axis specified in `<target>` to the length of the longest specified axis
shrink: | shrink each axis specified in `<target>` to the length of the shortest specified axis
average/avg: | set each axis specified in `<target>` to the average length of all the specified axes
### Additional arguments:
|Name | Description |
| --- | --- |
`<target>`: | Specify axes to perform operation on (default= xz)|
`<base>`: If `<operation>` == odd or even: | Does nothing
`<base>`: If `<operation>` == equal: | Overrides `<mode>`^[1] and sets all `<target>` axes equal to itself
^[1]: `<mode>` argument can be omitted and will not be parsed if present if `<base>` is specified
## `//sstack` ## `//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). 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).

@ -61,7 +61,7 @@ worldedit.register_command("smake", {
return false, "Error: Invalid operator \""..oper.."\". Expected \"odd\", \"even\" or \"equal\"." return false, "Error: Invalid operator \""..oper.."\". Expected \"odd\", \"even\" or \"equal\"."
end end
if false then if false then -- Argument test
return false, "<operator>: " .. oper .. ", <mode>: " .. tostring(mode) .. ", <target>: " .. tostring(targ) .. ", <base>: " .. tostring(base) return false, "<operator>: " .. oper .. ", <mode>: " .. tostring(mode) .. ", <target>: " .. tostring(targ) .. ", <base>: " .. tostring(base)
end end
return true, oper, mode, targ, base return true, oper, mode, targ, base