Skip to content

Commit 05fdf2c

Browse files
committed
Add missing funcs to expressions page.
1 parent 760d5c3 commit 05fdf2c

1 file changed

Lines changed: 20 additions & 5 deletions

File tree

source/usage/other/expressions.rst

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -170,24 +170,39 @@ Functions
170170
Additionally, it provides the following functions:
171171

172172
.. csv-table::
173-
:widths: 6, 15
173+
:widths: 7, 15
174174

175-
"``rotate(x, y, angle)``","Rotates the given coordinate pair by the given angle."
175+
"``rotate(x, y, angle)``","Rotates the given coordinate pair by the given angle, in radians."
176176
"``swap(x, y)``","Swaps the contents of the 2 given variables."
177177
"``random()``","Returns a random positive number less than 1.0."
178178
"``randint(max)``","Returns a random positive integer less than max."
179+
"``perlin(seed, x, y, z, frequency, octaves, persisence)``","Generates perlin noise with the given parameters."
180+
"``voronoi(seed, x, y, z, frequency)``","Generates voronoi noise with the given parameters."
181+
"``ridgedmulti(seed, x, y, z, frequency, octaves)``","Generated ridged multi fractal noise with the given parameters."
179182

180183
.. topic:: Block Query Functions
181184

182-
The following functions can be used to query blocks in a world in an editting context.
185+
The following functions can be used to query blocks in a world in an editing context. Note that they still use legacy ID and data, so they may have undefined behaviors for new (1.13+) blocks.
183186

184187
.. csv-table::
185188
:widths: 8, 13
186189

187-
"``query(x, y, z, type, data)``","Returns true, if the block at the given coordinates has the given type and data value. If possible, the type and data of the block will be assigned to type and data."
188-
"``queryRel(dx, dy, dz, type, data)``","Like query, except with relative world coordinates"
190+
"``query(x, y, z, type, data)``","Returns true if the block at the given coordinates has the given legacy id and data value. If type or data are variables, the id and data of the block will be assigned to that variable."
191+
"``queryRel(dx, dy, dz, type, data)``","Like query, except with an offset from the currently evaluated block coordinates"
189192
"``queryAbs(xp, yp, zp, type, data)``","Like query, except with absolute world coordinates"
190193

194+
.. topic:: Buffer Functions
195+
196+
These functions provide access to data buffers (essentially, arrays). Two buffers are provided, one is a global shared buffer, and one is local to the expression. The function with `g` prepended accesses the global buffer, without the `g` accesses the local buffer.
197+
198+
.. csv-table::
199+
:widths: 8, 13
200+
201+
"``(g)megabuf(index)``","Returns the value of the buffer at the given index."
202+
"``(g)megabuf(index, value)``","Sets the value of the buffer at the given index."
203+
"``(g)closest(x, y, z, index, count, stride)``","Finds the index of the closest set of x,y,z values (as in, three consecutive buffer values) to the given x,y,z values within *count* iterations and *stride* space between each iteration, starting at the given index value."
204+
205+
191206
Constants
192207
~~~~~~~~~
193208

0 commit comments

Comments
 (0)