|
1 |
| -Minetest Lua Modding API Reference 0.4.4 |
| 1 | +Minetest Lua Modding API Reference 0.4.5 |
2 | 2 | ==========================================
|
3 | 3 | More information at http://c55.me/minetest/
|
4 | 4 |
|
@@ -372,6 +372,25 @@ A box is defined as:
|
372 | 372 | A box of a regular node would look like:
|
373 | 373 | {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
|
374 | 374 |
|
| 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 | + |
375 | 394 | Representations of simple things
|
376 | 395 | --------------------------------
|
377 | 396 | Position/vector:
|
@@ -844,6 +863,7 @@ minetest.register_tool(name, item definition)
|
844 | 863 | minetest.register_craftitem(name, item definition)
|
845 | 864 | minetest.register_alias(name, convert_to)
|
846 | 865 | minetest.register_craft(recipe)
|
| 866 | +minetest.register_ore(ore definition) |
847 | 867 |
|
848 | 868 | Global callback registration functions: (Call these only at load time)
|
849 | 869 | minetest.register_globalstep(func(dtime))
|
@@ -1669,6 +1689,28 @@ Recipe for register_craft (furnace fuel)
|
1669 | 1689 | burntime = 1,
|
1670 | 1690 | }
|
1671 | 1691 |
|
| 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 | + |
1672 | 1714 | Chatcommand definition (register_chatcommand)
|
1673 | 1715 | {
|
1674 | 1716 | params = "<name> <privilege>", -- short parameter description
|
|
0 commit comments