Skip to content

Commit 6767ed7

Browse files
committedMar 24, 2013
Update lua_api.txt
1 parent 57cbb8b commit 6767ed7

File tree

1 file changed

+43
-1
lines changed

1 file changed

+43
-1
lines changed
 

‎doc/lua_api.txt

+43-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Minetest Lua Modding API Reference 0.4.4
1+
Minetest Lua Modding API Reference 0.4.5
22
==========================================
33
More information at http://c55.me/minetest/
44

@@ -372,6 +372,25 @@ A box is defined as:
372372
A box of a regular node would look like:
373373
{-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
374374

375+
Ore types
376+
---------------
377+
These tell in what manner the ore is generated.
378+
All default ores are of the uniformly-distributed scatter type.
379+
380+
- scatter
381+
Randomly chooses a location and generates a cluster of ore.
382+
If noise_params is specified, the ore will be placed if the 3d perlin noise at
383+
that point is greater than the noise_threshhold, giving the ability to create a non-equal
384+
distribution of ore.
385+
- sheet
386+
Creates a sheet of ore in a blob shape according to the 2d perlin noise described by
387+
the noise_params structure. The height of the blob is randomly scattered, with a maximum
388+
height of clust_size. Here, clust_scarcity and clust_num_ores are ignored.
389+
This is essentially an improved version of the so-called "stratus" ore seen in some unofficial mods.
390+
- claylike - NOT YET IMPLEMENTED
391+
Places ore if there are no more than clust_scarcity number of specified nodes within a Von Neumann
392+
neighborhood of clust_size radius.
393+
375394
Representations of simple things
376395
--------------------------------
377396
Position/vector:
@@ -844,6 +863,7 @@ minetest.register_tool(name, item definition)
844863
minetest.register_craftitem(name, item definition)
845864
minetest.register_alias(name, convert_to)
846865
minetest.register_craft(recipe)
866+
minetest.register_ore(ore definition)
847867

848868
Global callback registration functions: (Call these only at load time)
849869
minetest.register_globalstep(func(dtime))
@@ -1669,6 +1689,28 @@ Recipe for register_craft (furnace fuel)
16691689
burntime = 1,
16701690
}
16711691

1692+
Ore definition (register_ore)
1693+
{
1694+
ore_type = "scatter" -- See "Ore types"
1695+
ore = "default:stone_with_coal",
1696+
wherein = "default:stone",
1697+
clust_scarcity = 8*8*8,
1698+
^ Ore has a 1 out of clust_scarcity chance of spawning in a node
1699+
^ This value should be *MUCH* higher than your intuition might tell you!
1700+
clust_num_ores = 8,
1701+
^ Number of ores in a cluster
1702+
clust_size = 3,
1703+
^ Size of the bounding box of the cluster
1704+
^ In this example, there is a 3x3x3 cluster where 8 out of the 27 nodes are coal ore
1705+
height_min = -31000,
1706+
height_max = 64,
1707+
noise_threshhold = 0.5,
1708+
^ If noise is above this threshhold, ore is placed. Not needed for a uniform distribution
1709+
noise_params = {offset=0, scale=1, spread={x=100, y=100, z=100}, seed=23, octaves=3, persist=0.70}
1710+
^ NoiseParams structure describing the perlin noise used for ore distribution.
1711+
^ Needed for sheet ore_type. Omit from scatter ore_type for a uniform ore distribution
1712+
}
1713+
16721714
Chatcommand definition (register_chatcommand)
16731715
{
16741716
params = "<name> <privilege>", -- short parameter description

0 commit comments

Comments
 (0)
Please sign in to comment.