unify structure info.
This commit is contained in:
1 parent
15ac3edc19
commit
ad43784ad6
6 files changed
+83
-45
No files matched your search
+19
-7
@@ -689,15 +689,22 @@ number('3bar') => null
|
||||
number('2')+number('2') => 4
|
||||
</pre>
|
||||
|
||||
### `str(expr, params? ... ), str(expr, param_list)`
|
||||
### `str(expr)`,`str(expr, params? ... )`, `str(expr, param_list)`
|
||||
|
||||
Returns a formatted string representing expression. Accepts formatting style accepted by `String.format`.
|
||||
Supported types (with `"%?"` syntax):
|
||||
If called with one argument, returns string representation of such value.
|
||||
|
||||
Otherwise, returns a formatted string representing the expression. Arguments for formatting can either be provided as
|
||||
each consecutive parameter, or as a list which then would be the only extra parameter. To format one list argument
|
||||
, you can use `str(list)`, or `str('foo %s', l(list))`.
|
||||
|
||||
Accepts formatting style accepted by `String.format`.
|
||||
Supported types (with `"%<?>"` syntax):
|
||||
|
||||
* `d`, `o`, `x`: integers, octal, hex
|
||||
* `a`, `e`, `f`, `g`: floats
|
||||
* `b`: booleans
|
||||
* `s`: strings
|
||||
* `%%`: '%' character
|
||||
|
||||
<pre>
|
||||
str(null) => null
|
||||
@@ -2069,13 +2076,17 @@ Returns spawn potential at a location (1.16+ only)
|
||||
Checks wordgen eligibility for a structure in a given chunk. If no structure is given, or `null`, then it will check
|
||||
for all structures. If bounding box of the structures is also requested, it will compute size of potential
|
||||
structures. This function, unlike other in the `structure*` category is not using world data nor accesses chunks
|
||||
making it preferred for scoping ungenerated terrain.
|
||||
making it preferred for scoping ungenerated terrain, but it takes some compute money to calculate the structure.
|
||||
|
||||
Unlike `'structure'` this will return a tentative structure location. Random factors in world generation may prevent
|
||||
actual structure from forming.
|
||||
|
||||
If structure is specified, it will return `null` if a chunk is not eligible, `true` if the structure should appear, or
|
||||
a pair of coordinates indicating bounding box of the structure.
|
||||
a map with two values: `'box'` for a pair of coordinates indicating bounding box of the structure, and `'pieces'` for
|
||||
list of elements of the structure (as a tuple), with its name, direction, and box coordinates of the piece.
|
||||
|
||||
If structure is not specified, it will return a set of structure names that are eligible, or a map with structures
|
||||
as keys, and pair of bounding box coordinates as values. An empty set or an empty map would indicate that nothing
|
||||
as keys, and same type of map values as with a single structure call. An empty set or an empty map would indicate that nothing
|
||||
should be generated there.
|
||||
|
||||
|
||||
@@ -2085,7 +2096,8 @@ Returns structure information for a given block position. Note that structure in
|
||||
blocks from the same chunk. `structures` function can be called with a block, or a block and a structure name. In
|
||||
the first case it returns a map of structures at a given position, keyed by structure name, with values indicating
|
||||
the bounding box of the structure - a pair of two 3-value coords (see examples). When called with an extra structure
|
||||
name, returns list of components for that structure, with their name, direction and two sets of coordinates
|
||||
name, returns a map with two values, `'box'` for bounding box of the structure, and `'pieces'` for a list of
|
||||
components for that structure, with their name, direction and two sets of coordinates
|
||||
indicating the bounding box of the structure piece.
|
||||
|
||||
### `structure_references(pos), structure_references(pos, structure_name)`
|
||||
|
||||
Reference in new issue
Block a user