minetest.register ore

Syntax

 * ore_def A table describing how the ore should generate

Description
Registers an ore to generate, this replaces default.generate_ore.

The replacements happens in the order they are registered one after an other. So if the first registered generator turns some node into an other that can be transformed by the second, the replaced nodes by the first generator are valid candidates for the second one.

The ore_def table contains:

The NoiseParams table is mandatory for the sheet ore type, it can also be specified for the scatter type, if it is not specified ores will be distributed evenly.

The structure is in the format:

Ore types
These tell in what manner the ore is generated. All default ores are of the uniformly-distributed scatter type.

scatter
Randomly chooses a location and generates a cluster of ore. If noise_params is specified, the ore will be placed if the 3d perlin noise at 	that point is greater than the noise_threshhold, giving the ability to create a non-equal distribution of ore.

sheet
Creates a sheet of ore in a blob shape according to the 2D perlin noise described by `noise_params` and `noise_threshold`. This is essentially an improved version of the so-called "stratus" ore seen in some unofficial mods.

This sheet consists of vertical columns of uniform randomly distributed height, varying between the inclusive range `column_height_min` and `column_height_max`. If `column_height_min` is not specified, this parameter defaults to 1. If `column_height_max` is not specified, this parameter defaults to `clust_size` for reverse compatibility. New code should prefer `column_height_max`.

The `column_midpoint_factor` parameter controls the position of the column at which ore eminates from. If 1, columns grow upward. If 0, columns grow downward. If 0.5, columns grow equally starting from each direction. `column_midpoint_factor` is a	decimal number ranging in value from 0 to 1. If this parameter is not specified, the default is 0.5.

The ore parameters `clust_scarcity` and `clust_num_ores` are ignored for this ore type.

puff
Creates a sheet of ore in a cloud-like puff shape.

As with the `sheet` ore type, the size and shape of puffs are described by	`noise_params` and `noise_threshold` and are placed at random vertical positions within the currently generated chunk.

The vertical top and bottom displacement of each puff are determined by the noise parameters `np_puff_top` and `np_puff_bottom`, respectively.

blob
Creates a deformed sphere blobs of ore according to 3d perlin noise described by noise_params. The maximum size of the blob is clust_size, and clust_scarcity has the same meaning as with scatter type.

vein
Creates veins of ore varying in density by according to the intersection of two instances 3d perlin noise with diffferent seeds both described by noise_params. random_factor varies the influence random chance has on placement of an ore inside the vein, which is 1 by default. Note that modifying this parameter may require adjusting noise_threshhold. The parameters clust_scarcity, clust_num_ores, and clust_size are ignored by this ore type. This ore type is difficult to control since it is sensitive to small changes. The following is a decent set of parameters to work from: WARNING: Use this ore type *very* sparingly since it is ~200x more computationally expensive than any other ore.

Ore attributes
See section "Flag Specifier Format".

Currently supported flags: `absheight`

absheight
Also produce this same ore between the height range of `-y_max` and `-y_min`.

Useful for having ore in sky realms without having to duplicate ore entries.

puff_cliffs
If set, puff ore generation will not taper down large differences in displacement when approaching the edge of a puff. This flag has no effect for ore types other than `puff`.

puff_additive_composition
By default, when noise described by `np_puff_top` or `np_puff_bottom` results in a negative displacement, the sub-column at that point is not generated. With this attribute set, puff ore generation will instead generate the absolute difference in noise displacement values. This flag has no effect for ore types other than `puff`.