mirror of
https://github.com/mt-mods/plantlife_modpack.git
synced 2024-11-15 23:00:38 +01:00
Updated API.txt to accoutn for the latest updates
This commit is contained in:
parent
e8ade417ee
commit
3c9fcf3bfc
26
API.txt
26
API.txt
|
@ -114,16 +114,18 @@ checking is disabled. Same holds true for the nneighbors bit above that.
|
||||||
-----
|
-----
|
||||||
|
|
||||||
To register a plant to be spawned at mapgen time rather than via an ABM, call
|
To register a plant to be spawned at mapgen time rather than via an ABM, call
|
||||||
this function:
|
this function with two parameters: a table with the biome information, and
|
||||||
|
a string or table describing what to execute if the engine finds a suitable
|
||||||
|
node (see below):
|
||||||
|
|
||||||
plantslib:register_generate_plant(biome)
|
plantslib:register_generate_plant(biome, function_or_treedef)
|
||||||
|
|
||||||
Where "biome" is a table containing about a dozen variables:
|
Where "biome" is a table containing about a dozen variables:
|
||||||
|
|
||||||
biome = {
|
biome = {
|
||||||
surface = "string", -- [*] what nodes to spawn on.
|
surface = "string", -- [*] what nodes to spawn on.
|
||||||
avoid = {table}, -- [*] what nodes to avoid when spawning.
|
avoid_nodes = {table}, -- [*] what nodes to avoid when spawning.
|
||||||
radius = num, -- [*] how much distance to leave between
|
avoid_radius = num, -- [*] how much distance to leave between
|
||||||
the object to be added and the objects
|
the object to be added and the objects
|
||||||
to be avoided.
|
to be avoided.
|
||||||
seed_diff = num, -- perlin seed-diff value. Defaults to 0,
|
seed_diff = num, -- perlin seed-diff value. Defaults to 0,
|
||||||
|
@ -155,18 +157,22 @@ biome = {
|
||||||
allowable temperature).
|
allowable temperature).
|
||||||
temp_max = num, -- maximum perlin temperature value (coldest
|
temp_max = num, -- maximum perlin temperature value (coldest
|
||||||
allowable temperature).
|
allowable temperature).
|
||||||
exec_funct = "string", -- [**] name of the function to use to
|
|
||||||
actually build the object if the code
|
|
||||||
decides it is time to do so.
|
|
||||||
}
|
}
|
||||||
|
|
||||||
[*] These entries are required for the spawn code to work. Everything else
|
[*] These entries are required for the spawn code to work. Everything else
|
||||||
is optional. Unless explicitly stated, all unused/unsupplied parameters
|
is optional. Unless explicitly stated, all unused/unsupplied parameters
|
||||||
default to nil and will not affect the results of the code.
|
default to nil and will not affect the results of the code.
|
||||||
|
|
||||||
[**] A string indicating the name of the function that should be called if a
|
Regarding function_or_treedef, this must either be a string indicating the
|
||||||
suitable spawn location has been found. This function will be passed a
|
name of the function that should be called if a suitable spawn location has
|
||||||
single parameter, pos, indicating where the object should be placed.
|
been found, OR a table with an L-Systems tree definition.
|
||||||
|
|
||||||
|
If you specify a string with a function name, that function will be passed a
|
||||||
|
single position parameter (in the usual table format), indicating where the
|
||||||
|
object should be placed. If you specified an L-Systems tree definition, then
|
||||||
|
that definition will be passed directly to the spawn_tree() function along
|
||||||
|
with the position to spawn the tree on.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user