Merge branch 'master' into 1.16
This commit is contained in:
commit
8f72c3ef8c
6 files changed
+116
-87
No files matched your search
+14
-8
@@ -2330,7 +2330,7 @@ This function is tentative - will likely change when chunk ticket API is properl
|
||||
|
||||
These functions help scan larger areas of blocks without using generic loop functions, like nested `loop`.
|
||||
|
||||
### `scan(cx, cy, cz, dx, dy, dz, px?, py?, pz?, expr)`, `scan(center, range, lower_range?, expr)`
|
||||
### `scan(center, range, lower_range?, expr)`
|
||||
|
||||
Evaluates expression over area of blocks defined by its center `center = (cx, cy, cz)`, expanded in all directions
|
||||
by `range = (dx, dy, dz)` blocks, or optionally in negative with `range` coords, and `upper_range` coords in
|
||||
@@ -2346,14 +2346,15 @@ which would cause the expression not be evaluated for their boolean value.
|
||||
`scan` also handles `continue` and `break` statements, using `continue`'s return value to use in place of expression
|
||||
return value. `break` return value has no effect.
|
||||
|
||||
### `volume(x1, y1, z1, x2, y2, z2, expr)`
|
||||
### `volume(from_pos, to_pos, expr)`
|
||||
|
||||
Evaluates expression for each block in the area, the same as the `scan` function, but using two opposite corners of
|
||||
the rectangular cuboid. Any corners can be specified, its like you would do with `/fill` command.
|
||||
You can use a position or three coordinates to specify, it doesn't matter.
|
||||
|
||||
For return value and handling `break` and `continue` statements, see `scan` function above.
|
||||
|
||||
### `neighbours(x, y, z), neighbours(block), neighbours(l(x,y,z))`
|
||||
### `neighbours(pos)`
|
||||
|
||||
Returns the list of 6 neighbouring blocks to the argument. Commonly used with other loop functions like `for`.
|
||||
|
||||
@@ -2361,13 +2362,18 @@ Returns the list of 6 neighbouring blocks to the argument. Commonly used with ot
|
||||
for(neighbours(x,y,z),air(_)) => 4 // number of air blocks around a block
|
||||
</pre>
|
||||
|
||||
### `rect(cx, cy, cz, dx?, dy?, dz?, px?, py?, pz?)`
|
||||
### `rect(centre, range?, positive_range?)`
|
||||
|
||||
returns an iterator, just like `range` function that iterates over rectangular cubarea of blocks. If only center
|
||||
point is specified, it iterates over 27 blocks. If `d` arguments are specified, expands selection by the respective
|
||||
number of blocks in each direction. If `p` arguments are specified, it uses `d` for negative offset, and `p` for positive.
|
||||
Returns an iterator, just like `range` function that iterates over a rectangular area of blocks. If only center
|
||||
point is specified, it iterates over 27 blocks. If `range` arguments are specified, expands selection by the respective
|
||||
number of blocks in each direction. If `positive_range` arguments are specified,
|
||||
it uses `range` for negative offset, and `positive_range` for positive.
|
||||
|
||||
### `diamond(cx, cy, cz, radius?, height?)`
|
||||
`centre` can be defined either as three coordinates, a list of three coords, or a block value.
|
||||
`range` and `positive_range` can have the same representations, just if its a block, it computes the distance to the center
|
||||
as range instead of taking the values as is.`
|
||||
|
||||
### `diamond(centre_pos, radius?, height?)`
|
||||
|
||||
Iterates over a diamond like area of blocks. With no radius and height, its 7 blocks centered around the middle
|
||||
(block + neighbours). With a radius specified, it expands shape on x and z coords, and with a custom height, on y.
|
||||
|
||||
Reference in new issue
Block a user