1269




worldeditadditions 🔗

WorldEditAdditions Lua API

This is the documentation for the Lua API of WorldEditAdditions. It was generated automatically from comments spread across the codebase with moondoc.

Current version: 1.15-dev

These docs are a work-in-progress. Not all functions are documented here yet. If anything is unclear, please open an issue.

© 2023 Starbeamrainbowlabs and contributors. Licenced under the Mozilla Public License 2.0.


noise 🔗

System to manipulate the world using noise generation functions.


engines 🔗

Noise generation algorithm engines.


Perlin 🔗

Perlin noise generation engine. Original code by Ken Perlin: http://mrl.nyu.edu/~perlin/noise/ Port from this StackOverflow answer: https://stackoverflow.com/a/33425812/1460422

Functions

new 🔗

Creates a new Perlin instance.

Arguments

NameTypeDefault valueDescription

Returns

Perlin :

A new perlin instance.

Source
--- Creates a new Perlin instance.
-- @return	Perlin	A new perlin instance.
function Perlin.new()
{
	"type": "function",
	"internal": false,
	"description": "Creates a new Perlin instance.",
	"directives": [
		{
			"directive": "returns",
			"text": "Perlin\tA new perlin instance.",
			"type": "Perlin",
			"description": "A new perlin instance."
		}
	],
	"line": 35,
	"namespace": "worldeditadditions.noise.engines.Perlin",
	"line_last": 37,
	"name": "new",
	"instanced": false,
	"args": [
		""
	],
	"text": "--- Creates a new Perlin instance.\n-- @return\tPerlin\tA new perlin instance.\nfunction Perlin.new()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "Perlin\tA new perlin instance.",
		"type": "Perlin",
		"description": "A new perlin instance."
	},
	"name_full": "worldeditadditions.noise.engines.Perlin.new",
	"filename": "worldeditadditions/lib/noise/engines/perlin.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/noise/engines/perlin.lua#L36-L38"
}

noise 🔗

Returns a noise value for a given point in 3D space.

Arguments

NameTypeDefault valueDescription
xnumbernil

The x co-ordinate.

ynumbernil

The y co-ordinate.

znumbernil

The z co-ordinate.

Returns

number :

The calculated noise value.

Source
--- Returns a noise value for a given point in 3D space.
-- @param	x	number	The x co-ordinate.
-- @param	y	number	The y co-ordinate.
-- @param	z	number	The z co-ordinate.
-- @returns	number		The calculated noise value.
function Perlin:noise( x, y, z )
{
	"type": "function",
	"internal": false,
	"description": "Returns a noise value for a given point in 3D space.",
	"directives": [
		{
			"directive": "param",
			"text": "x\tnumber\tThe x co-ordinate.",
			"name": "x",
			"type": "number",
			"description": "The x co-ordinate."
		},
		{
			"directive": "param",
			"text": "y\tnumber\tThe y co-ordinate.",
			"name": "y",
			"type": "number",
			"description": "The y co-ordinate."
		},
		{
			"directive": "param",
			"text": "z\tnumber\tThe z co-ordinate.",
			"name": "z",
			"type": "number",
			"description": "The z co-ordinate."
		},
		{
			"directive": "returns",
			"text": "number\t\tThe calculated noise value.",
			"type": "number",
			"description": "The calculated noise value."
		}
	],
	"line": 54,
	"namespace": "worldeditadditions.noise.engines.Perlin",
	"line_last": 59,
	"name": "noise",
	"instanced": true,
	"args": [
		" x",
		"y",
		"z "
	],
	"text": "--- Returns a noise value for a given point in 3D space.\n-- @param\tx\tnumber\tThe x co-ordinate.\n-- @param\ty\tnumber\tThe y co-ordinate.\n-- @param\tz\tnumber\tThe z co-ordinate.\n-- @returns\tnumber\t\tThe calculated noise value.\nfunction Perlin:noise( x, y, z )",
	"params": [
		{
			"directive": "param",
			"text": "x\tnumber\tThe x co-ordinate.",
			"name": "x",
			"type": "number",
			"description": "The x co-ordinate."
		},
		{
			"directive": "param",
			"text": "y\tnumber\tThe y co-ordinate.",
			"name": "y",
			"type": "number",
			"description": "The y co-ordinate."
		},
		{
			"directive": "param",
			"text": "z\tnumber\tThe z co-ordinate.",
			"name": "z",
			"type": "number",
			"description": "The z co-ordinate."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\tThe calculated noise value.",
		"type": "number",
		"description": "The calculated noise value."
	},
	"name_full": "worldeditadditions.noise.engines.Perlin.noise",
	"filename": "worldeditadditions/lib/noise/engines/perlin.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/noise/engines/perlin.lua#L55-L60"
}

sculpt 🔗

Sculpting brush engine.


brushes 🔗

Brushes for use with the sculpting system. Dump your own in the directory worldeditadditions/lib/sculpt/brushes (relative to the WorldEditAdditions git repository root), and WorldEditAdditions will automatically read them!

See the documentation for more information: <https://worldeditadditions.mooncarrot.space/Reference/#sculpt>

Functions

circle 🔗

Makes a circle brush of a given size. Default inbuilt brush.

Arguments

NameTypeDefault valueDescription
sizeVector3nil

The desired sizez of the brush (only X and Y are considered; Z is ignored).

Returns

bool,brush,Vector3 :

Success bool, then the brush, then finally the actual size of the brush generated.

Source
--- Makes a circle brush of a given size.
-- Default inbuilt brush.
-- @name	circle
-- @param	size	Vector3		The desired sizez of the brush (only X and Y are considered; Z is ignored).
-- @returns	bool,brush,Vector3	Success bool, then the brush, then finally the actual size of the brush generated.
return function(size)
{
	"type": "function",
	"internal": false,
	"description": "Makes a circle brush of a given size.\nDefault inbuilt brush.",
	"directives": [
		{
			"directive": "name",
			"text": "circle"
		},
		{
			"directive": "param",
			"text": "size\tVector3\t\tThe desired sizez of the brush (only X and Y are considered; Z is ignored).",
			"name": "size",
			"type": "Vector3",
			"description": "The desired sizez of the brush (only X and Y are considered; Z is ignored)."
		},
		{
			"directive": "returns",
			"text": "bool,brush,Vector3\tSuccess bool, then the brush, then finally the actual size of the brush generated.",
			"type": "bool,brush,Vector3",
			"description": "Success bool, then the brush, then finally the actual size of the brush generated."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions.sculpt.brushes",
	"line_last": 11,
	"name": "circle",
	"instanced": false,
	"args": [
		"size"
	],
	"text": "--- Makes a circle brush of a given size.\n-- Default inbuilt brush.\n-- @name\tcircle\n-- @param\tsize\tVector3\t\tThe desired sizez of the brush (only X and Y are considered; Z is ignored).\n-- @returns\tbool,brush,Vector3\tSuccess bool, then the brush, then finally the actual size of the brush generated.\nreturn function(size)",
	"params": [
		{
			"directive": "param",
			"text": "size\tVector3\t\tThe desired sizez of the brush (only X and Y are considered; Z is ignored).",
			"name": "size",
			"type": "Vector3",
			"description": "The desired sizez of the brush (only X and Y are considered; Z is ignored)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,brush,Vector3\tSuccess bool, then the brush, then finally the actual size of the brush generated.",
		"type": "bool,brush,Vector3",
		"description": "Success bool, then the brush, then finally the actual size of the brush generated."
	},
	"name_full": "worldeditadditions.sculpt.brushes.circle",
	"filename": "worldeditadditions/lib/sculpt/brushes/circle.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/brushes/circle.lua#L7-L12"
}

make_gaussian 🔗

Returns a smooth gaussian brush.

Arguments

NameTypeDefault valueDescription
sizeVector3nil

The target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations.

sigmanumber2

The 'smoothness' of the brush. Higher values are more smooth.

Returns

nil

Source
--- Returns a smooth gaussian brush.
-- @name make_gaussian
-- @internal
-- @param	size	Vector3		The target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations.
-- @param	sigma=2	number		The 'smoothness' of the brush. Higher values are more smooth.
return function(size, sigma)
{
	"type": "function",
	"internal": true,
	"description": "Returns a smooth gaussian brush.",
	"directives": [
		{
			"directive": "name",
			"text": "make_gaussian"
		},
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "size\tVector3\t\tThe target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations.",
			"name": "size",
			"type": "Vector3",
			"description": "The target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations."
		},
		{
			"directive": "param",
			"text": "sigma=2\tnumber\t\tThe 'smoothness' of the brush. Higher values are more smooth.",
			"name": "sigma",
			"type": "number",
			"description": "The 'smoothness' of the brush. Higher values are more smooth.",
			"default_value": "2"
		}
	],
	"line": 7,
	"namespace": "worldeditadditions.sculpt.brushes",
	"line_last": 12,
	"name": "make_gaussian",
	"instanced": false,
	"args": [
		"size",
		"sigma"
	],
	"text": "--- Returns a smooth gaussian brush.\n-- @name make_gaussian\n-- @internal\n-- @param\tsize\tVector3\t\tThe target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations.\n-- @param\tsigma=2\tnumber\t\tThe 'smoothness' of the brush. Higher values are more smooth.\nreturn function(size, sigma)",
	"params": [
		{
			"directive": "param",
			"text": "size\tVector3\t\tThe target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations.",
			"name": "size",
			"type": "Vector3",
			"description": "The target size of the brush. Note that the actual size of the brush will be different, as the gaussian function has some limitations."
		},
		{
			"directive": "param",
			"text": "sigma=2\tnumber\t\tThe 'smoothness' of the brush. Higher values are more smooth.",
			"name": "sigma",
			"type": "number",
			"description": "The 'smoothness' of the brush. Higher values are more smooth.",
			"default_value": "2"
		}
	],
	"name_full": "worldeditadditions.sculpt.brushes.make_gaussian",
	"filename": "worldeditadditions/lib/sculpt/brushes/__gaussian.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/brushes/__gaussian.lua#L8-L13"
}

square 🔗

Returns a simple square brush with 100% weight for every pixel. Default inbuilt brush.

Arguments

NameTypeDefault valueDescription
sizeVector3nil

The desired size of the brush. Only the x and y components are used; the z component is ignored.

Returns

bool,number[],Vector3 :

1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.

Source
--- Returns a simple square brush with 100% weight for every pixel.
-- Default inbuilt brush.
-- @name square
-- @param	size		Vector3		The desired size of the brush. Only the x and y components are used; the z component is ignored.
-- @returns bool,number[],Vector3	1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.
return function(size)
{
	"type": "function",
	"internal": false,
	"description": "Returns a simple square brush with 100% weight for every pixel.\nDefault inbuilt brush.",
	"directives": [
		{
			"directive": "name",
			"text": "square"
		},
		{
			"directive": "param",
			"text": "size\t\tVector3\t\tThe desired size of the brush. Only the x and y components are used; the z component is ignored.",
			"name": "size",
			"type": "Vector3",
			"description": "The desired size of the brush. Only the x and y components are used; the z component is ignored."
		},
		{
			"directive": "returns",
			"text": "bool,number[],Vector3\t1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.",
			"type": "bool,number[],Vector3",
			"description": "1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components."
		}
	],
	"line": 3,
	"namespace": "worldeditadditions.sculpt.brushes",
	"line_last": 8,
	"name": "square",
	"instanced": false,
	"args": [
		"size"
	],
	"text": "--- Returns a simple square brush with 100% weight for every pixel.\n-- Default inbuilt brush.\n-- @name square\n-- @param\tsize\t\tVector3\t\tThe desired size of the brush. Only the x and y components are used; the z component is ignored.\n-- @returns bool,number[],Vector3\t1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.\nreturn function(size)",
	"params": [
		{
			"directive": "param",
			"text": "size\t\tVector3\t\tThe desired size of the brush. Only the x and y components are used; the z component is ignored.",
			"name": "size",
			"type": "Vector3",
			"description": "The desired size of the brush. Only the x and y components are used; the z component is ignored."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,number[],Vector3\t1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components.",
		"type": "bool,number[],Vector3",
		"description": "1: true, as this function always succeeds. 2: A simple square brush as a zero-indexed flat array. 3: The size of the resulting brush as a Vector3, using the x and y components."
	},
	"name_full": "worldeditadditions.sculpt.brushes.square",
	"filename": "worldeditadditions/lib/sculpt/brushes/square.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/brushes/square.lua#L4-L9"
}

Functions

apply 🔗

Applies the given brush with the given height and size to the given position.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The position at which to apply the brush.

brush_namestringnil

The name of the brush to apply.

brush_sizeVector3nil

The size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!

heightnumbernil

The height of the brush application.

Returns

bool, string|{ added: number, removed: number } :

A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).

Source
--- Applies the given brush with the given height and size to the given position.
-- @param	pos1		Vector3		The position at which to apply the brush.
-- @param	brush_name	string		The name of the brush to apply.
-- @param	brush_size	Vector3		The size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!
-- @param	height		number		The height of the brush application.
-- @returns	bool, string|{ added: number, removed: number }	A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).
local function apply(pos1, brush_name, brush_size, height)
{
	"type": "function",
	"internal": false,
	"description": "Applies the given brush with the given height and size to the given position.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe position at which to apply the brush.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position at which to apply the brush."
		},
		{
			"directive": "param",
			"text": "brush_name\tstring\t\tThe name of the brush to apply.",
			"name": "brush_name",
			"type": "string",
			"description": "The name of the brush to apply."
		},
		{
			"directive": "param",
			"text": "brush_size\tVector3\t\tThe size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!",
			"name": "brush_size",
			"type": "Vector3",
			"description": "The size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!"
		},
		{
			"directive": "param",
			"text": "height\t\tnumber\t\tThe height of the brush application.",
			"name": "height",
			"type": "number",
			"description": "The height of the brush application."
		},
		{
			"directive": "returns",
			"text": "bool, string|{ added: number, removed: number }\tA bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).",
			"type": "bool, string|{ added: number, removed: number }",
			"description": "A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful)."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 13,
	"name": "apply",
	"instanced": false,
	"args": [
		"pos1",
		"brush_name",
		"brush_size",
		"height"
	],
	"text": "--- Applies the given brush with the given height and size to the given position.\n-- @param\tpos1\t\tVector3\t\tThe position at which to apply the brush.\n-- @param\tbrush_name\tstring\t\tThe name of the brush to apply.\n-- @param\tbrush_size\tVector3\t\tThe size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!\n-- @param\theight\t\tnumber\t\tThe height of the brush application.\n-- @returns\tbool, string|{ added: number, removed: number }\tA bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).\nlocal function apply(pos1, brush_name, brush_size, height)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe position at which to apply the brush.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position at which to apply the brush."
		},
		{
			"directive": "param",
			"text": "brush_name\tstring\t\tThe name of the brush to apply.",
			"name": "brush_name",
			"type": "string",
			"description": "The name of the brush to apply."
		},
		{
			"directive": "param",
			"text": "brush_size\tVector3\t\tThe size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!",
			"name": "brush_size",
			"type": "Vector3",
			"description": "The size of the brush application. Values are interpreted on the X/Y coordinates, and NOT X/Z!"
		},
		{
			"directive": "param",
			"text": "height\t\tnumber\t\tThe height of the brush application.",
			"name": "height",
			"type": "number",
			"description": "The height of the brush application."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool, string|{ added: number, removed: number }\tA bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).",
		"type": "bool, string|{ added: number, removed: number }",
		"description": "A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful)."
	},
	"name_full": "worldeditadditions.sculpt.apply",
	"filename": "worldeditadditions/lib/sculpt/apply.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/apply.lua#L8-L14"
}

apply_heightmap 🔗

Applies the given brush at the given x/z position to the given heightmap. Important: Where a Vector3 is mentioned in the parameter list, it reall MUST be a Vector3 instance. Also important: Remember that the position there is RELATIVE TO THE HEIGHTMAP'S origin (0, 0) and is on the X and Z axes!

Arguments

NameTypeDefault valueDescription
brushtablenil

The ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1.

brush_sizeVector3nil

The size of the brush on the x/y axes.

positionVector3nil

The position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on.

heightmaptablenil

The heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these.

heightmap_sizeVector3nil

The size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information.

Returns

true,number,number|false,string :

If the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed.

Source
--- Applies the given brush at the given x/z position to the given heightmap.
-- Important: Where a Vector3 is mentioned in the parameter list, it reall MUST
-- be a Vector3 instance.
-- Also important: Remember that the position there is RELATIVE TO THE HEIGHTMAP'S origin (0, 0) and is on the X and Z axes!
-- @param	brush			table	The ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1.
-- @param	brush_size		Vector3	The size of the brush on the x/y axes.
-- @pram	height			number	The multiplier to apply to each brush pixel value just before applying it. Negative values are allowed - this will cause a subtraction operation instead of an addition.
-- @param	position		Vector3	The position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on.
-- @param	heightmap		table	The heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these.
-- @param	heightmap_size	Vector3	The size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information.
-- @returns	true,number,number|false,string		If the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed.
local function apply_heightmap(brush, brush_size, height, position, heightmap, heightmap_size)
{
	"type": "function",
	"internal": false,
	"description": "Applies the given brush at the given x/z position to the given heightmap.\nImportant: Where a Vector3 is mentioned in the parameter list, it reall MUST\nbe a Vector3 instance.\nAlso important: Remember that the position there is RELATIVE TO THE HEIGHTMAP'S origin (0, 0) and is on the X and Z axes!",
	"directives": [
		{
			"directive": "param",
			"text": "brush\t\t\ttable\tThe ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1.",
			"name": "brush",
			"type": "table",
			"description": "The ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1."
		},
		{
			"directive": "param",
			"text": "brush_size\t\tVector3\tThe size of the brush on the x/y axes.",
			"name": "brush_size",
			"type": "Vector3",
			"description": "The size of the brush on the x/y axes."
		},
		{
			"directive": "pram",
			"text": "height\t\t\tnumber\tThe multiplier to apply to each brush pixel value just before applying it. Negative values are allowed - this will cause a subtraction operation instead of an addition."
		},
		{
			"directive": "param",
			"text": "position\t\tVector3\tThe position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on.",
			"name": "position",
			"type": "Vector3",
			"description": "The position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on."
		},
		{
			"directive": "param",
			"text": "heightmap\t\ttable\tThe heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these.",
			"name": "heightmap",
			"type": "table",
			"description": "The heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tVector3\tThe size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information.",
			"name": "heightmap_size",
			"type": "Vector3",
			"description": "The size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information."
		},
		{
			"directive": "returns",
			"text": "true,number,number|false,string\t\tIf the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed.",
			"type": "true,number,number|false,string",
			"description": "If the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 18,
	"name": "apply_heightmap",
	"instanced": false,
	"args": [
		"brush",
		"brush_size",
		"height",
		"position",
		"heightmap",
		"heightmap_size"
	],
	"text": "--- Applies the given brush at the given x/z position to the given heightmap.\n-- Important: Where a Vector3 is mentioned in the parameter list, it reall MUST\n-- be a Vector3 instance.\n-- Also important: Remember that the position there is RELATIVE TO THE HEIGHTMAP'S origin (0, 0) and is on the X and Z axes!\n-- @param\tbrush\t\t\ttable\tThe ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1.\n-- @param\tbrush_size\t\tVector3\tThe size of the brush on the x/y axes.\n-- @pram\theight\t\t\tnumber\tThe multiplier to apply to each brush pixel value just before applying it. Negative values are allowed - this will cause a subtraction operation instead of an addition.\n-- @param\tposition\t\tVector3\tThe position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on.\n-- @param\theightmap\t\ttable\tThe heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these.\n-- @param\theightmap_size\tVector3\tThe size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information.\n-- @returns\ttrue,number,number|false,string\t\tIf the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed.\nlocal function apply_heightmap(brush, brush_size, height, position, heightmap, heightmap_size)",
	"params": [
		{
			"directive": "param",
			"text": "brush\t\t\ttable\tThe ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1.",
			"name": "brush",
			"type": "table",
			"description": "The ZERO-indexed brush to apply. Values should be normalised to be between 0 and 1."
		},
		{
			"directive": "param",
			"text": "brush_size\t\tVector3\tThe size of the brush on the x/y axes.",
			"name": "brush_size",
			"type": "Vector3",
			"description": "The size of the brush on the x/y axes."
		},
		{
			"directive": "param",
			"text": "position\t\tVector3\tThe position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on.",
			"name": "position",
			"type": "Vector3",
			"description": "The position RELATIVE TO THE HEIGHTMAP on the x/z coordinates to centre the brush application on."
		},
		{
			"directive": "param",
			"text": "heightmap\t\ttable\tThe heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these.",
			"name": "heightmap",
			"type": "table",
			"description": "The heightmap to apply the brush to. See worldeditadditions.make_heightmap for how to obtain one of these."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tVector3\tThe size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information.",
			"name": "heightmap_size",
			"type": "Vector3",
			"description": "The size of the aforementioned heightmap. See worldeditadditions.make_heightmap for more information."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "true,number,number|false,string\t\tIf the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed.",
		"type": "true,number,number|false,string",
		"description": "If the operation was not successful, then false followed by an error message as a string is returned. If it was successful however, 3 values are returned: true, then the number of nodes added, then the number of nodes removed."
	},
	"name_full": "worldeditadditions.sculpt.apply_heightmap",
	"filename": "worldeditadditions/lib/sculpt/apply_heightmap.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/apply_heightmap.lua#L8-L19"
}

import_static 🔗

Reads and parses the brush stored in the specified file.

Arguments

NameTypeDefault valueDescription
filepathstringnil

The path to file that contains the static brush to read in.

Returns

true,table,Vector3|false,string :

A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)

Source
--- Reads and parses the brush stored in the specified file.
-- @name import_static
-- @internal
-- @param	filepath	string		The path to file that contains the static brush to read in.
-- @returns	true,table,Vector3|false,string		A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)
return function(filepath)
{
	"type": "function",
	"internal": true,
	"description": "Reads and parses the brush stored in the specified file.",
	"directives": [
		{
			"directive": "name",
			"text": "import_static"
		},
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "filepath\tstring\t\tThe path to file that contains the static brush to read in.",
			"name": "filepath",
			"type": "string",
			"description": "The path to file that contains the static brush to read in."
		},
		{
			"directive": "returns",
			"text": "true,table,Vector3|false,string\t\tA success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)",
			"type": "true,table,Vector3|false,string",
			"description": "A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)"
		}
	],
	"line": 7,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 12,
	"name": "import_static",
	"instanced": false,
	"args": [
		"filepath"
	],
	"text": "--- Reads and parses the brush stored in the specified file.\n-- @name import_static\n-- @internal\n-- @param\tfilepath\tstring\t\tThe path to file that contains the static brush to read in.\n-- @returns\ttrue,table,Vector3|false,string\t\tA success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)\nreturn function(filepath)",
	"params": [
		{
			"directive": "param",
			"text": "filepath\tstring\t\tThe path to file that contains the static brush to read in.",
			"name": "filepath",
			"type": "string",
			"description": "The path to file that contains the static brush to read in."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "true,table,Vector3|false,string\t\tA success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)",
		"type": "true,table,Vector3|false,string",
		"description": "A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)"
	},
	"name_full": "worldeditadditions.sculpt.import_static",
	"filename": "worldeditadditions/lib/sculpt/import_static.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/import_static.lua#L8-L13"
}

make_brush 🔗

Makes a sculpting brush that is as close to a target size as possible.

Arguments

NameTypeDefault valueDescription
brush_namestringnil

The name of the brush to create.

target_sizeVector3nil

The target size of the brush to create.

Returns

true,table,Vector3|false,string :

If the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead.

Source
--- Makes a sculpting brush that is as close to a target size as possible.
-- @param	brush_name	string	The name of the brush to create.
-- @param	target_size	Vector3	The target size of the brush to create.
-- @returns	true,table,Vector3|false,string	If the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead.
local function make_brush(brush_name, target_size)
{
	"type": "function",
	"internal": false,
	"description": "Makes a sculpting brush that is as close to a target size as possible.",
	"directives": [
		{
			"directive": "param",
			"text": "brush_name\tstring\tThe name of the brush to create.",
			"name": "brush_name",
			"type": "string",
			"description": "The name of the brush to create."
		},
		{
			"directive": "param",
			"text": "target_size\tVector3\tThe target size of the brush to create.",
			"name": "target_size",
			"type": "Vector3",
			"description": "The target size of the brush to create."
		},
		{
			"directive": "returns",
			"text": "true,table,Vector3|false,string\tIf the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead.",
			"type": "true,table,Vector3|false,string",
			"description": "If the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead."
		}
	],
	"line": 5,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 9,
	"name": "make_brush",
	"instanced": false,
	"args": [
		"brush_name",
		"target_size"
	],
	"text": "--- Makes a sculpting brush that is as close to a target size as possible.\n-- @param\tbrush_name\tstring\tThe name of the brush to create.\n-- @param\ttarget_size\tVector3\tThe target size of the brush to create.\n-- @returns\ttrue,table,Vector3|false,string\tIf the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead.\nlocal function make_brush(brush_name, target_size)",
	"params": [
		{
			"directive": "param",
			"text": "brush_name\tstring\tThe name of the brush to create.",
			"name": "brush_name",
			"type": "string",
			"description": "The name of the brush to create."
		},
		{
			"directive": "param",
			"text": "target_size\tVector3\tThe target size of the brush to create.",
			"name": "target_size",
			"type": "Vector3",
			"description": "The target size of the brush to create."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "true,table,Vector3|false,string\tIf the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead.",
		"type": "true,table,Vector3|false,string",
		"description": "If the operation was successful, true followed by the brush in a 1D ZERO-indexed table followed by the actual size of the brush as a Vector3 (x & y components used only). If the operation was not successful, false and an error message string is returned instead."
	},
	"name_full": "worldeditadditions.sculpt.make_brush",
	"filename": "worldeditadditions/lib/sculpt/make_brush.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/make_brush.lua#L6-L10"
}

make_preview 🔗

Generates a textual preview of a given brush.

Arguments

NameTypeDefault valueDescription
brushtablenil

The brush in question to preview.

sizeVector3nil

The size of the brush.

Returns

string :

A preview of the brush as a string.

Source
--- Generates a textual preview of a given brush.
-- @param	brush		table	The brush in question to preview.
-- @param	size		Vector3	The size of the brush.
-- @returns	string		A preview of the brush as a string.
local function make_preview(brush, size, framed)
{
	"type": "function",
	"internal": false,
	"description": "Generates a textual preview of a given brush.",
	"directives": [
		{
			"directive": "param",
			"text": "brush\t\ttable\tThe brush in question to preview.",
			"name": "brush",
			"type": "table",
			"description": "The brush in question to preview."
		},
		{
			"directive": "param",
			"text": "size\t\tVector3\tThe size of the brush.",
			"name": "size",
			"type": "Vector3",
			"description": "The size of the brush."
		},
		{
			"directive": "returns",
			"text": "string\t\tA preview of the brush as a string.",
			"type": "string",
			"description": "A preview of the brush as a string."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 11,
	"name": "make_preview",
	"instanced": false,
	"args": [
		"brush",
		"size",
		"framed"
	],
	"text": "--- Generates a textual preview of a given brush.\n-- @param\tbrush\t\ttable\tThe brush in question to preview.\n-- @param\tsize\t\tVector3\tThe size of the brush.\n-- @returns\tstring\t\tA preview of the brush as a string.\nlocal function make_preview(brush, size, framed)",
	"params": [
		{
			"directive": "param",
			"text": "brush\t\ttable\tThe brush in question to preview.",
			"name": "brush",
			"type": "table",
			"description": "The brush in question to preview."
		},
		{
			"directive": "param",
			"text": "size\t\tVector3\tThe size of the brush.",
			"name": "size",
			"type": "Vector3",
			"description": "The size of the brush."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string\t\tA preview of the brush as a string.",
		"type": "string",
		"description": "A preview of the brush as a string."
	},
	"name_full": "worldeditadditions.sculpt.make_preview",
	"filename": "worldeditadditions/lib/sculpt/make_preview.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/make_preview.lua#L8-L12"
}

parse_static 🔗

Parses a static brush definition.

Arguments

NameTypeDefault valueDescription
sourcestringnil

The source string that contains the static brush, formatted as TSV.

Returns

true,table,Vector3|false,string :

A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)

Source
--- Parses a static brush definition.
-- @name parse_static
-- @internal
-- @param	source	string	The source string that contains the static brush, formatted as TSV.
-- @returns	true,table,Vector3|false,string		A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)
return function(source)
{
	"type": "function",
	"internal": true,
	"description": "Parses a static brush definition.",
	"directives": [
		{
			"directive": "name",
			"text": "parse_static"
		},
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "source\tstring\tThe source string that contains the static brush, formatted as TSV.",
			"name": "source",
			"type": "string",
			"description": "The source string that contains the static brush, formatted as TSV."
		},
		{
			"directive": "returns",
			"text": "true,table,Vector3|false,string\t\tA success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)",
			"type": "true,table,Vector3|false,string",
			"description": "A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)"
		}
	],
	"line": 7,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 12,
	"name": "parse_static",
	"instanced": false,
	"args": [
		"source"
	],
	"text": "--- Parses a static brush definition.\n-- @name parse_static\n-- @internal\n-- @param\tsource\tstring\tThe source string that contains the static brush, formatted as TSV.\n-- @returns\ttrue,table,Vector3|false,string\t\tA success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)\nreturn function(source)",
	"params": [
		{
			"directive": "param",
			"text": "source\tstring\tThe source string that contains the static brush, formatted as TSV.",
			"name": "source",
			"type": "string",
			"description": "The source string that contains the static brush, formatted as TSV."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "true,table,Vector3|false,string\t\tA success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)",
		"type": "true,table,Vector3|false,string",
		"description": "A success boolean, followed either by an error message as a string or the brush (as a table) and it's size (as an X/Y Vector3)"
	},
	"name_full": "worldeditadditions.sculpt.parse_static",
	"filename": "worldeditadditions/lib/sculpt/parse_static.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/parse_static.lua#L8-L13"
}

preview_brush 🔗

Generates a textual preview of a given brush.

Arguments

NameTypeDefault valueDescription
brush_namestringnil

The name of the brush to create a preview for.

target_sizeVector3nil

The target size of the brush to create. Default: (10, 10, 0).

Returns

bool,string :

If the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead.

Source
--- Generates a textual preview of a given brush.
-- @param	brush_name	string	The name of the brush to create a preview for.
-- @param	target_size	Vector3	The target size of the brush to create. Default: (10, 10, 0).
-- @returns	bool,string	If the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead.
local function preview_brush(brush_name, target_size, framed)
{
	"type": "function",
	"internal": false,
	"description": "Generates a textual preview of a given brush.",
	"directives": [
		{
			"directive": "param",
			"text": "brush_name\tstring\tThe name of the brush to create a preview for.",
			"name": "brush_name",
			"type": "string",
			"description": "The name of the brush to create a preview for."
		},
		{
			"directive": "param",
			"text": "target_size\tVector3\tThe target size of the brush to create. Default: (10, 10, 0).",
			"name": "target_size",
			"type": "Vector3",
			"description": "The target size of the brush to create. Default: (10, 10, 0)."
		},
		{
			"directive": "returns",
			"text": "bool,string\tIf the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead.",
			"type": "bool,string",
			"description": "If the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead."
		}
	],
	"line": 10,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 14,
	"name": "preview_brush",
	"instanced": false,
	"args": [
		"brush_name",
		"target_size",
		"framed"
	],
	"text": "--- Generates a textual preview of a given brush.\n-- @param\tbrush_name\tstring\tThe name of the brush to create a preview for.\n-- @param\ttarget_size\tVector3\tThe target size of the brush to create. Default: (10, 10, 0).\n-- @returns\tbool,string\tIf the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead.\nlocal function preview_brush(brush_name, target_size, framed)",
	"params": [
		{
			"directive": "param",
			"text": "brush_name\tstring\tThe name of the brush to create a preview for.",
			"name": "brush_name",
			"type": "string",
			"description": "The name of the brush to create a preview for."
		},
		{
			"directive": "param",
			"text": "target_size\tVector3\tThe target size of the brush to create. Default: (10, 10, 0).",
			"name": "target_size",
			"type": "Vector3",
			"description": "The target size of the brush to create. Default: (10, 10, 0)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string\tIf the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead.",
		"type": "bool,string",
		"description": "If the operation was successful, true followed by a preview of the brush as a string. If the operation was not successful, false and an error message string is returned instead."
	},
	"name_full": "worldeditadditions.sculpt.preview_brush",
	"filename": "worldeditadditions/lib/sculpt/preview_brush.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/preview_brush.lua#L11-L15"
}

scan_static 🔗

Scans the given directory and imports all static brushes found. Static brushes have the file extension ".brush.tsv" (without quotes).

Arguments

NameTypeDefault valueDescription
dirpathstringnil

The path to directory that contains the static brushs to import.

Returns

bool,loaded,errors :

A success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)

Source
--- Scans the given directory and imports all static brushes found.
-- Static brushes have the file extension ".brush.tsv" (without quotes).
-- @name	scan_static
-- @internal
-- @param	dirpath	string		The path to directory that contains the static brushs to import.
-- @returns	bool,loaded,errors	A success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)
return function(dirpath, overwrite_existing)
{
	"type": "function",
	"internal": true,
	"description": "Scans the given directory and imports all static brushes found.\nStatic brushes have the file extension \".brush.tsv\" (without quotes).",
	"directives": [
		{
			"directive": "name",
			"text": "scan_static"
		},
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "dirpath\tstring\t\tThe path to directory that contains the static brushs to import.",
			"name": "dirpath",
			"type": "string",
			"description": "The path to directory that contains the static brushs to import."
		},
		{
			"directive": "returns",
			"text": "bool,loaded,errors\tA success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)",
			"type": "bool,loaded,errors",
			"description": "A success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)"
		}
	],
	"line": 26,
	"namespace": "worldeditadditions.sculpt",
	"line_last": 32,
	"name": "scan_static",
	"instanced": false,
	"args": [
		"dirpath",
		"overwrite_existing"
	],
	"text": "--- Scans the given directory and imports all static brushes found.\n-- Static brushes have the file extension \".brush.tsv\" (without quotes).\n-- @name\tscan_static\n-- @internal\n-- @param\tdirpath\tstring\t\tThe path to directory that contains the static brushs to import.\n-- @returns\tbool,loaded,errors\tA success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)\nreturn function(dirpath, overwrite_existing)",
	"params": [
		{
			"directive": "param",
			"text": "dirpath\tstring\t\tThe path to directory that contains the static brushs to import.",
			"name": "dirpath",
			"type": "string",
			"description": "The path to directory that contains the static brushs to import."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,loaded,errors\tA success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)",
		"type": "bool,loaded,errors",
		"description": "A success boolean, followed by the number of brushes loaded, followed by the number of errors encountered while loading brushes (errors are logged as warnings with Minetest)"
	},
	"name_full": "worldeditadditions.sculpt.scan_static",
	"filename": "worldeditadditions/lib/sculpt/scan_static.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/sculpt/scan_static.lua#L27-L33"
}

selection 🔗

Functions for handling selections of the defined pos1/pos2 region.

These functions primarily back the cloud wand. To manipulate positions directly, see the worldeditadditions_core.pos namespace.

Functions

add_point 🔗

Additively adds a point to the current selection defined by pos1..pos2 or makes a selection from the provided point.

Arguments

NameTypeDefault valueDescription
namestringnil

Player name.

posvectornil

The position to include.

Returns

void

Source
--- Additively adds a point to the current selection defined by pos1..pos2 or
-- makes a selection from the provided point.
-- @param	name	string	Player name.
-- @param	pos	vector	The position to include.
-- @returns	void
function selection.add_point(name, newpos)
{
	"type": "function",
	"internal": false,
	"description": "Additively adds a point to the current selection defined by pos1..pos2 or\nmakes a selection from the provided point.",
	"directives": [
		{
			"directive": "param",
			"text": "name\tstring\tPlayer name.",
			"name": "name",
			"type": "string",
			"description": "Player name."
		},
		{
			"directive": "param",
			"text": "pos\tvector\tThe position to include.",
			"name": "pos",
			"type": "vector",
			"description": "The position to include."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 17,
	"namespace": "worldeditadditions.selection",
	"line_last": 22,
	"name": "add_point",
	"instanced": false,
	"args": [
		"name",
		"newpos"
	],
	"text": "--- Additively adds a point to the current selection defined by pos1..pos2 or\n-- makes a selection from the provided point.\n-- @param\tname\tstring\tPlayer name.\n-- @param\tpos\tvector\tThe position to include.\n-- @returns\tvoid\nfunction selection.add_point(name, newpos)",
	"params": [
		{
			"directive": "param",
			"text": "name\tstring\tPlayer name.",
			"name": "name",
			"type": "string",
			"description": "Player name."
		},
		{
			"directive": "param",
			"text": "pos\tvector\tThe position to include.",
			"name": "pos",
			"type": "vector",
			"description": "The position to include."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions.selection.add_point",
	"filename": "worldeditadditions/lib/selection/selection.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/selection/selection.lua#L18-L23"
}

check_axis 🔗

Checks if a string is a valid axis.

Arguments

NameTypeDefault valueDescription
strstringnil

String to check (be sure to remove any + or -).

hvboolnil

Include "h" (general horizontal) and "v" (general vertical).

Returns

bool :

If string is a valid axis then true.

Source
--- Checks if a string is a valid axis.
-- @param	str	string	String to check (be sure to remove any + or -).
-- @param	hv	bool	Include "h" (general horizontal) and "v" (general vertical).
-- @return	bool	If string is a valid axis then true.
function selection.check_axis(str,hv)
{
	"type": "function",
	"internal": false,
	"description": "Checks if a string is a valid axis.",
	"directives": [
		{
			"directive": "param",
			"text": "str\tstring\tString to check (be sure to remove any + or -).",
			"name": "str",
			"type": "string",
			"description": "String to check (be sure to remove any + or -)."
		},
		{
			"directive": "param",
			"text": "hv\tbool\tInclude \"h\" (general horizontal) and \"v\" (general vertical).",
			"name": "hv",
			"type": "bool",
			"description": "Include \"h\" (general horizontal) and \"v\" (general vertical)."
		},
		{
			"directive": "returns",
			"text": "bool\tIf string is a valid axis then true.",
			"type": "bool",
			"description": "If string is a valid axis then true."
		}
	],
	"line": 81,
	"namespace": "worldeditadditions.selection",
	"line_last": 85,
	"name": "check_axis",
	"instanced": false,
	"args": [
		"str",
		"hv"
	],
	"text": "--- Checks if a string is a valid axis.\n-- @param\tstr\tstring\tString to check (be sure to remove any + or -).\n-- @param\thv\tbool\tInclude \"h\" (general horizontal) and \"v\" (general vertical).\n-- @return\tbool\tIf string is a valid axis then true.\nfunction selection.check_axis(str,hv)",
	"params": [
		{
			"directive": "param",
			"text": "str\tstring\tString to check (be sure to remove any + or -).",
			"name": "str",
			"type": "string",
			"description": "String to check (be sure to remove any + or -)."
		},
		{
			"directive": "param",
			"text": "hv\tbool\tInclude \"h\" (general horizontal) and \"v\" (general vertical).",
			"name": "hv",
			"type": "bool",
			"description": "Include \"h\" (general horizontal) and \"v\" (general vertical)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tIf string is a valid axis then true.",
		"type": "bool",
		"description": "If string is a valid axis then true."
	},
	"name_full": "worldeditadditions.selection.check_axis",
	"filename": "worldeditadditions/lib/selection/selection.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/selection/selection.lua#L82-L86"
}

check_dir 🔗

Checks if a string is a valid dir.

Arguments

NameTypeDefault valueDescription
strstringnil

String to check (be sure to remove any + or -).

Returns

bool :

If string is a valid dir then true.

Source
--- Checks if a string is a valid dir.
-- @param	str	string	String to check (be sure to remove any + or -).
-- @return	bool	If string is a valid dir then true.
function selection.check_dir(str)
{
	"type": "function",
	"internal": false,
	"description": "Checks if a string is a valid dir.",
	"directives": [
		{
			"directive": "param",
			"text": "str\tstring\tString to check (be sure to remove any + or -).",
			"name": "str",
			"type": "string",
			"description": "String to check (be sure to remove any + or -)."
		},
		{
			"directive": "returns",
			"text": "bool\tIf string is a valid dir then true.",
			"type": "bool",
			"description": "If string is a valid dir then true."
		}
	],
	"line": 93,
	"namespace": "worldeditadditions.selection",
	"line_last": 96,
	"name": "check_dir",
	"instanced": false,
	"args": [
		"str"
	],
	"text": "--- Checks if a string is a valid dir.\n-- @param\tstr\tstring\tString to check (be sure to remove any + or -).\n-- @return\tbool\tIf string is a valid dir then true.\nfunction selection.check_dir(str)",
	"params": [
		{
			"directive": "param",
			"text": "str\tstring\tString to check (be sure to remove any + or -).",
			"name": "str",
			"type": "string",
			"description": "String to check (be sure to remove any + or -)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tIf string is a valid dir then true.",
		"type": "bool",
		"description": "If string is a valid dir then true."
	},
	"name_full": "worldeditadditions.selection.check_dir",
	"filename": "worldeditadditions/lib/selection/selection.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/selection/selection.lua#L94-L97"
}

clear_points 🔗

Clears current selection, *but only pos1 and pos2!

Arguments

NameTypeDefault valueDescription
namestringnil

Player name.

Returns

void

Source
--- Clears current selection, *but only pos1 and pos2!
-- @param	name	string	Player name.
-- @returns	void
function selection.clear_points(name)
{
	"type": "function",
	"internal": false,
	"description": "Clears current selection, *but only pos1 and pos2!",
	"directives": [
		{
			"directive": "param",
			"text": "name\tstring\tPlayer name.",
			"name": "name",
			"type": "string",
			"description": "Player name."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 71,
	"namespace": "worldeditadditions.selection",
	"line_last": 74,
	"name": "clear_points",
	"instanced": false,
	"args": [
		"name"
	],
	"text": "--- Clears current selection, *but only pos1 and pos2!\n-- @param\tname\tstring\tPlayer name.\n-- @returns\tvoid\nfunction selection.clear_points(name)",
	"params": [
		{
			"directive": "param",
			"text": "name\tstring\tPlayer name.",
			"name": "name",
			"type": "string",
			"description": "Player name."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions.selection.clear_points",
	"filename": "worldeditadditions/lib/selection/selection.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/selection/selection.lua#L72-L75"
}

Functions

airapply 🔗

Like ellipsoidapply, but only keeps changes that replace airlike nodes, and discards any other changes made. Takes a backup copy of the defined region, runs the given function, and then restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.

Arguments

NameTypeDefault valueDescription
pos1Positionnil

The 1st position defining the region boundary

pos2Positionnil

The 2nd positioon defining the region boundary

funcfunctionnil

The function to call that performs the action in question. It is expected that the given function will accept no arguments.

Returns

nil

Source
--- Like ellipsoidapply, but only keeps changes that replace airlike nodes, and discards any other changes made.
-- Takes a backup copy of the defined region, runs the given function, and then
-- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.
-- @param	pos1	Position	The 1st position defining the region boundary
-- @param	pos2	Position	The 2nd positioon defining the region boundary 
-- @param	func	function	The function to call that performs the action in question. It is expected that the given function will accept no arguments.
function worldeditadditions.airapply(pos1, pos2, func)
{
	"type": "function",
	"internal": false,
	"description": "Like ellipsoidapply, but only keeps changes that replace airlike nodes, and discards any other changes made.\nTakes a backup copy of the defined region, runs the given function, and then\nrestores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tPosition\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Position",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\tPosition\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Position",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "func\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"line": 18,
	"namespace": "worldeditadditions",
	"line_last": 24,
	"name": "airapply",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"func"
	],
	"text": "--- Like ellipsoidapply, but only keeps changes that replace airlike nodes, and discards any other changes made.\n-- Takes a backup copy of the defined region, runs the given function, and then\n-- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.\n-- @param\tpos1\tPosition\tThe 1st position defining the region boundary\n-- @param\tpos2\tPosition\tThe 2nd positioon defining the region boundary \n-- @param\tfunc\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.\nfunction worldeditadditions.airapply(pos1, pos2, func)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tPosition\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Position",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\tPosition\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Position",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "func\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"name_full": "worldeditadditions.airapply",
	"filename": "worldeditadditions/lib/airapply.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/airapply.lua#L19-L25"
}

bonemeal 🔗

Bonemeal command. Applies bonemeal to all nodes with an air bloc above then.

Arguments

NameTypeDefault valueDescription
strengthnumbernil

The strength to apply - see bonemeal:on_use

chancenumbernil

Positive integer that represents the chance bonemealing will occur

Returns

bool,number,number :

  1. Whether the command succeeded or not.
  2. The number of nodes actually bonemealed
  3. The number of possible candidates we could have bonemealed

Source
--- Bonemeal command.
-- Applies bonemeal to all nodes with an air bloc above then.
-- @param	strength	number	The strength to apply - see bonemeal:on_use
-- @param	chance		number		Positive integer that represents the chance bonemealing will occur
-- @returns	bool,number,number	1. Whether the command succeeded or not.
-- 								2. The number of nodes actually bonemealed
-- 								3. The number of possible candidates we could have bonemealed
function worldeditadditions.bonemeal(pos1, pos2, strength, chance, nodename_list)
{
	"type": "function",
	"internal": false,
	"description": "Bonemeal command.\nApplies bonemeal to all nodes with an air bloc above then.",
	"directives": [
		{
			"directive": "param",
			"text": "strength\tnumber\tThe strength to apply - see bonemeal:on_use",
			"name": "strength",
			"type": "number",
			"description": "The strength to apply - see bonemeal:on_use"
		},
		{
			"directive": "param",
			"text": "chance\t\tnumber\t\tPositive integer that represents the chance bonemealing will occur",
			"name": "chance",
			"type": "number",
			"description": "Positive integer that represents the chance bonemealing will occur"
		},
		{
			"directive": "returns",
			"text": "bool,number,number\t1. Whether the command succeeded or not.\n2. The number of nodes actually bonemealed\n3. The number of possible candidates we could have bonemealed",
			"type": "bool,number,number",
			"description": "1. Whether the command succeeded or not.\n2. The number of nodes actually bonemealed\n3. The number of possible candidates we could have bonemealed"
		}
	],
	"line": 6,
	"namespace": "worldeditadditions",
	"line_last": 13,
	"name": "bonemeal",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"strength",
		"chance",
		"nodename_list"
	],
	"text": "--- Bonemeal command.\n-- Applies bonemeal to all nodes with an air bloc above then.\n-- @param\tstrength\tnumber\tThe strength to apply - see bonemeal:on_use\n-- @param\tchance\t\tnumber\t\tPositive integer that represents the chance bonemealing will occur\n-- @returns\tbool,number,number\t1. Whether the command succeeded or not.\n-- \t\t\t\t\t\t\t\t2. The number of nodes actually bonemealed\n-- \t\t\t\t\t\t\t\t3. The number of possible candidates we could have bonemealed\nfunction worldeditadditions.bonemeal(pos1, pos2, strength, chance, nodename_list)",
	"params": [
		{
			"directive": "param",
			"text": "strength\tnumber\tThe strength to apply - see bonemeal:on_use",
			"name": "strength",
			"type": "number",
			"description": "The strength to apply - see bonemeal:on_use"
		},
		{
			"directive": "param",
			"text": "chance\t\tnumber\t\tPositive integer that represents the chance bonemealing will occur",
			"name": "chance",
			"type": "number",
			"description": "Positive integer that represents the chance bonemealing will occur"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,number,number\t1. Whether the command succeeded or not.\n2. The number of nodes actually bonemealed\n3. The number of possible candidates we could have bonemealed",
		"type": "bool,number,number",
		"description": "1. Whether the command succeeded or not.\n2. The number of nodes actually bonemealed\n3. The number of possible candidates we could have bonemealed"
	},
	"name_full": "worldeditadditions.bonemeal",
	"filename": "worldeditadditions/lib/bonemeal.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/bonemeal.lua#L7-L14"
}

copy 🔗

Copies a region to another location, potentially overwriting the exiting region.

Arguments

NameTypeDefault valueDescription
source_pos1Vector3nil

pos1 of the source region to copy.

source_pos2Vector3nil

pos2 of the source region to copy.

target_pos1Vector3nil

pos1 of the target region to copy to.

target_pos2Vector3nil

pos2 of the target region to copy to.

airapplyboolfalse

Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.

Returns

bool,numbers :

  1. Whether the copy operation was successful or not
  2. The total number of nodes copied.

Source
--- Copies a region to another location, potentially overwriting the exiting region.
-- @param	source_pos1		Vector3		pos1 of the source region to copy.
-- @param	source_pos2		Vector3		pos2 of the source region to copy.
-- @param	target_pos1		Vector3		pos1 of the target region to copy to.
-- @param	target_pos2		Vector3		pos2 of the target region to copy to.
-- @param	airapply=false	bool		Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.
-- @returns	bool,numbers	1. Whether the copy operation was successful or not
-- 							2. The total number of nodes copied.
function worldeditadditions.copy(source_pos1, source_pos2, target_pos1, target_pos2, airapply)
{
	"type": "function",
	"internal": false,
	"description": "Copies a region to another location, potentially overwriting the exiting region.",
	"directives": [
		{
			"directive": "param",
			"text": "source_pos1\t\tVector3\t\tpos1 of the source region to copy.",
			"name": "source_pos1",
			"type": "Vector3",
			"description": "pos1 of the source region to copy."
		},
		{
			"directive": "param",
			"text": "source_pos2\t\tVector3\t\tpos2 of the source region to copy.",
			"name": "source_pos2",
			"type": "Vector3",
			"description": "pos2 of the source region to copy."
		},
		{
			"directive": "param",
			"text": "target_pos1\t\tVector3\t\tpos1 of the target region to copy to.",
			"name": "target_pos1",
			"type": "Vector3",
			"description": "pos1 of the target region to copy to."
		},
		{
			"directive": "param",
			"text": "target_pos2\t\tVector3\t\tpos2 of the target region to copy to.",
			"name": "target_pos2",
			"type": "Vector3",
			"description": "pos2 of the target region to copy to."
		},
		{
			"directive": "param",
			"text": "airapply=false\tbool\t\tWhether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.",
			"name": "airapply",
			"type": "bool",
			"description": "Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.",
			"default_value": "false"
		},
		{
			"directive": "returns",
			"text": "bool,numbers\t1. Whether the copy operation was successful or not\n2. The total number of nodes copied.",
			"type": "bool,numbers",
			"description": "1. Whether the copy operation was successful or not\n2. The total number of nodes copied."
		}
	],
	"line": 13,
	"namespace": "worldeditadditions",
	"line_last": 21,
	"name": "copy",
	"instanced": false,
	"args": [
		"source_pos1",
		"source_pos2",
		"target_pos1",
		"target_pos2",
		"airapply"
	],
	"text": "--- Copies a region to another location, potentially overwriting the exiting region.\n-- @param\tsource_pos1\t\tVector3\t\tpos1 of the source region to copy.\n-- @param\tsource_pos2\t\tVector3\t\tpos2 of the source region to copy.\n-- @param\ttarget_pos1\t\tVector3\t\tpos1 of the target region to copy to.\n-- @param\ttarget_pos2\t\tVector3\t\tpos2 of the target region to copy to.\n-- @param\tairapply=false\tbool\t\tWhether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.\n-- @returns\tbool,numbers\t1. Whether the copy operation was successful or not\n-- \t\t\t\t\t\t\t2. The total number of nodes copied.\nfunction worldeditadditions.copy(source_pos1, source_pos2, target_pos1, target_pos2, airapply)",
	"params": [
		{
			"directive": "param",
			"text": "source_pos1\t\tVector3\t\tpos1 of the source region to copy.",
			"name": "source_pos1",
			"type": "Vector3",
			"description": "pos1 of the source region to copy."
		},
		{
			"directive": "param",
			"text": "source_pos2\t\tVector3\t\tpos2 of the source region to copy.",
			"name": "source_pos2",
			"type": "Vector3",
			"description": "pos2 of the source region to copy."
		},
		{
			"directive": "param",
			"text": "target_pos1\t\tVector3\t\tpos1 of the target region to copy to.",
			"name": "target_pos1",
			"type": "Vector3",
			"description": "pos1 of the target region to copy to."
		},
		{
			"directive": "param",
			"text": "target_pos2\t\tVector3\t\tpos2 of the target region to copy to.",
			"name": "target_pos2",
			"type": "Vector3",
			"description": "pos2 of the target region to copy to."
		},
		{
			"directive": "param",
			"text": "airapply=false\tbool\t\tWhether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.",
			"name": "airapply",
			"type": "bool",
			"description": "Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.",
			"default_value": "false"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,numbers\t1. Whether the copy operation was successful or not\n2. The total number of nodes copied.",
		"type": "bool,numbers",
		"description": "1. Whether the copy operation was successful or not\n2. The total number of nodes copied."
	},
	"name_full": "worldeditadditions.copy",
	"filename": "worldeditadditions/lib/copy.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/copy.lua#L14-L22"
}

corner_set 🔗

Puts a node at each corner of selection box.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position defining the WorldEdit selection

pos2Vector3nil

The 2nd positioon defining the WorldEdit selection

nodestringnil

Name of the node to place

Returns

nil

Source
--- Puts a node at each corner of selection box.
-- @param	pos1	Vector3		The 1st position defining the WorldEdit selection
-- @param	pos2	Vector3		The 2nd positioon defining the WorldEdit selection
-- @param	node	string		Name of the node to place
function worldeditadditions.corner_set(pos1, pos2, node)
{
	"type": "function",
	"internal": false,
	"description": "Puts a node at each corner of selection box.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe 1st position defining the WorldEdit selection",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe 2nd positioon defining the WorldEdit selection",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "node\tstring\t\tName of the node to place",
			"name": "node",
			"type": "string",
			"description": "Name of the node to place"
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 16,
	"name": "corner_set",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"node"
	],
	"text": "--- Puts a node at each corner of selection box.\n-- @param\tpos1\tVector3\t\tThe 1st position defining the WorldEdit selection\n-- @param\tpos2\tVector3\t\tThe 2nd positioon defining the WorldEdit selection\n-- @param\tnode\tstring\t\tName of the node to place\nfunction worldeditadditions.corner_set(pos1, pos2, node)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe 1st position defining the WorldEdit selection",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe 2nd positioon defining the WorldEdit selection",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "node\tstring\t\tName of the node to place",
			"name": "node",
			"type": "string",
			"description": "Name of the node to place"
		}
	],
	"name_full": "worldeditadditions.corner_set",
	"filename": "worldeditadditions/lib/wireframe/corner_set.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/wireframe/corner_set.lua#L13-L17"
}

count 🔗

Counts the nodes in a given area.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to count nodes in.

pos2Vector3nil

pos2 of the defined region to count nodes in.

do_human_countsboolnil

Whether to return human-readable counts (as a string) instead of the raw numbers.

Returns

bool,table<number,number>,number :

  1. Whether the operation was successful or not.
  2. A table mapping node ids to the number of that node id seen.
  3. The total number of nodes counted.

Source
--- Counts the nodes in a given area.
-- @param	pos1			Vector3		pos1 of the defined region to count nodes in.
-- @param	pos2			Vector3		pos2 of the defined region to count nodes in.
-- @param	do_human_counts	bool		Whether to return human-readable counts (as a string) instead of the raw numbers.
-- @returns	bool,table<number,number>,number	1. Whether the operation was successful or not.
-- 												2. A table mapping node ids to the number of that node id seen.
-- 												3. The total number of nodes counted.
function worldeditadditions.count(pos1, pos2, do_human_counts)
{
	"type": "function",
	"internal": false,
	"description": "Counts the nodes in a given area.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tpos1 of the defined region to count nodes in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to count nodes in."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tpos2 of the defined region to count nodes in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to count nodes in."
		},
		{
			"directive": "param",
			"text": "do_human_counts\tbool\t\tWhether to return human-readable counts (as a string) instead of the raw numbers.",
			"name": "do_human_counts",
			"type": "bool",
			"description": "Whether to return human-readable counts (as a string) instead of the raw numbers."
		},
		{
			"directive": "returns",
			"text": "bool,table<number,number>,number\t1. Whether the operation was successful or not.\n2. A table mapping node ids to the number of that node id seen.\n3. The total number of nodes counted.",
			"type": "bool,table<number,number>,number",
			"description": "1. Whether the operation was successful or not.\n2. A table mapping node ids to the number of that node id seen.\n3. The total number of nodes counted."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 19,
	"name": "count",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"do_human_counts"
	],
	"text": "--- Counts the nodes in a given area.\n-- @param\tpos1\t\t\tVector3\t\tpos1 of the defined region to count nodes in.\n-- @param\tpos2\t\t\tVector3\t\tpos2 of the defined region to count nodes in.\n-- @param\tdo_human_counts\tbool\t\tWhether to return human-readable counts (as a string) instead of the raw numbers.\n-- @returns\tbool,table<number,number>,number\t1. Whether the operation was successful or not.\n-- \t\t\t\t\t\t\t\t\t\t\t\t2. A table mapping node ids to the number of that node id seen.\n-- \t\t\t\t\t\t\t\t\t\t\t\t3. The total number of nodes counted.\nfunction worldeditadditions.count(pos1, pos2, do_human_counts)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tpos1 of the defined region to count nodes in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to count nodes in."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tpos2 of the defined region to count nodes in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to count nodes in."
		},
		{
			"directive": "param",
			"text": "do_human_counts\tbool\t\tWhether to return human-readable counts (as a string) instead of the raw numbers.",
			"name": "do_human_counts",
			"type": "bool",
			"description": "Whether to return human-readable counts (as a string) instead of the raw numbers."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,table<number,number>,number\t1. Whether the operation was successful or not.\n2. A table mapping node ids to the number of that node id seen.\n3. The total number of nodes counted.",
		"type": "bool,table<number,number>,number",
		"description": "1. Whether the operation was successful or not.\n2. A table mapping node ids to the number of that node id seen.\n3. The total number of nodes counted."
	},
	"name_full": "worldeditadditions.count",
	"filename": "worldeditadditions/lib/count.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/count.lua#L13-L20"
}

dome 🔗

Creates a dome shape with the given node, optionally specifying the direction the point should point.

Arguments

NameTypeDefault valueDescription
posVector3nil

The central point to start drawing the dome from.

radiusnumbernil

The radius of the dome to create.

replace_nodestringnil

The fully qualified name of the node to use to make the dome with.

pointing_dirVector3nil

Optional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name.

hollowbooleannil

Whether to make the dome hollow or not. Defaults to false.

Returns

nil

Source
--- Creates a dome shape with the given node, optionally specifying the
-- direction the point should point.
-- @param	pos				Vector3		The central point to start drawing the dome from.
-- @param	radius			number		The radius of the dome to create.
-- @param	replace_node	string		The fully qualified name of the node to use to make the dome with.
-- @param	pointing_dir	Vector3		Optional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name.
-- @param	hollow			boolean		Whether to make the dome hollow or not. Defaults to false.
function worldeditadditions.dome(pos, radius, replace_node, pointing_dir, hollow)
{
	"type": "function",
	"internal": false,
	"description": "Creates a dome shape with the given node, optionally specifying the\ndirection the point should point.",
	"directives": [
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\t\tThe central point to start drawing the dome from.",
			"name": "pos",
			"type": "Vector3",
			"description": "The central point to start drawing the dome from."
		},
		{
			"directive": "param",
			"text": "radius\t\t\tnumber\t\tThe radius of the dome to create.",
			"name": "radius",
			"type": "number",
			"description": "The radius of the dome to create."
		},
		{
			"directive": "param",
			"text": "replace_node\tstring\t\tThe fully qualified name of the node to use to make the dome with.",
			"name": "replace_node",
			"type": "string",
			"description": "The fully qualified name of the node to use to make the dome with."
		},
		{
			"directive": "param",
			"text": "pointing_dir\tVector3\t\tOptional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name.",
			"name": "pointing_dir",
			"type": "Vector3",
			"description": "Optional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name."
		},
		{
			"directive": "param",
			"text": "hollow\t\t\tboolean\t\tWhether to make the dome hollow or not. Defaults to false.",
			"name": "hollow",
			"type": "boolean",
			"description": "Whether to make the dome hollow or not. Defaults to false."
		}
	],
	"line": 11,
	"namespace": "worldeditadditions",
	"line_last": 18,
	"name": "dome",
	"instanced": false,
	"args": [
		"pos",
		"radius",
		"replace_node",
		"pointing_dir",
		"hollow"
	],
	"text": "--- Creates a dome shape with the given node, optionally specifying the\n-- direction the point should point.\n-- @param\tpos\t\t\t\tVector3\t\tThe central point to start drawing the dome from.\n-- @param\tradius\t\t\tnumber\t\tThe radius of the dome to create.\n-- @param\treplace_node\tstring\t\tThe fully qualified name of the node to use to make the dome with.\n-- @param\tpointing_dir\tVector3\t\tOptional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name.\n-- @param\thollow\t\t\tboolean\t\tWhether to make the dome hollow or not. Defaults to false.\nfunction worldeditadditions.dome(pos, radius, replace_node, pointing_dir, hollow)",
	"params": [
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\t\tThe central point to start drawing the dome from.",
			"name": "pos",
			"type": "Vector3",
			"description": "The central point to start drawing the dome from."
		},
		{
			"directive": "param",
			"text": "radius\t\t\tnumber\t\tThe radius of the dome to create.",
			"name": "radius",
			"type": "number",
			"description": "The radius of the dome to create."
		},
		{
			"directive": "param",
			"text": "replace_node\tstring\t\tThe fully qualified name of the node to use to make the dome with.",
			"name": "replace_node",
			"type": "string",
			"description": "The fully qualified name of the node to use to make the dome with."
		},
		{
			"directive": "param",
			"text": "pointing_dir\tVector3\t\tOptional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name.",
			"name": "pointing_dir",
			"type": "Vector3",
			"description": "Optional. The direction the dome should point. Defaults to (0, 1, 0). See also wea_c.parse.axis_name."
		},
		{
			"directive": "param",
			"text": "hollow\t\t\tboolean\t\tWhether to make the dome hollow or not. Defaults to false.",
			"name": "hollow",
			"type": "boolean",
			"description": "Whether to make the dome hollow or not. Defaults to false."
		}
	],
	"name_full": "worldeditadditions.dome",
	"filename": "worldeditadditions/lib/dome.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/dome.lua#L12-L19"
}

ellipsoid 🔗

Fills an ellipsoidal area around the given position with the target node. The resulting ellipsoid may optionally be hollow (in which case nodes inside the ellipsoid are left untouched).

Arguments

NameTypeDefault valueDescription
positionVector3nil

The centre position of the ellipsoid.

radiusVector3nil

The radius of the ellipsoid in all 3 dimensions.

target_nodestringnil

The name of the node to use to fill the ellipsoid.

hollowboolnil

Whether the ellipsoid should be hollow or not.

Returns

number :

The number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered.

Source
--- Fills an ellipsoidal area around the given position with the target node.
-- The resulting ellipsoid may optionally be hollow (in which case
-- nodes inside the ellipsoid are left untouched).
-- @param	position	Vector3		The centre position of the ellipsoid.
-- @param	radius		Vector3		The radius of the ellipsoid in all 3 dimensions.
-- @param	target_node	string		The name of the node to use to fill the ellipsoid.
-- @param	hollow		bool		Whether the ellipsoid should be hollow or not.
-- @returns	number		The number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered.
function worldeditadditions.ellipsoid(position, radius, target_node, hollow)
{
	"type": "function",
	"internal": false,
	"description": "Fills an ellipsoidal area around the given position with the target node.\nThe resulting ellipsoid may optionally be hollow (in which case\nnodes inside the ellipsoid are left untouched).",
	"directives": [
		{
			"directive": "param",
			"text": "position\tVector3\t\tThe centre position of the ellipsoid.",
			"name": "position",
			"type": "Vector3",
			"description": "The centre position of the ellipsoid."
		},
		{
			"directive": "param",
			"text": "radius\t\tVector3\t\tThe radius of the ellipsoid in all 3 dimensions.",
			"name": "radius",
			"type": "Vector3",
			"description": "The radius of the ellipsoid in all 3 dimensions."
		},
		{
			"directive": "param",
			"text": "target_node\tstring\t\tThe name of the node to use to fill the ellipsoid.",
			"name": "target_node",
			"type": "string",
			"description": "The name of the node to use to fill the ellipsoid."
		},
		{
			"directive": "param",
			"text": "hollow\t\tbool\t\tWhether the ellipsoid should be hollow or not.",
			"name": "hollow",
			"type": "bool",
			"description": "Whether the ellipsoid should be hollow or not."
		},
		{
			"directive": "returns",
			"text": "number\t\tThe number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered.",
			"type": "number",
			"description": "The number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 20,
	"name": "ellipsoid",
	"instanced": false,
	"args": [
		"position",
		"radius",
		"target_node",
		"hollow"
	],
	"text": "--- Fills an ellipsoidal area around the given position with the target node.\n-- The resulting ellipsoid may optionally be hollow (in which case\n-- nodes inside the ellipsoid are left untouched).\n-- @param\tposition\tVector3\t\tThe centre position of the ellipsoid.\n-- @param\tradius\t\tVector3\t\tThe radius of the ellipsoid in all 3 dimensions.\n-- @param\ttarget_node\tstring\t\tThe name of the node to use to fill the ellipsoid.\n-- @param\thollow\t\tbool\t\tWhether the ellipsoid should be hollow or not.\n-- @returns\tnumber\t\tThe number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered.\nfunction worldeditadditions.ellipsoid(position, radius, target_node, hollow)",
	"params": [
		{
			"directive": "param",
			"text": "position\tVector3\t\tThe centre position of the ellipsoid.",
			"name": "position",
			"type": "Vector3",
			"description": "The centre position of the ellipsoid."
		},
		{
			"directive": "param",
			"text": "radius\t\tVector3\t\tThe radius of the ellipsoid in all 3 dimensions.",
			"name": "radius",
			"type": "Vector3",
			"description": "The radius of the ellipsoid in all 3 dimensions."
		},
		{
			"directive": "param",
			"text": "target_node\tstring\t\tThe name of the node to use to fill the ellipsoid.",
			"name": "target_node",
			"type": "string",
			"description": "The name of the node to use to fill the ellipsoid."
		},
		{
			"directive": "param",
			"text": "hollow\t\tbool\t\tWhether the ellipsoid should be hollow or not.",
			"name": "hollow",
			"type": "bool",
			"description": "Whether the ellipsoid should be hollow or not."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\tThe number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered.",
		"type": "number",
		"description": "The number of nodes filled to create the (optionally hollow) ellipsoid. This number will be lower with hollow ellipsoids, since the internals of an ellipsoid aren't altered."
	},
	"name_full": "worldeditadditions.ellipsoid",
	"filename": "worldeditadditions/lib/ellipsoid.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/ellipsoid.lua#L13-L21"
}

ellipsoidapply 🔗

Similar to cubeapply, except that it takes 2 positions and only keeps an ellipsoid-shaped area defined by the boundaries of the defined region. Takes a backup copy of the defined region, runs the given function, and then restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position defining the region boundary

pos2Vector3nil

The 2nd positioon defining the region boundary

funcfunctionnil

The function to call that performs the action in question. It is expected that the given function will accept no arguments.

Returns

nil

Source
--- Similar to cubeapply, except that it takes 2 positions and only keeps an ellipsoid-shaped area defined by the boundaries of the defined region.
-- Takes a backup copy of the defined region, runs the given function, and then
-- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.
-- @param	pos1	Vector3		The 1st position defining the region boundary
-- @param	pos2	Vector3		The 2nd positioon defining the region boundary 
-- @param	func	function	The function to call that performs the action in question. It is expected that the given function will accept no arguments.
function worldeditadditions.ellipsoidapply(pos1, pos2, func)
{
	"type": "function",
	"internal": false,
	"description": "Similar to cubeapply, except that it takes 2 positions and only keeps an ellipsoid-shaped area defined by the boundaries of the defined region.\nTakes a backup copy of the defined region, runs the given function, and then\nrestores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "func\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"line": 18,
	"namespace": "worldeditadditions",
	"line_last": 24,
	"name": "ellipsoidapply",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"func"
	],
	"text": "--- Similar to cubeapply, except that it takes 2 positions and only keeps an ellipsoid-shaped area defined by the boundaries of the defined region.\n-- Takes a backup copy of the defined region, runs the given function, and then\n-- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.\n-- @param\tpos1\tVector3\t\tThe 1st position defining the region boundary\n-- @param\tpos2\tVector3\t\tThe 2nd positioon defining the region boundary \n-- @param\tfunc\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.\nfunction worldeditadditions.ellipsoidapply(pos1, pos2, func)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "func\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"name_full": "worldeditadditions.ellipsoidapply",
	"filename": "worldeditadditions/lib/ellipsoidapply.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/ellipsoidapply.lua#L19-L25"
}

fillcaves 🔗

Fill caves command. Fills underneath non-air nodes in the defined region.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to fill caves in.

pos2Vector3nil

pos2 of the defined region to fill caves in.

node_namestringnil

The name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions.

Returns

bool,{replaced=number} :

  1. Whether the fill caves operation was successful or not.
  2. A table of statistics about the operation. Currently the only key in this table is replaced, which is the number of (air-like) nodes that were replaced during the operation.

Source
--- Fill caves command. Fills underneath non-air nodes in the defined region.
-- @param	pos1		Vector3		pos1 of the defined region to fill caves in.
-- @param	pos2		Vector3		pos2 of the defined region to fill caves in.
-- @param	node_name	string		The name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions.
-- @returns	bool,{replaced=number}	1. Whether the fill caves operation was successful or not.
-- 									2. A table of statistics about the operation. Currently the only key in this table is `replaced`, which is the number of (air-like) nodes that were replaced during the operation.
function worldeditadditions.fillcaves(pos1, pos2, node_name)
{
	"type": "function",
	"internal": false,
	"description": "Fill caves command. Fills underneath non-air nodes in the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to fill caves in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to fill caves in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to fill caves in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to fill caves in."
		},
		{
			"directive": "param",
			"text": "node_name\tstring\t\tThe name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions.",
			"name": "node_name",
			"type": "string",
			"description": "The name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions."
		},
		{
			"directive": "returns",
			"text": "bool,{replaced=number}\t1. Whether the fill caves operation was successful or not.\n2. A table of statistics about the operation. Currently the only key in this table is `replaced`, which is the number of (air-like) nodes that were replaced during the operation.",
			"type": "bool,{replaced=number}",
			"description": "1. Whether the fill caves operation was successful or not.\n2. A table of statistics about the operation. Currently the only key in this table is `replaced`, which is the number of (air-like) nodes that were replaced during the operation."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions",
	"line_last": 12,
	"name": "fillcaves",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"node_name"
	],
	"text": "--- Fill caves command. Fills underneath non-air nodes in the defined region.\n-- @param\tpos1\t\tVector3\t\tpos1 of the defined region to fill caves in.\n-- @param\tpos2\t\tVector3\t\tpos2 of the defined region to fill caves in.\n-- @param\tnode_name\tstring\t\tThe name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions.\n-- @returns\tbool,{replaced=number}\t1. Whether the fill caves operation was successful or not.\n-- \t\t\t\t\t\t\t\t\t2. A table of statistics about the operation. Currently the only key in this table is `replaced`, which is the number of (air-like) nodes that were replaced during the operation.\nfunction worldeditadditions.fillcaves(pos1, pos2, node_name)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to fill caves in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to fill caves in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to fill caves in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to fill caves in."
		},
		{
			"directive": "param",
			"text": "node_name\tstring\t\tThe name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions.",
			"name": "node_name",
			"type": "string",
			"description": "The name of the node to replace air nodes with. Should have been already normalised, as with all other worldeditadditions.* functions."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,{replaced=number}\t1. Whether the fill caves operation was successful or not.\n2. A table of statistics about the operation. Currently the only key in this table is `replaced`, which is the number of (air-like) nodes that were replaced during the operation.",
		"type": "bool,{replaced=number}",
		"description": "1. Whether the fill caves operation was successful or not.\n2. A table of statistics about the operation. Currently the only key in this table is `replaced`, which is the number of (air-like) nodes that were replaced during the operation."
	},
	"name_full": "worldeditadditions.fillcaves",
	"filename": "worldeditadditions/lib/fillcaves.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/fillcaves.lua#L7-L13"
}

floodfill 🔗

Flood-fill command for complex lakes etc.

Arguments

NameTypeDefault valueDescription
start_posVector3nil

The position to start floodfilling from.

radiusnumbernil

The maximum radius to limit the floodfill operation too.

replace_nodestringnil

The (normalised) name of the node to replace with when floodfilling.

Returns

number :

The number of nodes replaced.

Source
--- Flood-fill command for complex lakes etc.
-- @param	start_pos		Vector3		The position to start floodfilling from.
-- @param	radius			number		The maximum radius to limit the floodfill operation too.
-- @param	replace_node	string		The (normalised) name of the node to replace with when floodfilling.
-- @returns	number			The number of nodes replaced.
function worldeditadditions.floodfill(start_pos, radius, replace_node)
{
	"type": "function",
	"internal": false,
	"description": "Flood-fill command for complex lakes etc.",
	"directives": [
		{
			"directive": "param",
			"text": "start_pos\t\tVector3\t\tThe position to start floodfilling from.",
			"name": "start_pos",
			"type": "Vector3",
			"description": "The position to start floodfilling from."
		},
		{
			"directive": "param",
			"text": "radius\t\t\tnumber\t\tThe maximum radius to limit the floodfill operation too.",
			"name": "radius",
			"type": "number",
			"description": "The maximum radius to limit the floodfill operation too."
		},
		{
			"directive": "param",
			"text": "replace_node\tstring\t\tThe (normalised) name of the node to replace with when floodfilling.",
			"name": "replace_node",
			"type": "string",
			"description": "The (normalised) name of the node to replace with when floodfilling."
		},
		{
			"directive": "returns",
			"text": "number\t\t\tThe number of nodes replaced.",
			"type": "number",
			"description": "The number of nodes replaced."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions",
	"line_last": 12,
	"name": "floodfill",
	"instanced": false,
	"args": [
		"start_pos",
		"radius",
		"replace_node"
	],
	"text": "--- Flood-fill command for complex lakes etc.\n-- @param\tstart_pos\t\tVector3\t\tThe position to start floodfilling from.\n-- @param\tradius\t\t\tnumber\t\tThe maximum radius to limit the floodfill operation too.\n-- @param\treplace_node\tstring\t\tThe (normalised) name of the node to replace with when floodfilling.\n-- @returns\tnumber\t\t\tThe number of nodes replaced.\nfunction worldeditadditions.floodfill(start_pos, radius, replace_node)",
	"params": [
		{
			"directive": "param",
			"text": "start_pos\t\tVector3\t\tThe position to start floodfilling from.",
			"name": "start_pos",
			"type": "Vector3",
			"description": "The position to start floodfilling from."
		},
		{
			"directive": "param",
			"text": "radius\t\t\tnumber\t\tThe maximum radius to limit the floodfill operation too.",
			"name": "radius",
			"type": "number",
			"description": "The maximum radius to limit the floodfill operation too."
		},
		{
			"directive": "param",
			"text": "replace_node\tstring\t\tThe (normalised) name of the node to replace with when floodfilling.",
			"name": "replace_node",
			"type": "string",
			"description": "The (normalised) name of the node to replace with when floodfilling."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\t\tThe number of nodes replaced.",
		"type": "number",
		"description": "The number of nodes replaced."
	},
	"name_full": "worldeditadditions.floodfill",
	"filename": "worldeditadditions/lib/floodfill.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/floodfill.lua#L8-L13"
}

forest 🔗

Places saplings and bonemeals them automatically to create a forest. Note that the defined region is the region that saplings are placed in, so nodes may ultimately end up being replaced outside the defined region depending on the size of the tree that grows.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to place saplings in.

pos2Vector3nil

pos2 of the defined region to place saplings in.

density_multipliernumbernil

The density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.

Note that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated.

sapling_weightstable<string,number>nil

A table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings.

Returns

bool,table<string,number> :

  1. Whether the operation was successful or not. For example, this command might fail if the bonemeal mod is not installed.
  2. A table of statistics about the operation: | Key

Source
--- Places saplings and bonemeals them automatically to create a forest.
-- Note that the defined region is *the region that saplings are placed in*, so nodes may ultimately end up being replaced outside the defined region depending on the size of the tree that grows.
-- @param	pos1		Vector3		pos1 of the defined region to place saplings in.
-- @param	pos2		Vector3		pos2 of the defined region to place saplings in.
-- @param	density_multiplier	number	The density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.
-- 
-- Note that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated.
-- @param	sapling_weights		table<string,number>	A table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings.
-- @returns	bool,table<string,number>	1. Whether the operation was successful or not. For example, this command might fail if the `bonemeal` mod is not installed.
-- 										2. A table of statistics about the operation:
-- | Key			| Meaning	|
-- |----------------|-----------|
-- | `attempts`		| A table of numbers indicating how many bonemeal attempts each sapling took to grow. Saplings that failed to grow within 100 attempts are considered a failure and not logged in this table. |
-- | `attempts_avg`	| The average number of attempts saplings took to grow. |
-- | `failures`		| The number of saplings placed that failed to grow within the 100 attempts limit.	|
-- | `successes`	| The number of saplings that were placed and successfully grow into a tree. |
-- | `placed`		| A `table<number,number>` map of sapling node ids and how many of that sapling type successfully grew.
function worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weights)
{
	"type": "function",
	"internal": false,
	"description": "Places saplings and bonemeals them automatically to create a forest.\nNote that the defined region is *the region that saplings are placed in*, so nodes may ultimately end up being replaced outside the defined region depending on the size of the tree that grows.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to place saplings in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to place saplings in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to place saplings in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to place saplings in."
		},
		{
			"directive": "param",
			"text": "density_multiplier\tnumber\tThe density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.\n\nNote that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated.",
			"name": "density_multiplier",
			"type": "number",
			"description": "The density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.\n\nNote that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated."
		},
		{
			"directive": "param",
			"text": "sapling_weights\t\ttable<string,number>\tA table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings.",
			"name": "sapling_weights",
			"type": "table<string,number>",
			"description": "A table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings."
		},
		{
			"directive": "returns",
			"text": "bool,table<string,number>\t1. Whether the operation was successful or not. For example, this command might fail if the `bonemeal` mod is not installed.\n2. A table of statistics about the operation:\n| Key\t\t\t| Meaning\t|\n|----------------|-----------|\n| `attempts`\t\t| A table of numbers indicating how many bonemeal attempts each sapling took to grow. Saplings that failed to grow within 100 attempts are considered a failure and not logged in this table. |\n| `attempts_avg`\t| The average number of attempts saplings took to grow. |\n| `failures`\t\t| The number of saplings placed that failed to grow within the 100 attempts limit.\t|\n| `successes`\t| The number of saplings that were placed and successfully grow into a tree. |\n| `placed`\t\t| A `table<number,number>` map of sapling node ids and how many of that sapling type successfully grew.",
			"type": "bool,table<string,number>",
			"description": "1. Whether the operation was successful or not. For example, this command might fail if the `bonemeal` mod is not installed.\n2. A table of statistics about the operation:\n| Key"
		}
	],
	"line": 6,
	"namespace": "worldeditadditions",
	"line_last": 23,
	"name": "forest",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"density_multiplier",
		"sapling_weights"
	],
	"text": "--- Places saplings and bonemeals them automatically to create a forest.\n-- Note that the defined region is *the region that saplings are placed in*, so nodes may ultimately end up being replaced outside the defined region depending on the size of the tree that grows.\n-- @param\tpos1\t\tVector3\t\tpos1 of the defined region to place saplings in.\n-- @param\tpos2\t\tVector3\t\tpos2 of the defined region to place saplings in.\n-- @param\tdensity_multiplier\tnumber\tThe density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.\n-- \n-- Note that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated.\n-- @param\tsapling_weights\t\ttable<string,number>\tA table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings.\n-- @returns\tbool,table<string,number>\t1. Whether the operation was successful or not. For example, this command might fail if the `bonemeal` mod is not installed.\n-- \t\t\t\t\t\t\t\t\t\t2. A table of statistics about the operation:\n-- | Key\t\t\t| Meaning\t|\n-- |----------------|-----------|\n-- | `attempts`\t\t| A table of numbers indicating how many bonemeal attempts each sapling took to grow. Saplings that failed to grow within 100 attempts are considered a failure and not logged in this table. |\n-- | `attempts_avg`\t| The average number of attempts saplings took to grow. |\n-- | `failures`\t\t| The number of saplings placed that failed to grow within the 100 attempts limit.\t|\n-- | `successes`\t| The number of saplings that were placed and successfully grow into a tree. |\n-- | `placed`\t\t| A `table<number,number>` map of sapling node ids and how many of that sapling type successfully grew.\nfunction worldeditadditions.forest(pos1, pos2, density_multiplier, sapling_weights)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to place saplings in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to place saplings in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to place saplings in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to place saplings in."
		},
		{
			"directive": "param",
			"text": "density_multiplier\tnumber\tThe density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.\n\nNote that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated.",
			"name": "density_multiplier",
			"type": "number",
			"description": "The density of the forest to create. Nominally 1. Higher values increase the density at which saplings are placed, thereby increasing the density of the resulting forest.\n\nNote that sapling growth rules are respected, so there is a limit to the maximum density at which a forest can be generated."
		},
		{
			"directive": "param",
			"text": "sapling_weights\t\ttable<string,number>\tA table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings.",
			"name": "sapling_weights",
			"type": "table<string,number>",
			"description": "A table mapping (normalised) sapling names to their relative weight. Higher weights mean an increased chance of that particular sapling being chosen. Weights need not add up to any particular value. worldeditadditions.overlay() is used under the hood to place saplings."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,table<string,number>\t1. Whether the operation was successful or not. For example, this command might fail if the `bonemeal` mod is not installed.\n2. A table of statistics about the operation:\n| Key\t\t\t| Meaning\t|\n|----------------|-----------|\n| `attempts`\t\t| A table of numbers indicating how many bonemeal attempts each sapling took to grow. Saplings that failed to grow within 100 attempts are considered a failure and not logged in this table. |\n| `attempts_avg`\t| The average number of attempts saplings took to grow. |\n| `failures`\t\t| The number of saplings placed that failed to grow within the 100 attempts limit.\t|\n| `successes`\t| The number of saplings that were placed and successfully grow into a tree. |\n| `placed`\t\t| A `table<number,number>` map of sapling node ids and how many of that sapling type successfully grew.",
		"type": "bool,table<string,number>",
		"description": "1. Whether the operation was successful or not. For example, this command might fail if the `bonemeal` mod is not installed.\n2. A table of statistics about the operation:\n| Key"
	},
	"name_full": "worldeditadditions.forest",
	"filename": "worldeditadditions/lib/forest.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/forest.lua#L7-L24"
}

layers 🔗

Replaces the non-air nodes in each column with a list of nodes from top to bottom.

Arguments

NameTypeDefault valueDescription
pos1Vectornil

Position 1 of the region to operate on

pos2Vectornil

Position 2 of the region to operate on

node_weightsstring[]nil
min_slopenumber?nil
max_slopenumber?nil

Returns

table<string,number>

Source
--- Replaces the non-air nodes in each column with a list of nodes from top to bottom.
-- @param	pos1			Vector		Position 1 of the region to operate on
-- @param	pos2			Vector		Position 2 of the region to operate on
-- @param	node_weights	string[]	
-- @param	min_slope		number?		
-- @param	max_slope		number?		
-- @returns	table<string,number>
function worldeditadditions.layers(pos1, pos2, node_weights, min_slope, max_slope)
{
	"type": "function",
	"internal": false,
	"description": "Replaces the non-air nodes in each column with a list of nodes from top to bottom.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector\t\tPosition 1 of the region to operate on",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector\t\tPosition 2 of the region to operate on",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "node_weights\tstring[]",
			"name": "node_weights",
			"type": "string[]"
		},
		{
			"directive": "param",
			"text": "min_slope\t\tnumber?",
			"name": "min_slope",
			"type": "number?"
		},
		{
			"directive": "param",
			"text": "max_slope\t\tnumber?",
			"name": "max_slope",
			"type": "number?"
		},
		{
			"directive": "returns",
			"text": "table<string,number>",
			"type": "table<string,number>"
		}
	],
	"line": 22,
	"namespace": "worldeditadditions",
	"line_last": 29,
	"name": "layers",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"node_weights",
		"min_slope",
		"max_slope"
	],
	"text": "--- Replaces the non-air nodes in each column with a list of nodes from top to bottom.\n-- @param\tpos1\t\t\tVector\t\tPosition 1 of the region to operate on\n-- @param\tpos2\t\t\tVector\t\tPosition 2 of the region to operate on\n-- @param\tnode_weights\tstring[]\t\n-- @param\tmin_slope\t\tnumber?\t\t\n-- @param\tmax_slope\t\tnumber?\t\t\n-- @returns\ttable<string,number>\nfunction worldeditadditions.layers(pos1, pos2, node_weights, min_slope, max_slope)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector\t\tPosition 1 of the region to operate on",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector\t\tPosition 2 of the region to operate on",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "node_weights\tstring[]",
			"name": "node_weights",
			"type": "string[]"
		},
		{
			"directive": "param",
			"text": "min_slope\t\tnumber?",
			"name": "min_slope",
			"type": "number?"
		},
		{
			"directive": "param",
			"text": "max_slope\t\tnumber?",
			"name": "max_slope",
			"type": "number?"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table<string,number>",
		"type": "table<string,number>"
	},
	"name_full": "worldeditadditions.layers",
	"filename": "worldeditadditions/lib/layers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/layers.lua#L23-L30"
}

line 🔗

Counts the nodes in a given area.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The position to start drawing the line from.

pos2Vector3nil

The position to draw the line to.

thicknessnumbernil

The thickness of the line to draw.

node_namestringnil

The (normalised) name of the node to draw the line with.

Returns

bool,{replaced=number} :

  1. A bool indicating whether the operation was successful or not.
  2. A table containing statistics. At present the only key in this table is replaced, which indicates the number of nodes replaced when drawing the line.

Source
--- Counts the nodes in a given area.
-- @param	pos1		Vector3		The position to start drawing the line from.
-- @param	pos2		Vector3		The position to draw the line to.
-- @param	thickness	number		The thickness of the line to draw.
-- @param	node_name	string		The (normalised) name of the node to draw the line with.
-- @returns	bool,{replaced=number}	1. A bool indicating whether the operation was successful or not.
-- 									2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line.
function worldeditadditions.line(pos1, pos2, thickness, node_name)
{
	"type": "function",
	"internal": false,
	"description": "Counts the nodes in a given area.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe position to start drawing the line from.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position to start drawing the line from."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tThe position to draw the line to.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The position to draw the line to."
		},
		{
			"directive": "param",
			"text": "thickness\tnumber\t\tThe thickness of the line to draw.",
			"name": "thickness",
			"type": "number",
			"description": "The thickness of the line to draw."
		},
		{
			"directive": "param",
			"text": "node_name\tstring\t\tThe (normalised) name of the node to draw the line with.",
			"name": "node_name",
			"type": "string",
			"description": "The (normalised) name of the node to draw the line with."
		},
		{
			"directive": "returns",
			"text": "bool,{replaced=number}\t1. A bool indicating whether the operation was successful or not.\n2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line.",
			"type": "bool,{replaced=number}",
			"description": "1. A bool indicating whether the operation was successful or not.\n2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line."
		}
	],
	"line": 13,
	"namespace": "worldeditadditions",
	"line_last": 20,
	"name": "line",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"thickness",
		"node_name"
	],
	"text": "--- Counts the nodes in a given area.\n-- @param\tpos1\t\tVector3\t\tThe position to start drawing the line from.\n-- @param\tpos2\t\tVector3\t\tThe position to draw the line to.\n-- @param\tthickness\tnumber\t\tThe thickness of the line to draw.\n-- @param\tnode_name\tstring\t\tThe (normalised) name of the node to draw the line with.\n-- @returns\tbool,{replaced=number}\t1. A bool indicating whether the operation was successful or not.\n-- \t\t\t\t\t\t\t\t\t2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line.\nfunction worldeditadditions.line(pos1, pos2, thickness, node_name)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe position to start drawing the line from.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position to start drawing the line from."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tThe position to draw the line to.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The position to draw the line to."
		},
		{
			"directive": "param",
			"text": "thickness\tnumber\t\tThe thickness of the line to draw.",
			"name": "thickness",
			"type": "number",
			"description": "The thickness of the line to draw."
		},
		{
			"directive": "param",
			"text": "node_name\tstring\t\tThe (normalised) name of the node to draw the line with.",
			"name": "node_name",
			"type": "string",
			"description": "The (normalised) name of the node to draw the line with."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,{replaced=number}\t1. A bool indicating whether the operation was successful or not.\n2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line.",
		"type": "bool,{replaced=number}",
		"description": "1. A bool indicating whether the operation was successful or not.\n2. A table containing statistics. At present the only key in this table is `replaced`, which indicates the number of nodes replaced when drawing the line."
	},
	"name_full": "worldeditadditions.line",
	"filename": "worldeditadditions/lib/line.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/line.lua#L14-L21"
}

make_compass 🔗

Makes a compass with a bead pointing north (+Z).

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position defining the WorldEdit selection

node1stringnil

Name of the node to place

node2stringnil

Name of the node of the bead

Returns

nil

Source
--- Makes a compass with a bead pointing north (+Z).
-- @param	pos1	Vector3	The 1st position defining the WorldEdit selection
-- @param	node1	string	Name of the node to place
-- @param	node2	string	Name of the node of the bead
function worldeditadditions.make_compass(pos1,node1,node2)
{
	"type": "function",
	"internal": false,
	"description": "Makes a compass with a bead pointing north (+Z).",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\tThe 1st position defining the WorldEdit selection",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "node1\tstring\tName of the node to place",
			"name": "node1",
			"type": "string",
			"description": "Name of the node to place"
		},
		{
			"directive": "param",
			"text": "node2\tstring\tName of the node of the bead",
			"name": "node2",
			"type": "string",
			"description": "Name of the node of the bead"
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 16,
	"name": "make_compass",
	"instanced": false,
	"args": [
		"pos1",
		"node1",
		"node2"
	],
	"text": "--- Makes a compass with a bead pointing north (+Z).\n-- @param\tpos1\tVector3\tThe 1st position defining the WorldEdit selection\n-- @param\tnode1\tstring\tName of the node to place\n-- @param\tnode2\tstring\tName of the node of the bead\nfunction worldeditadditions.make_compass(pos1,node1,node2)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\tThe 1st position defining the WorldEdit selection",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "node1\tstring\tName of the node to place",
			"name": "node1",
			"type": "string",
			"description": "Name of the node to place"
		},
		{
			"directive": "param",
			"text": "node2\tstring\tName of the node of the bead",
			"name": "node2",
			"type": "string",
			"description": "Name of the node of the bead"
		}
	],
	"name_full": "worldeditadditions.make_compass",
	"filename": "worldeditadditions/lib/wireframe/make_compass.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/wireframe/make_compass.lua#L13-L17"
}

maze2d 🔗

Generates a 2D maze. Algorithm origin: https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html

The defined region must be at least 3 x 1 x 3 (x, y, z) for a maze to generate successfully.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to draw the 2D maze in in.

pos2Vector3nil

pos2 of the defined region to draw the 2D maze in in.

target_nodestringnil

The (normalised) node name to draw the maze in.

path_lengthnumber2

Step this many nodes forwards at once when generating the maze. Higher values create long thin corridors.

path_widthnumber1

Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors. Caution: Make sure this value is not higher than path_length - 1, otherwise the maze algorithm won't work right!

Returns

number :

The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).

Source
--- Generates a 2D maze.
-- **Algorithm origin:** https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html
-- 
-- The defined region must be at least 3 x 1 x 3 (x, y, z) for a maze to generate successfully.
-- @param	pos1		Vector3		pos1 of the defined region to draw the 2D maze in in.
-- @param	pos2		Vector3		pos2 of the defined region to draw the 2D maze in in.
-- @param	target_node		string		The (normalised) node name to draw the maze in.
-- @param	path_length=2	number		Step this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.
-- @param	path_width=1	number		Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.
-- **Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!
-- @returns	number			The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).
function worldeditadditions.maze2d(pos1, pos2, target_node, seed, path_length, path_width)
{
	"type": "function",
	"internal": false,
	"description": "Generates a 2D maze.\n**Algorithm origin:** https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html\n\nThe defined region must be at least 3 x 1 x 3 (x, y, z) for a maze to generate successfully.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to draw the 2D maze in in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to draw the 2D maze in in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to draw the 2D maze in in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to draw the 2D maze in in."
		},
		{
			"directive": "param",
			"text": "target_node\t\tstring\t\tThe (normalised) node name to draw the maze in.",
			"name": "target_node",
			"type": "string",
			"description": "The (normalised) node name to draw the maze in."
		},
		{
			"directive": "param",
			"text": "path_length=2\tnumber\t\tStep this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"name": "path_length",
			"type": "number",
			"description": "Step this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"default_value": "2"
		},
		{
			"directive": "param",
			"text": "path_width=1\tnumber\t\tMake all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"name": "path_width",
			"type": "number",
			"description": "Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"default_value": "1"
		},
		{
			"directive": "returns",
			"text": "number\t\t\tThe number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).",
			"type": "number",
			"description": "The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2)."
		}
	],
	"line": 120,
	"namespace": "worldeditadditions",
	"line_last": 131,
	"name": "maze2d",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"target_node",
		"seed",
		"path_length",
		"path_width"
	],
	"text": "--- Generates a 2D maze.\n-- **Algorithm origin:** https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html\n-- \n-- The defined region must be at least 3 x 1 x 3 (x, y, z) for a maze to generate successfully.\n-- @param\tpos1\t\tVector3\t\tpos1 of the defined region to draw the 2D maze in in.\n-- @param\tpos2\t\tVector3\t\tpos2 of the defined region to draw the 2D maze in in.\n-- @param\ttarget_node\t\tstring\t\tThe (normalised) node name to draw the maze in.\n-- @param\tpath_length=2\tnumber\t\tStep this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.\n-- @param\tpath_width=1\tnumber\t\tMake all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n-- **Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!\n-- @returns\tnumber\t\t\tThe number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).\nfunction worldeditadditions.maze2d(pos1, pos2, target_node, seed, path_length, path_width)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to draw the 2D maze in in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to draw the 2D maze in in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to draw the 2D maze in in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to draw the 2D maze in in."
		},
		{
			"directive": "param",
			"text": "target_node\t\tstring\t\tThe (normalised) node name to draw the maze in.",
			"name": "target_node",
			"type": "string",
			"description": "The (normalised) node name to draw the maze in."
		},
		{
			"directive": "param",
			"text": "path_length=2\tnumber\t\tStep this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"name": "path_length",
			"type": "number",
			"description": "Step this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"default_value": "2"
		},
		{
			"directive": "param",
			"text": "path_width=1\tnumber\t\tMake all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"name": "path_width",
			"type": "number",
			"description": "Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"default_value": "1"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\t\tThe number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).",
		"type": "number",
		"description": "The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2)."
	},
	"name_full": "worldeditadditions.maze2d",
	"filename": "worldeditadditions/lib/maze2d.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/maze2d.lua#L121-L132"
}

maze3d 🔗

Generates a 3D maze. Algorithm origin: https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html

The defined region must be at least 3 x 3 x 3 (x, y, z) for a maze to generate.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to draw the 3D maze in in.

pos2Vector3nil

pos2 of the defined region to draw the 3D maze in in.

target_nodestringnil

The (normalised) node name to draw the maze in.

path_lengthnumber2

Step this many nodes forwards at once when generating the maze. Higher values create long thin corridors.

path_widthnumber1

Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors. Caution: Make sure this value is not higher than path_length - 1, otherwise the maze algorithm won't work right!

path_depthnumber1

Make all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze. Caution: The same warning as with path_width applies here also!

Returns

number :

The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).

Source
--- Generates a 3D maze.
-- **Algorithm origin:** https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html
-- 
-- The defined region must be at least 3 x 3 x 3 (x, y, z) for a maze to generate.
-- @param	pos1			Vector3		pos1 of the defined region to draw the 3D maze in in.
-- @param	pos2			Vector3		pos2 of the defined region to draw the 3D maze in in.
-- @param	target_node		string		The (normalised) node name to draw the maze in.
-- @param	path_length=2	number		Step this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.
-- @param	path_width=1	number		Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.
-- **Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!
-- @param	path_depth=1	number		Make all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze.
-- **Caution:** The same warning as with `path_width` applies here also!
-- @returns	number			The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).
function worldeditadditions.maze3d(pos1, pos2, target_node, seed, path_length, path_width, path_depth)
{
	"type": "function",
	"internal": false,
	"description": "Generates a 3D maze.\n**Algorithm origin:** https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html\n\nThe defined region must be at least 3 x 3 x 3 (x, y, z) for a maze to generate.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tpos1 of the defined region to draw the 3D maze in in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to draw the 3D maze in in."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tpos2 of the defined region to draw the 3D maze in in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to draw the 3D maze in in."
		},
		{
			"directive": "param",
			"text": "target_node\t\tstring\t\tThe (normalised) node name to draw the maze in.",
			"name": "target_node",
			"type": "string",
			"description": "The (normalised) node name to draw the maze in."
		},
		{
			"directive": "param",
			"text": "path_length=2\tnumber\t\tStep this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"name": "path_length",
			"type": "number",
			"description": "Step this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"default_value": "2"
		},
		{
			"directive": "param",
			"text": "path_width=1\tnumber\t\tMake all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"name": "path_width",
			"type": "number",
			"description": "Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"default_value": "1"
		},
		{
			"directive": "param",
			"text": "path_depth=1\tnumber\t\tMake all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze.\n**Caution:** The same warning as with `path_width` applies here also!",
			"name": "path_depth",
			"type": "number",
			"description": "Make all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze.\n**Caution:** The same warning as with `path_width` applies here also!",
			"default_value": "1"
		},
		{
			"directive": "returns",
			"text": "number\t\t\tThe number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).",
			"type": "number",
			"description": "The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2)."
		}
	],
	"line": 173,
	"namespace": "worldeditadditions",
	"line_last": 186,
	"name": "maze3d",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"target_node",
		"seed",
		"path_length",
		"path_width",
		"path_depth"
	],
	"text": "--- Generates a 3D maze.\n-- **Algorithm origin:** https://starbeamrainbowlabs.com/blog/article.php?article=posts/070-Language-Review-Lua.html\n-- \n-- The defined region must be at least 3 x 3 x 3 (x, y, z) for a maze to generate.\n-- @param\tpos1\t\t\tVector3\t\tpos1 of the defined region to draw the 3D maze in in.\n-- @param\tpos2\t\t\tVector3\t\tpos2 of the defined region to draw the 3D maze in in.\n-- @param\ttarget_node\t\tstring\t\tThe (normalised) node name to draw the maze in.\n-- @param\tpath_length=2\tnumber\t\tStep this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.\n-- @param\tpath_width=1\tnumber\t\tMake all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n-- **Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!\n-- @param\tpath_depth=1\tnumber\t\tMake all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze.\n-- **Caution:** The same warning as with `path_width` applies here also!\n-- @returns\tnumber\t\t\tThe number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).\nfunction worldeditadditions.maze3d(pos1, pos2, target_node, seed, path_length, path_width, path_depth)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tpos1 of the defined region to draw the 3D maze in in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to draw the 3D maze in in."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tpos2 of the defined region to draw the 3D maze in in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to draw the 3D maze in in."
		},
		{
			"directive": "param",
			"text": "target_node\t\tstring\t\tThe (normalised) node name to draw the maze in.",
			"name": "target_node",
			"type": "string",
			"description": "The (normalised) node name to draw the maze in."
		},
		{
			"directive": "param",
			"text": "path_length=2\tnumber\t\tStep this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"name": "path_length",
			"type": "number",
			"description": "Step this many nodes forwards at once when generating the maze.  Higher values create long thin corridors.",
			"default_value": "2"
		},
		{
			"directive": "param",
			"text": "path_width=1\tnumber\t\tMake all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"name": "path_width",
			"type": "number",
			"description": "Make all corridors this number of nodes wide when generating the maze. Higher values result in wider corridors.\n**Caution:** Make sure this value is not higher than `path_length - 1`, otherwise the maze algorithm won't work right!",
			"default_value": "1"
		},
		{
			"directive": "param",
			"text": "path_depth=1\tnumber\t\tMake all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze.\n**Caution:** The same warning as with `path_width` applies here also!",
			"name": "path_depth",
			"type": "number",
			"description": "Make all corridors this number of nodes tall when generating the maze. Higher values results in higher ceilings in the maze.\n**Caution:** The same warning as with `path_width` applies here also!",
			"default_value": "1"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\t\tThe number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2).",
		"type": "number",
		"description": "The number of nodes replaced (i.e. the volume fo the region defined by pos1 and pos2)."
	},
	"name_full": "worldeditadditions.maze3d",
	"filename": "worldeditadditions/lib/maze3d.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/maze3d.lua#L174-L187"
}

move 🔗

Moves a region to another location, overwriting any nodes at the target location.

Arguments

NameTypeDefault valueDescription
source_pos1Vector3nil

pos1 of the source region to move.

source_pos2Vector3nil

pos2 of the source region to move.

target_pos1Vector3nil

pos1 of the target region to move to.

target_pos2Vector3nil

pos2 of the target region to move to.

airapplyboolfalse

Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not. Caution: If true, then nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!

Returns

bool,numbers :

  1. Whether the move operation was successful or not
  2. The total number of nodes actually placed in the target region.

Source
--- Moves a region to another location, overwriting any nodes at the target location.
-- @param	source_pos1		Vector3		pos1 of the source region to move.
-- @param	source_pos2		Vector3		pos2 of the source region to move.
-- @param	target_pos1		Vector3		pos1 of the target region to move to.
-- @param	target_pos2		Vector3		pos2 of the target region to move to.
-- @param	airapply=false	bool		Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.
-- **Caution:** If true, then **nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!**
-- @returns	bool,numbers	1. Whether the move operation was successful or not
-- 							2. The total number of nodes actually placed in the target region.
function worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_pos2, airapply)
{
	"type": "function",
	"internal": false,
	"description": "Moves a region to another location, overwriting any nodes at the target location.",
	"directives": [
		{
			"directive": "param",
			"text": "source_pos1\t\tVector3\t\tpos1 of the source region to move.",
			"name": "source_pos1",
			"type": "Vector3",
			"description": "pos1 of the source region to move."
		},
		{
			"directive": "param",
			"text": "source_pos2\t\tVector3\t\tpos2 of the source region to move.",
			"name": "source_pos2",
			"type": "Vector3",
			"description": "pos2 of the source region to move."
		},
		{
			"directive": "param",
			"text": "target_pos1\t\tVector3\t\tpos1 of the target region to move to.",
			"name": "target_pos1",
			"type": "Vector3",
			"description": "pos1 of the target region to move to."
		},
		{
			"directive": "param",
			"text": "target_pos2\t\tVector3\t\tpos2 of the target region to move to.",
			"name": "target_pos2",
			"type": "Vector3",
			"description": "pos2 of the target region to move to."
		},
		{
			"directive": "param",
			"text": "airapply=false\tbool\t\tWhether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.\n**Caution:** If true, then **nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!**",
			"name": "airapply",
			"type": "bool",
			"description": "Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.\n**Caution:** If true, then **nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!**",
			"default_value": "false"
		},
		{
			"directive": "returns",
			"text": "bool,numbers\t1. Whether the move operation was successful or not\n2. The total number of nodes actually placed in the target region.",
			"type": "bool,numbers",
			"description": "1. Whether the move operation was successful or not\n2. The total number of nodes actually placed in the target region."
		}
	],
	"line": 13,
	"namespace": "worldeditadditions",
	"line_last": 22,
	"name": "move",
	"instanced": false,
	"args": [
		"source_pos1",
		"source_pos2",
		"target_pos1",
		"target_pos2",
		"airapply"
	],
	"text": "--- Moves a region to another location, overwriting any nodes at the target location.\n-- @param\tsource_pos1\t\tVector3\t\tpos1 of the source region to move.\n-- @param\tsource_pos2\t\tVector3\t\tpos2 of the source region to move.\n-- @param\ttarget_pos1\t\tVector3\t\tpos1 of the target region to move to.\n-- @param\ttarget_pos2\t\tVector3\t\tpos2 of the target region to move to.\n-- @param\tairapply=false\tbool\t\tWhether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.\n-- **Caution:** If true, then **nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!**\n-- @returns\tbool,numbers\t1. Whether the move operation was successful or not\n-- \t\t\t\t\t\t\t2. The total number of nodes actually placed in the target region.\nfunction worldeditadditions.move(source_pos1, source_pos2, target_pos1, target_pos2, airapply)",
	"params": [
		{
			"directive": "param",
			"text": "source_pos1\t\tVector3\t\tpos1 of the source region to move.",
			"name": "source_pos1",
			"type": "Vector3",
			"description": "pos1 of the source region to move."
		},
		{
			"directive": "param",
			"text": "source_pos2\t\tVector3\t\tpos2 of the source region to move.",
			"name": "source_pos2",
			"type": "Vector3",
			"description": "pos2 of the source region to move."
		},
		{
			"directive": "param",
			"text": "target_pos1\t\tVector3\t\tpos1 of the target region to move to.",
			"name": "target_pos1",
			"type": "Vector3",
			"description": "pos1 of the target region to move to."
		},
		{
			"directive": "param",
			"text": "target_pos2\t\tVector3\t\tpos2 of the target region to move to.",
			"name": "target_pos2",
			"type": "Vector3",
			"description": "pos2 of the target region to move to."
		},
		{
			"directive": "param",
			"text": "airapply=false\tbool\t\tWhether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.\n**Caution:** If true, then **nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!**",
			"name": "airapply",
			"type": "bool",
			"description": "Whether to only replace target nodes that are air-like, leaving those that are not air-like. If false, then all target nodes are replaced regardless of whether they are air-like nodes or not.\n**Caution:** If true, then **nodes in the source region will be removed and replaced with air, even if they are unable to be placed in the target location!**",
			"default_value": "false"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,numbers\t1. Whether the move operation was successful or not\n2. The total number of nodes actually placed in the target region.",
		"type": "bool,numbers",
		"description": "1. Whether the move operation was successful or not\n2. The total number of nodes actually placed in the target region."
	},
	"name_full": "worldeditadditions.move",
	"filename": "worldeditadditions/lib/move.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/move.lua#L14-L23"
}

nodeapply 🔗

Like ellipsoidapply and airapply, but much more flexible, allowing custom sets of nodes to filter changes on. Any changes that don't replace nodes that match the given nodelist will be discarded. Takes a backup copy of the defined region, runs the given function, and then restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position defining the region boundary

pos2Vector3nil

The 2nd positioon defining the region boundary

nodeliststring[]nil

The nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!

funcfunctionnil

The function to call that performs the action in question. It is expected that the given function will accept no arguments.

Returns

nil

Source
--- Like ellipsoidapply and airapply, but much more flexible, allowing custom sets of nodes to filter changes on. Any changes that don't replace nodes that match the given nodelist will be discarded.
-- Takes a backup copy of the defined region, runs the given function, and then
-- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.
-- @param	pos1		Vector3		The 1st position defining the region boundary
-- @param	pos2		Vector3		The 2nd positioon defining the region boundary
-- @param	nodelist	string[]	The nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!
-- @param	func		function	The function to call that performs the action in question. It is expected that the given function will accept no arguments.
function worldeditadditions.nodeapply(pos1, pos2, nodelist, func)
{
	"type": "function",
	"internal": false,
	"description": "Like ellipsoidapply and airapply, but much more flexible, allowing custom sets of nodes to filter changes on. Any changes that don't replace nodes that match the given nodelist will be discarded.\nTakes a backup copy of the defined region, runs the given function, and then\nrestores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "nodelist\tstring[]\tThe nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!",
			"name": "nodelist",
			"type": "string[]",
			"description": "The nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!"
		},
		{
			"directive": "param",
			"text": "func\t\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"line": 20,
	"namespace": "worldeditadditions",
	"line_last": 27,
	"name": "nodeapply",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"nodelist",
		"func"
	],
	"text": "--- Like ellipsoidapply and airapply, but much more flexible, allowing custom sets of nodes to filter changes on. Any changes that don't replace nodes that match the given nodelist will be discarded.\n-- Takes a backup copy of the defined region, runs the given function, and then\n-- restores the bits around the edge that aren't inside the largest ellipsoid that will fit inside the defined region.\n-- @param\tpos1\t\tVector3\t\tThe 1st position defining the region boundary\n-- @param\tpos2\t\tVector3\t\tThe 2nd positioon defining the region boundary\n-- @param\tnodelist\tstring[]\tThe nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!\n-- @param\tfunc\t\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.\nfunction worldeditadditions.nodeapply(pos1, pos2, nodelist, func)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "nodelist\tstring[]\tThe nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!",
			"name": "nodelist",
			"type": "string[]",
			"description": "The nodelist to match changes against. Any changes that don't replace nodes on this list will be discarded. The following special node names are also accepted: liquid, air. Note that all node names MUST be normalised, otherwise they won't be recognised!"
		},
		{
			"directive": "param",
			"text": "func\t\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"name_full": "worldeditadditions.nodeapply",
	"filename": "worldeditadditions/lib/nodeapply.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/nodeapply.lua#L21-L28"
}

noiseapply2d 🔗

Similar to cubeapply, except that it takes 2 positions and randomly keeps changes based on a noise pattern. Takes a backup copy of the defined region, runs the given function, and then restores the bits that aren't above the noise threshold.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position defining the region boundary

pos2Vector3nil

The 2nd positioon defining the region boundary

funcfunctionnil

The function to call that performs the action in question. It is expected that the given function will accept no arguments.

Returns

nil

Source
--- Similar to cubeapply, except that it takes 2 positions and randomly keeps changes based on a noise pattern.
-- Takes a backup copy of the defined region, runs the given function, and then
-- restores the bits that aren't above the noise threshold.
-- @param	pos1	Vector3		The 1st position defining the region boundary
-- @param	pos2	Vector3		The 2nd positioon defining the region boundary 
-- @param	func	function	The function to call that performs the action in question. It is expected that the given function will accept no arguments.
function worldeditadditions.noiseapply2d(pos1, pos2, threshold, scale, func)
{
	"type": "function",
	"internal": false,
	"description": "Similar to cubeapply, except that it takes 2 positions and randomly keeps changes based on a noise pattern.\nTakes a backup copy of the defined region, runs the given function, and then\nrestores the bits that aren't above the noise threshold.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "func\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 18,
	"name": "noiseapply2d",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"threshold",
		"scale",
		"func"
	],
	"text": "--- Similar to cubeapply, except that it takes 2 positions and randomly keeps changes based on a noise pattern.\n-- Takes a backup copy of the defined region, runs the given function, and then\n-- restores the bits that aren't above the noise threshold.\n-- @param\tpos1\tVector3\t\tThe 1st position defining the region boundary\n-- @param\tpos2\tVector3\t\tThe 2nd positioon defining the region boundary \n-- @param\tfunc\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.\nfunction worldeditadditions.noiseapply2d(pos1, pos2, threshold, scale, func)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe 1st position defining the region boundary",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the region boundary"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe 2nd positioon defining the region boundary",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the region boundary"
		},
		{
			"directive": "param",
			"text": "func\tfunction\tThe function to call that performs the action in question. It is expected that the given function will accept no arguments.",
			"name": "func",
			"type": "function",
			"description": "The function to call that performs the action in question. It is expected that the given function will accept no arguments."
		}
	],
	"name_full": "worldeditadditions.noiseapply2d",
	"filename": "worldeditadditions/lib/noiseapply2d.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/noiseapply2d.lua#L13-L19"
}

orient 🔗

Re-orients the nodes in the given region around a given origin point using a set of rotations. TODO Learn quaternions and make this more effiient.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

Position 1 of the region to orient nodes in.

pos2Vector3nil

Position 2 of the region to orient nodes in.

rotlisttable<{axis: string, rad: number}>nil

The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).

Returns

bool,string|table<{changed: number}> :

A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.

Currently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.

This is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation.

Source
--- Re-orients the nodes in the given region around a given origin point using a set of rotations.
-- TODO Learn quaternions and make this more effiient.
-- @param	pos1	Vector3		Position 1 of the region to orient nodes in.
-- @param	pos2	Vector3		Position 2 of the region to orient nodes in.
-- @param	rotlist		table<{axis: string, rad: number}>	The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).
-- @returns	bool,string|table<{changed: number}>	A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.
--
-- Currently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.
--
-- This is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation.
function worldeditadditions.orient(pos1, pos2, rotlist)
{
	"type": "function",
	"internal": false,
	"description": "Re-orients the nodes in the given region around a given origin point using a set of rotations.\nTODO Learn quaternions and make this more effiient.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 of the region to orient nodes in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 of the region to orient nodes in."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 of the region to orient nodes in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 of the region to orient nodes in."
		},
		{
			"directive": "param",
			"text": "rotlist\t\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).",
			"name": "rotlist",
			"type": "table<{axis: string, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter)."
		},
		{
			"directive": "returns",
			"text": "bool,string|table<{changed: number}>\tA success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation.",
			"type": "bool,string|table<{changed: number}>",
			"description": "A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation."
		}
	],
	"line": 16,
	"namespace": "worldeditadditions",
	"line_last": 26,
	"name": "orient",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"rotlist"
	],
	"text": "--- Re-orients the nodes in the given region around a given origin point using a set of rotations.\n-- TODO Learn quaternions and make this more effiient.\n-- @param\tpos1\tVector3\t\tPosition 1 of the region to orient nodes in.\n-- @param\tpos2\tVector3\t\tPosition 2 of the region to orient nodes in.\n-- @param\trotlist\t\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).\n-- @returns\tbool,string|table<{changed: number}>\tA success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n--\n-- Currently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n--\n-- This is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation.\nfunction worldeditadditions.orient(pos1, pos2, rotlist)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 of the region to orient nodes in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 of the region to orient nodes in."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 of the region to orient nodes in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 of the region to orient nodes in."
		},
		{
			"directive": "param",
			"text": "rotlist\t\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).",
			"name": "rotlist",
			"type": "table<{axis: string, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string|table<{changed: number}>\tA success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation.",
		"type": "bool,string|table<{changed: number}>",
		"description": "A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since not every node in the target region will support reorientation."
	},
	"name_full": "worldeditadditions.orient",
	"filename": "worldeditadditions/lib/orient.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/orient.lua#L17-L27"
}

overlay 🔗

Overlap command. Places a specified node on top of each column.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to perform the overlay operation in.

pos2Vector3nil

pos2 of the defined region to perform the overlay operation in.

node_weightstable<string,number>nil

A table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting. Consider it like a ratio.

Returns

table<string,number|table<number,number>> :

A table of statistics about the operation performed. | Key

Source
--- Overlap command. Places a specified node on top of each column.
-- @param	pos1			Vector3		pos1 of the defined region to perform the overlay operation in.
-- @param	pos2			Vector3		pos2 of the defined region to perform the overlay operation in.
-- @param	node_weights	table<string,number>	A table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting.
-- Consider it like a ratio.
-- @returns	table<string,number|table<number,number>>	A table of statistics about the operation performed.
-- | Key		| Value Type	| Meaning		|
-- |------------|---------------|---------------|
-- | `updated`	| number		| The number of nodes placed. |
-- | `skipped_columns` | number	| The number of columns skipped. This could be because there is no airlike not in that column, or the top node is not airlike. |
-- | `placed`	| table<number,number> | A map of node ids to the number of that node that was placed. |
function worldeditadditions.overlay(pos1, pos2, node_weights)
{
	"type": "function",
	"internal": false,
	"description": "Overlap command. Places a specified node on top of each column.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tpos1 of the defined region to perform the overlay operation in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to perform the overlay operation in."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tpos2 of the defined region to perform the overlay operation in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to perform the overlay operation in."
		},
		{
			"directive": "param",
			"text": "node_weights\ttable<string,number>\tA table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting.\nConsider it like a ratio.",
			"name": "node_weights",
			"type": "table<string,number>",
			"description": "A table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting.\nConsider it like a ratio."
		},
		{
			"directive": "returns",
			"text": "table<string,number|table<number,number>>\tA table of statistics about the operation performed.\n| Key\t\t| Value Type\t| Meaning\t\t|\n|------------|---------------|---------------|\n| `updated`\t| number\t\t| The number of nodes placed. |\n| `skipped_columns` | number\t| The number of columns skipped. This could be because there is no airlike not in that column, or the top node is not airlike. |\n| `placed`\t| table<number,number> | A map of node ids to the number of that node that was placed. |",
			"type": "table<string,number|table<number,number>>",
			"description": "A table of statistics about the operation performed.\n| Key"
		}
	],
	"line": 6,
	"namespace": "worldeditadditions",
	"line_last": 17,
	"name": "overlay",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"node_weights"
	],
	"text": "--- Overlap command. Places a specified node on top of each column.\n-- @param\tpos1\t\t\tVector3\t\tpos1 of the defined region to perform the overlay operation in.\n-- @param\tpos2\t\t\tVector3\t\tpos2 of the defined region to perform the overlay operation in.\n-- @param\tnode_weights\ttable<string,number>\tA table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting.\n-- Consider it like a ratio.\n-- @returns\ttable<string,number|table<number,number>>\tA table of statistics about the operation performed.\n-- | Key\t\t| Value Type\t| Meaning\t\t|\n-- |------------|---------------|---------------|\n-- | `updated`\t| number\t\t| The number of nodes placed. |\n-- | `skipped_columns` | number\t| The number of columns skipped. This could be because there is no airlike not in that column, or the top node is not airlike. |\n-- | `placed`\t| table<number,number> | A map of node ids to the number of that node that was placed. |\nfunction worldeditadditions.overlay(pos1, pos2, node_weights)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tpos1 of the defined region to perform the overlay operation in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to perform the overlay operation in."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tpos2 of the defined region to perform the overlay operation in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to perform the overlay operation in."
		},
		{
			"directive": "param",
			"text": "node_weights\ttable<string,number>\tA table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting.\nConsider it like a ratio.",
			"name": "node_weights",
			"type": "table<string,number>",
			"description": "A table mapping (normalised) node names to their relative weight. Nodes with a higher weight are placed more often than those with a lower weighting.\nConsider it like a ratio."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table<string,number|table<number,number>>\tA table of statistics about the operation performed.\n| Key\t\t| Value Type\t| Meaning\t\t|\n|------------|---------------|---------------|\n| `updated`\t| number\t\t| The number of nodes placed. |\n| `skipped_columns` | number\t| The number of columns skipped. This could be because there is no airlike not in that column, or the top node is not airlike. |\n| `placed`\t| table<number,number> | A map of node ids to the number of that node that was placed. |",
		"type": "table<string,number|table<number,number>>",
		"description": "A table of statistics about the operation performed.\n| Key"
	},
	"name_full": "worldeditadditions.overlay",
	"filename": "worldeditadditions/lib/overlay.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/overlay.lua#L7-L18"
}

replacemix 🔗

Like //mix, but replaces a given node instead. TODO: Implement //replacesplat, which picks seeder nodes with a percentage chance, and then some growth passes with e.g. cellular automata? We should probably be pushing towards a release though round about now

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

pos1 of the defined region to replace nodes in.

pos2Vector3nil

pos2 of the defined region to replace nodes in.

target_nodestringnil

The normalised name of the node to replace.

target_node_chancenumbernil

The chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance.

replacementstable<string,number>nil

A map of normalised node names to relative weights for the nodes to replace target_node with. Nodes with higher weights will be chosen to replace target_node more often.

Returns

bool,number,number,table<number,number> :

  1. Whether the operation was successful or not.
  2. The number of nodes actually placed.
  3. The number of nodes that could have been replaced if target_node_chance were set to 1.
  4. A map of node ids to the number of times that node was placed.

Source
--- Like //mix, but replaces a given node instead.
-- TODO: Implement //replacesplat, which picks seeder nodes with a percentage chance, and then some growth passes with e.g. cellular automata? We should probably be pushing towards a release though round about now
-- @param	pos1		Vector3		pos1 of the defined region to replace nodes in.
-- @param	pos2		Vector3		pos2 of the defined region to replace nodes in.
-- @param	target_node	string		The normalised name of the node to replace.
-- @param	target_node_chance	number	The chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance.
-- @param	replacements		table<string,number>	A map of normalised node names to relative weights for the nodes to replace `target_node` with. Nodes with higher weights will be chosen to replace `target_node` more often.
-- @returns	bool,number,number,table<number,number>		1. Whether the operation was successful or not.
-- 2. The number of nodes actually placed.
-- 3. The number of nodes that *could* have been replaced if `target_node_chance` were set to 1.
-- 4. A map of node ids to the number of times that node was placed.
function worldeditadditions.replacemix(pos1, pos2, target_node, target_node_chance, replacements)
{
	"type": "function",
	"internal": false,
	"description": "Like //mix, but replaces a given node instead.\nTODO: Implement //replacesplat, which picks seeder nodes with a percentage chance, and then some growth passes with e.g. cellular automata? We should probably be pushing towards a release though round about now",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to replace nodes in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to replace nodes in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to replace nodes in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to replace nodes in."
		},
		{
			"directive": "param",
			"text": "target_node\tstring\t\tThe normalised name of the node to replace.",
			"name": "target_node",
			"type": "string",
			"description": "The normalised name of the node to replace."
		},
		{
			"directive": "param",
			"text": "target_node_chance\tnumber\tThe chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance.",
			"name": "target_node_chance",
			"type": "number",
			"description": "The chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance."
		},
		{
			"directive": "param",
			"text": "replacements\t\ttable<string,number>\tA map of normalised node names to relative weights for the nodes to replace `target_node` with. Nodes with higher weights will be chosen to replace `target_node` more often.",
			"name": "replacements",
			"type": "table<string,number>",
			"description": "A map of normalised node names to relative weights for the nodes to replace `target_node` with. Nodes with higher weights will be chosen to replace `target_node` more often."
		},
		{
			"directive": "returns",
			"text": "bool,number,number,table<number,number>\t\t1. Whether the operation was successful or not.\n2. The number of nodes actually placed.\n3. The number of nodes that *could* have been replaced if `target_node_chance` were set to 1.\n4. A map of node ids to the number of times that node was placed.",
			"type": "bool,number,number,table<number,number>",
			"description": "1. Whether the operation was successful or not.\n2. The number of nodes actually placed.\n3. The number of nodes that *could* have been replaced if `target_node_chance` were set to 1.\n4. A map of node ids to the number of times that node was placed."
		}
	],
	"line": 13,
	"namespace": "worldeditadditions",
	"line_last": 24,
	"name": "replacemix",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"target_node",
		"target_node_chance",
		"replacements"
	],
	"text": "--- Like //mix, but replaces a given node instead.\n-- TODO: Implement //replacesplat, which picks seeder nodes with a percentage chance, and then some growth passes with e.g. cellular automata? We should probably be pushing towards a release though round about now\n-- @param\tpos1\t\tVector3\t\tpos1 of the defined region to replace nodes in.\n-- @param\tpos2\t\tVector3\t\tpos2 of the defined region to replace nodes in.\n-- @param\ttarget_node\tstring\t\tThe normalised name of the node to replace.\n-- @param\ttarget_node_chance\tnumber\tThe chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance.\n-- @param\treplacements\t\ttable<string,number>\tA map of normalised node names to relative weights for the nodes to replace `target_node` with. Nodes with higher weights will be chosen to replace `target_node` more often.\n-- @returns\tbool,number,number,table<number,number>\t\t1. Whether the operation was successful or not.\n-- 2. The number of nodes actually placed.\n-- 3. The number of nodes that *could* have been replaced if `target_node_chance` were set to 1.\n-- 4. A map of node ids to the number of times that node was placed.\nfunction worldeditadditions.replacemix(pos1, pos2, target_node, target_node_chance, replacements)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tpos1 of the defined region to replace nodes in.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region to replace nodes in."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tpos2 of the defined region to replace nodes in.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region to replace nodes in."
		},
		{
			"directive": "param",
			"text": "target_node\tstring\t\tThe normalised name of the node to replace.",
			"name": "target_node",
			"type": "string",
			"description": "The normalised name of the node to replace."
		},
		{
			"directive": "param",
			"text": "target_node_chance\tnumber\tThe chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance.",
			"name": "target_node_chance",
			"type": "number",
			"description": "The chance that the target_node should be replaced. This is a 1-in-N chance, so far example a value of 4 would be a 1 in 4 chance of replacement = 25% chance."
		},
		{
			"directive": "param",
			"text": "replacements\t\ttable<string,number>\tA map of normalised node names to relative weights for the nodes to replace `target_node` with. Nodes with higher weights will be chosen to replace `target_node` more often.",
			"name": "replacements",
			"type": "table<string,number>",
			"description": "A map of normalised node names to relative weights for the nodes to replace `target_node` with. Nodes with higher weights will be chosen to replace `target_node` more often."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,number,number,table<number,number>\t\t1. Whether the operation was successful or not.\n2. The number of nodes actually placed.\n3. The number of nodes that *could* have been replaced if `target_node_chance` were set to 1.\n4. A map of node ids to the number of times that node was placed.",
		"type": "bool,number,number,table<number,number>",
		"description": "1. Whether the operation was successful or not.\n2. The number of nodes actually placed.\n3. The number of nodes that *could* have been replaced if `target_node_chance` were set to 1.\n4. A map of node ids to the number of times that node was placed."
	},
	"name_full": "worldeditadditions.replacemix",
	"filename": "worldeditadditions/lib/replacemix.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/replacemix.lua#L14-L25"
}

revolve 🔗

Make <times> copies of the region defined by pos1-pos2 at equal angles around a circle. The defined region works best if it's a thin slice that's 1 or 2 blocks thick. For example, if one provided a times value of 3, copies would be rotated 0, 120, and 240 degrees. TODO: implement support to rotate around arbitrary axes. TODO: implement support for stairs, and slabs when we get arbitrary axis rotation support done.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The first position defining the source region.

pos2Vector3nil

The second position defining the source region.

originVector3nil

The pivot point to rotate around.

timesnumbernil

The number of equally-spaces copies to make.

Returns

nil

Source
--- Make <times> copies of the region defined by pos1-pos2 at equal angles around a circle.
-- The defined region works best if it's a thin slice that's 1 or 2 blocks thick.
-- For example, if one provided a times value of 3, copies would be rotated 0, 120, and 240 degrees.  
-- TODO: implement support to rotate around arbitrary axes.  
-- TODO: implement support for stairs, and slabs when we get arbitrary axis rotation support done.
-- @param	pos1	Vector3		The first position defining the source region.
-- @param	pos2	Vector3		The second position defining the source region.
-- @param	origin	Vector3		The pivot point to rotate around.
-- @param	times	number		The number of equally-spaces copies to make.
function worldeditadditions.revolve(pos1, pos2, origin, times)
{
	"type": "function",
	"internal": false,
	"description": "Make <times> copies of the region defined by pos1-pos2 at equal angles around a circle.\nThe defined region works best if it's a thin slice that's 1 or 2 blocks thick.\nFor example, if one provided a times value of 3, copies would be rotated 0, 120, and 240 degrees.\nTODO: implement support to rotate around arbitrary axes.\nTODO: implement support for stairs, and slabs when we get arbitrary axis rotation support done.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe first position defining the source region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The first position defining the source region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe second position defining the source region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The second position defining the source region."
		},
		{
			"directive": "param",
			"text": "origin\tVector3\t\tThe pivot point to rotate around.",
			"name": "origin",
			"type": "Vector3",
			"description": "The pivot point to rotate around."
		},
		{
			"directive": "param",
			"text": "times\tnumber\t\tThe number of equally-spaces copies to make.",
			"name": "times",
			"type": "number",
			"description": "The number of equally-spaces copies to make."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 21,
	"name": "revolve",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"origin",
		"times"
	],
	"text": "--- Make <times> copies of the region defined by pos1-pos2 at equal angles around a circle.\n-- The defined region works best if it's a thin slice that's 1 or 2 blocks thick.\n-- For example, if one provided a times value of 3, copies would be rotated 0, 120, and 240 degrees.  \n-- TODO: implement support to rotate around arbitrary axes.  \n-- TODO: implement support for stairs, and slabs when we get arbitrary axis rotation support done.\n-- @param\tpos1\tVector3\t\tThe first position defining the source region.\n-- @param\tpos2\tVector3\t\tThe second position defining the source region.\n-- @param\torigin\tVector3\t\tThe pivot point to rotate around.\n-- @param\ttimes\tnumber\t\tThe number of equally-spaces copies to make.\nfunction worldeditadditions.revolve(pos1, pos2, origin, times)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe first position defining the source region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The first position defining the source region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe second position defining the source region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The second position defining the source region."
		},
		{
			"directive": "param",
			"text": "origin\tVector3\t\tThe pivot point to rotate around.",
			"name": "origin",
			"type": "Vector3",
			"description": "The pivot point to rotate around."
		},
		{
			"directive": "param",
			"text": "times\tnumber\t\tThe number of equally-spaces copies to make.",
			"name": "times",
			"type": "number",
			"description": "The number of equally-spaces copies to make."
		}
	],
	"name_full": "worldeditadditions.revolve",
	"filename": "worldeditadditions/lib/revolve.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/revolve.lua#L13-L22"
}

rotate 🔗

Rotates the given region around a given origin point using a set of rotations. TODO Learn quaternions and make this more effiient.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

Position 1 of the defined region to rotate.

pos2Vector3nil

Position 2 of the defined region to rotate.

originVector3nil

The coordinates of the origin point around which we should rotate the region defined by pos1..pos2.

rotlisttable<{axis: string, rad: number}>nil

The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).

Returns

bool,string|table<{changed: number}> :

A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.

Currently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.

This is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region.

Source
--- Rotates the given region around a given origin point using a set of rotations.
-- TODO Learn quaternions and make this more effiient.
-- @param	pos1	Vector3		Position 1 of the defined region to rotate.
-- @param	pos2	Vector3		Position 2 of the defined region to rotate.
-- @param	origin	Vector3		The coordinates of the origin point around which we should rotate the region defined by pos1..pos2.
-- @param	rotlist		table<{axis: string, rad: number}>	The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).
-- @returns	bool,string|table<{changed: number}>	A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.
-- 
-- Currently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.
-- 
-- This is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region.
function worldeditadditions.rotate(pos1, pos2, origin, rotlist)
{
	"type": "function",
	"internal": false,
	"description": "Rotates the given region around a given origin point using a set of rotations.\nTODO Learn quaternions and make this more effiient.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 of the defined region to rotate.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 of the defined region to rotate."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 of the defined region to rotate.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 of the defined region to rotate."
		},
		{
			"directive": "param",
			"text": "origin\tVector3\t\tThe coordinates of the origin point around which we should rotate the region defined by pos1..pos2.",
			"name": "origin",
			"type": "Vector3",
			"description": "The coordinates of the origin point around which we should rotate the region defined by pos1..pos2."
		},
		{
			"directive": "param",
			"text": "rotlist\t\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).",
			"name": "rotlist",
			"type": "table<{axis: string, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter)."
		},
		{
			"directive": "returns",
			"text": "bool,string|table<{changed: number}>\tA success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region.",
			"type": "bool,string|table<{changed: number}>",
			"description": "A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region."
		}
	],
	"line": 14,
	"namespace": "worldeditadditions",
	"line_last": 25,
	"name": "rotate",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"origin",
		"rotlist"
	],
	"text": "--- Rotates the given region around a given origin point using a set of rotations.\n-- TODO Learn quaternions and make this more effiient.\n-- @param\tpos1\tVector3\t\tPosition 1 of the defined region to rotate.\n-- @param\tpos2\tVector3\t\tPosition 2 of the defined region to rotate.\n-- @param\torigin\tVector3\t\tThe coordinates of the origin point around which we should rotate the region defined by pos1..pos2.\n-- @param\trotlist\t\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).\n-- @returns\tbool,string|table<{changed: number}>\tA success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n-- \n-- Currently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n-- \n-- This is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region.\nfunction worldeditadditions.rotate(pos1, pos2, origin, rotlist)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 of the defined region to rotate.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 of the defined region to rotate."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 of the defined region to rotate.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 of the defined region to rotate."
		},
		{
			"directive": "param",
			"text": "origin\tVector3\t\tThe coordinates of the origin point around which we should rotate the region defined by pos1..pos2.",
			"name": "origin",
			"type": "Vector3",
			"description": "The coordinates of the origin point around which we should rotate the region defined by pos1..pos2."
		},
		{
			"directive": "param",
			"text": "rotlist\t\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter).",
			"name": "rotlist",
			"type": "table<{axis: string, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string|table<{changed: number}>\tA success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region.",
		"type": "bool,string|table<{changed: number}>",
		"description": "A success boolean (true == success; false == failure), followed by either an error message as a string if success == false or a table of statistics if success == true.\n\nCurrently the only parameter in the statistics table is changed, which is a number representing the number of nodes that were rotated.\n\nThis is NOT NECESSARILY the number of nodes in the target region..... since rotations and roundings mean the target area the source region was rotated into could have slightly more or less nodes than the source region."
	},
	"name_full": "worldeditadditions.rotate",
	"filename": "worldeditadditions/lib/rotate.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/rotate.lua#L15-L26"
}

scale 🔗

Scales the defined region by the given scale factor in the given anchors. Scale factor vectors containing both scale up and scale down operations are split into 2 different scale operations automatically. Scale up operations are always performed before scale down operations to preserve detail. If performance is important, you should split the scale operations up manually!

Arguments

NameTypeDefault valueDescription
pos1Vectornil

Position 1 of the defined region,

pos2Vectornil

Position 2 of the defined region.

scaleVectornil

The scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation).

anchorVectornil

The anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions.

Returns

boolean, string|table :

Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.

Source
--- Scales the defined region by the given scale factor in the given anchors.
-- Scale factor vectors containing both scale up and scale down operations are
-- split into 2 different scale operations automatically.
-- Scale up operations are always performed before scale down operations to
-- preserve detail. If performance is important, you should split the scale
-- operations up manually!
-- @param	pos1		Vector	Position 1 of the defined region,
-- @param	pos2		Vector	Position 2 of the defined region.
-- @param	scale		Vector	The scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation).
-- @param	anchor		Vector	The anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions.
-- @return	boolean, string|table	Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.
function worldeditadditions.scale(pos1, pos2, scale, anchor)
{
	"type": "function",
	"internal": false,
	"description": "Scales the defined region by the given scale factor in the given anchors.\nScale factor vectors containing both scale up and scale down operations are\nsplit into 2 different scale operations automatically.\nScale up operations are always performed before scale down operations to\npreserve detail. If performance is important, you should split the scale\noperations up manually!",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "scale\t\tVector\tThe scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation).",
			"name": "scale",
			"type": "Vector",
			"description": "The scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation)."
		},
		{
			"directive": "param",
			"text": "anchor\t\tVector\tThe anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions.",
			"name": "anchor",
			"type": "Vector",
			"description": "The anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions."
		},
		{
			"directive": "returns",
			"text": "boolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.",
			"type": "boolean, string|table",
			"description": "Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions",
	"line_last": 17,
	"name": "scale",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"scale",
		"anchor"
	],
	"text": "--- Scales the defined region by the given scale factor in the given anchors.\n-- Scale factor vectors containing both scale up and scale down operations are\n-- split into 2 different scale operations automatically.\n-- Scale up operations are always performed before scale down operations to\n-- preserve detail. If performance is important, you should split the scale\n-- operations up manually!\n-- @param\tpos1\t\tVector\tPosition 1 of the defined region,\n-- @param\tpos2\t\tVector\tPosition 2 of the defined region.\n-- @param\tscale\t\tVector\tThe scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation).\n-- @param\tanchor\t\tVector\tThe anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions.\n-- @return\tboolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.\nfunction worldeditadditions.scale(pos1, pos2, scale, anchor)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "scale\t\tVector\tThe scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation).",
			"name": "scale",
			"type": "Vector",
			"description": "The scale factor - as a vector - by which to scale (values between -1 and 1 are considered a scale down operation)."
		},
		{
			"directive": "param",
			"text": "anchor\t\tVector\tThe anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions.",
			"name": "anchor",
			"type": "Vector",
			"description": "The anchor to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and negative z directions."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "boolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.",
		"type": "boolean, string|table",
		"description": "Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead."
	},
	"name_full": "worldeditadditions.scale",
	"filename": "worldeditadditions/lib/scale.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/scale.lua#L7-L18"
}

scale_down 🔗

Scales the defined region down by the given scale factor in the given directions. You probably want worldeditadditions.scale, which scales in both directions.

Arguments

NameTypeDefault valueDescription
pos1Vectornil

Position 1 of the defined region,

pos2Vectornil

Position 2 of the defined region.

scaleVectornil

The scale factor - as a vector - by which to scale down.

anchorVectornil

The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.

Returns

boolean, string|table :

Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.

Source
--- Scales the defined region down by the given scale factor in the given directions.
-- You probably want worldeditadditions.scale, which scales in both directions.
-- @param	pos1		Vector	Position 1 of the defined region,
-- @param	pos2		Vector	Position 2 of the defined region.
-- @param	scale		Vector	The scale factor - as a vector - by which to scale down.
-- @param	anchor		Vector	The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.
-- @return	boolean, string|table	Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.
function worldeditadditions.scale_down(pos1, pos2, scale, anchor)
{
	"type": "function",
	"internal": false,
	"description": "Scales the defined region down by the given scale factor in the given directions.\nYou probably want worldeditadditions.scale, which scales in both directions.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "scale\t\tVector\tThe scale factor - as a vector - by which to scale down.",
			"name": "scale",
			"type": "Vector",
			"description": "The scale factor - as a vector - by which to scale down."
		},
		{
			"directive": "param",
			"text": "anchor\t\tVector\tThe direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.",
			"name": "anchor",
			"type": "Vector",
			"description": "The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions."
		},
		{
			"directive": "returns",
			"text": "boolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.",
			"type": "boolean, string|table",
			"description": "Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 19,
	"name": "scale_down",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"scale",
		"anchor"
	],
	"text": "--- Scales the defined region down by the given scale factor in the given directions.\n-- You probably want worldeditadditions.scale, which scales in both directions.\n-- @param\tpos1\t\tVector\tPosition 1 of the defined region,\n-- @param\tpos2\t\tVector\tPosition 2 of the defined region.\n-- @param\tscale\t\tVector\tThe scale factor - as a vector - by which to scale down.\n-- @param\tanchor\t\tVector\tThe direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.\n-- @return\tboolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.\nfunction worldeditadditions.scale_down(pos1, pos2, scale, anchor)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "scale\t\tVector\tThe scale factor - as a vector - by which to scale down.",
			"name": "scale",
			"type": "Vector",
			"description": "The scale factor - as a vector - by which to scale down."
		},
		{
			"directive": "param",
			"text": "anchor\t\tVector\tThe direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.",
			"name": "anchor",
			"type": "Vector",
			"description": "The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "boolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.",
		"type": "boolean, string|table",
		"description": "Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead."
	},
	"name_full": "worldeditadditions.scale_down",
	"filename": "worldeditadditions/lib/scale_down.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/scale_down.lua#L13-L20"
}

scale_up 🔗

Scales the defined region up by the given scale factor in the given directions. You probably want worldeditadditions.scale, which scales in both directions.

Arguments

NameTypeDefault valueDescription
pos1Vectornil

Position 1 of the defined region,

pos2Vectornil

Position 2 of the defined region.

scaleVectornil

The scale factor - as a vector - by which to scale down.

anchorVectornil

The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.

Returns

boolean, string|table :

Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.

Source
--- Scales the defined region up by the given scale factor in the given directions.
-- You probably want worldeditadditions.scale, which scales in both directions.
-- @param	pos1		Vector	Position 1 of the defined region,
-- @param	pos2		Vector	Position 2 of the defined region.
-- @param	scale		Vector	The scale factor - as a vector - by which to scale down.
-- @param	anchor		Vector	The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.
-- @return	boolean, string|table	Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.
function worldeditadditions.scale_up(pos1, pos2, scale, anchor)
{
	"type": "function",
	"internal": false,
	"description": "Scales the defined region up by the given scale factor in the given directions.\nYou probably want worldeditadditions.scale, which scales in both directions.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "scale\t\tVector\tThe scale factor - as a vector - by which to scale down.",
			"name": "scale",
			"type": "Vector",
			"description": "The scale factor - as a vector - by which to scale down."
		},
		{
			"directive": "param",
			"text": "anchor\t\tVector\tThe direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.",
			"name": "anchor",
			"type": "Vector",
			"description": "The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions."
		},
		{
			"directive": "returns",
			"text": "boolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.",
			"type": "boolean, string|table",
			"description": "Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead."
		}
	],
	"line": 13,
	"namespace": "worldeditadditions",
	"line_last": 20,
	"name": "scale_up",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"scale",
		"anchor"
	],
	"text": "--- Scales the defined region up by the given scale factor in the given directions.\n-- You probably want worldeditadditions.scale, which scales in both directions.\n-- @param\tpos1\t\tVector\tPosition 1 of the defined region,\n-- @param\tpos2\t\tVector\tPosition 2 of the defined region.\n-- @param\tscale\t\tVector\tThe scale factor - as a vector - by which to scale down.\n-- @param\tanchor\t\tVector\tThe direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.\n-- @return\tboolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.\nfunction worldeditadditions.scale_up(pos1, pos2, scale, anchor)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "scale\t\tVector\tThe scale factor - as a vector - by which to scale down.",
			"name": "scale",
			"type": "Vector",
			"description": "The scale factor - as a vector - by which to scale down."
		},
		{
			"directive": "param",
			"text": "anchor\t\tVector\tThe direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions.",
			"name": "anchor",
			"type": "Vector",
			"description": "The direction to scale in - as a vector. e.g. { x = -1, y = 1, z = -1 } would mean scale in the negative x, positive y, and nevative z directions."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "boolean, string|table\tWhether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead.",
		"type": "boolean, string|table",
		"description": "Whether the operation was successful or not. If not, then an error messagea as a string is also passed. If it was, then a statistics object is returned instead."
	},
	"name_full": "worldeditadditions.scale_up",
	"filename": "worldeditadditions/lib/scale_up.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/scale_up.lua#L14-L21"
}

set 🔗

Sets the given parameter to the given value. This function would pair well with worldeditadditions.nodeapply.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

Position 1 of the define region to operate on.

pos2Vector3nil

Position 2 of the define region to operate on.

paramstring="param|param2"nil

The name of the parameter to set. Currently possible values:

  • param: Param1, aka the node id.
  • param2: The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.
  • light: Sets the light value of all nodes in the defined region.
valuestring|numbernil

The value to set the given parameter to. If param is set to "param" and value is a string, then value is converted into a number by calling minetest.get_content_id().

Returns

bool,table|string :

true,statistics_table OR false,error_message.

Source
--- Sets the given parameter to the given value.
-- This function would pair well with worldeditadditions.nodeapply.
-- @param	pos1	Vector3		Position 1 of the define region to operate on.
-- @param	pos2	Vector3		Position 2 of the define region to operate on.
-- @param	param	string="param|param2"	The name of the parameter to set. Currently possible values:
-- 
-- - **`param`:** Param1, aka the node id.
-- - **`param2`:** The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.
-- - **`light`:** Sets the light value of all nodes in the defined region.
-- @param	value	string|number	The value to set the given parameter to. If `param` is set to "param" and `value` is a `string`, then `value` is converted into a number by calling `minetest.get_content_id()`.
-- @returns	bool,table|string	true,statistics_table OR false,error_message.
function worldeditadditions.set(pos1, pos2, mode, value)
{
	"type": "function",
	"internal": false,
	"description": "Sets the given parameter to the given value.\nThis function would pair well with worldeditadditions.nodeapply.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 of the define region to operate on.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 of the define region to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 of the define region to operate on.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 of the define region to operate on."
		},
		{
			"directive": "param",
			"text": "param\tstring=\"param|param2\"\tThe name of the parameter to set. Currently possible values:\n\n- **`param`:** Param1, aka the node id.\n- **`param2`:** The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.\n- **`light`:** Sets the light value of all nodes in the defined region.",
			"name": "param",
			"type": "string=\"param|param2\"",
			"description": "The name of the parameter to set. Currently possible values:\n\n- **`param`:** Param1, aka the node id.\n- **`param2`:** The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.\n- **`light`:** Sets the light value of all nodes in the defined region."
		},
		{
			"directive": "param",
			"text": "value\tstring|number\tThe value to set the given parameter to. If `param` is set to \"param\" and `value` is a `string`, then `value` is converted into a number by calling `minetest.get_content_id()`.",
			"name": "value",
			"type": "string|number",
			"description": "The value to set the given parameter to. If `param` is set to \"param\" and `value` is a `string`, then `value` is converted into a number by calling `minetest.get_content_id()`."
		},
		{
			"directive": "returns",
			"text": "bool,table|string\ttrue,statistics_table OR false,error_message.",
			"type": "bool,table|string",
			"description": "true,statistics_table OR false,error_message."
		}
	],
	"line": 14,
	"namespace": "worldeditadditions",
	"line_last": 25,
	"name": "set",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"mode",
		"value"
	],
	"text": "--- Sets the given parameter to the given value.\n-- This function would pair well with worldeditadditions.nodeapply.\n-- @param\tpos1\tVector3\t\tPosition 1 of the define region to operate on.\n-- @param\tpos2\tVector3\t\tPosition 2 of the define region to operate on.\n-- @param\tparam\tstring=\"param|param2\"\tThe name of the parameter to set. Currently possible values:\n-- \n-- - **`param`:** Param1, aka the node id.\n-- - **`param2`:** The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.\n-- - **`light`:** Sets the light value of all nodes in the defined region.\n-- @param\tvalue\tstring|number\tThe value to set the given parameter to. If `param` is set to \"param\" and `value` is a `string`, then `value` is converted into a number by calling `minetest.get_content_id()`.\n-- @returns\tbool,table|string\ttrue,statistics_table OR false,error_message.\nfunction worldeditadditions.set(pos1, pos2, mode, value)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 of the define region to operate on.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 of the define region to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 of the define region to operate on.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 of the define region to operate on."
		},
		{
			"directive": "param",
			"text": "param\tstring=\"param|param2\"\tThe name of the parameter to set. Currently possible values:\n\n- **`param`:** Param1, aka the node id.\n- **`param2`:** The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.\n- **`light`:** Sets the light value of all nodes in the defined region.",
			"name": "param",
			"type": "string=\"param|param2\"",
			"description": "The name of the parameter to set. Currently possible values:\n\n- **`param`:** Param1, aka the node id.\n- **`param2`:** The supplementary parameter that each node has. See also <https://api.minetest.net/nodes/#node-paramtypes>. The node type is set by the mod or game that provides each node in question.\n- **`light`:** Sets the light value of all nodes in the defined region."
		},
		{
			"directive": "param",
			"text": "value\tstring|number\tThe value to set the given parameter to. If `param` is set to \"param\" and `value` is a `string`, then `value` is converted into a number by calling `minetest.get_content_id()`.",
			"name": "value",
			"type": "string|number",
			"description": "The value to set the given parameter to. If `param` is set to \"param\" and `value` is a `string`, then `value` is converted into a number by calling `minetest.get_content_id()`."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,table|string\ttrue,statistics_table OR false,error_message.",
		"type": "bool,table|string",
		"description": "true,statistics_table OR false,error_message."
	},
	"name_full": "worldeditadditions.set",
	"filename": "worldeditadditions/lib/set.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/set.lua#L15-L26"
}

spiral_circle 🔗

Creates a circular spiral that fills the defined region.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position of the defined region.

pos2Vector3nil

The 2nd position of the defined region.

target_nodeVector3nil

The normalised name of the node to use to build the square spiral with.

interval_initialnumbernil

The distance between the walls of the spiral.

accelerationnumber0

Increate the interval by this number every time we hit a corner of the square spiral.

Returns

bool,number|string :

A success boolean value, followed by either the number of the nodes set or an error message string.

Source
--- Creates a circular spiral that fills the defined region.
-- @param	pos1				Vector3		The 1st position of the defined region.
-- @param	pos2				Vector3		The 2nd position of the defined region.
-- @param	target_node			Vector3		The *normalised* name of the node to use to build the square spiral with.
-- @param	interval_initial	number		The distance between the walls of the spiral.
-- @param	acceleration=0		number		Increate the interval by this number every time we hit a corner of the square spiral.
-- @returns	bool,number|string	A success boolean value, followed by either the number of the nodes set or an error message string.
function worldeditadditions.spiral_circle(pos1, pos2, target_node, interval_initial, acceleration)
{
	"type": "function",
	"internal": false,
	"description": "Creates a circular spiral that fills the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\t\t\tVector3\t\tThe 1st position of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\t\tVector3\t\tThe 2nd position of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd position of the defined region."
		},
		{
			"directive": "param",
			"text": "target_node\t\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.",
			"name": "target_node",
			"type": "Vector3",
			"description": "The *normalised* name of the node to use to build the square spiral with."
		},
		{
			"directive": "param",
			"text": "interval_initial\tnumber\t\tThe distance between the walls of the spiral.",
			"name": "interval_initial",
			"type": "number",
			"description": "The distance between the walls of the spiral."
		},
		{
			"directive": "param",
			"text": "acceleration=0\t\tnumber\t\tIncreate the interval by this number every time we hit a corner of the square spiral.",
			"name": "acceleration",
			"type": "number",
			"description": "Increate the interval by this number every time we hit a corner of the square spiral.",
			"default_value": "0"
		},
		{
			"directive": "returns",
			"text": "bool,number|string\tA success boolean value, followed by either the number of the nodes set or an error message string.",
			"type": "bool,number|string",
			"description": "A success boolean value, followed by either the number of the nodes set or an error message string."
		}
	],
	"line": 19,
	"namespace": "worldeditadditions",
	"line_last": 26,
	"name": "spiral_circle",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"target_node",
		"interval_initial",
		"acceleration"
	],
	"text": "--- Creates a circular spiral that fills the defined region.\n-- @param\tpos1\t\t\t\tVector3\t\tThe 1st position of the defined region.\n-- @param\tpos2\t\t\t\tVector3\t\tThe 2nd position of the defined region.\n-- @param\ttarget_node\t\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.\n-- @param\tinterval_initial\tnumber\t\tThe distance between the walls of the spiral.\n-- @param\tacceleration=0\t\tnumber\t\tIncreate the interval by this number every time we hit a corner of the square spiral.\n-- @returns\tbool,number|string\tA success boolean value, followed by either the number of the nodes set or an error message string.\nfunction worldeditadditions.spiral_circle(pos1, pos2, target_node, interval_initial, acceleration)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\t\tVector3\t\tThe 1st position of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\t\tVector3\t\tThe 2nd position of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd position of the defined region."
		},
		{
			"directive": "param",
			"text": "target_node\t\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.",
			"name": "target_node",
			"type": "Vector3",
			"description": "The *normalised* name of the node to use to build the square spiral with."
		},
		{
			"directive": "param",
			"text": "interval_initial\tnumber\t\tThe distance between the walls of the spiral.",
			"name": "interval_initial",
			"type": "number",
			"description": "The distance between the walls of the spiral."
		},
		{
			"directive": "param",
			"text": "acceleration=0\t\tnumber\t\tIncreate the interval by this number every time we hit a corner of the square spiral.",
			"name": "acceleration",
			"type": "number",
			"description": "Increate the interval by this number every time we hit a corner of the square spiral.",
			"default_value": "0"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,number|string\tA success boolean value, followed by either the number of the nodes set or an error message string.",
		"type": "bool,number|string",
		"description": "A success boolean value, followed by either the number of the nodes set or an error message string."
	},
	"name_full": "worldeditadditions.spiral_circle",
	"filename": "worldeditadditions/lib/spiral_circle.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/spiral_circle.lua#L20-L27"
}

spiral_square 🔗

Creates a square spiral that fills the defined region.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position of the defined region.

pos2Vector3nil

The 2nd position of the defined region.

target_nodeVector3nil

The normalised name of the node to use to build the square spiral with.

intervalnumbernil

The distance between the walls of the spiral.

accelerationnumber0

Increate the interval by this number every time we hit a corner of the square spiral.

Returns

bool,number|string :

A success boolean value, followed by either the number of the nodes set or an error message string.

Source
--- Creates a square spiral that fills the defined region.
-- @param	pos1			Vector3		The 1st position of the defined region.
-- @param	pos2			Vector3		The 2nd position of the defined region.
-- @param	target_node		Vector3		The *normalised* name of the node to use to build the square spiral with.
-- @param	interval		number		The distance between the walls of the spiral.
-- @param	acceleration=0	number		Increate the interval by this number every time we hit a corner of the square spiral.
-- @returns	bool,number|string			A success boolean value, followed by either the number of the nodes set or an error message string.
function worldeditadditions.spiral_square(pos1, pos2, target_node, interval, acceleration)
{
	"type": "function",
	"internal": false,
	"description": "Creates a square spiral that fills the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tThe 1st position of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tThe 2nd position of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd position of the defined region."
		},
		{
			"directive": "param",
			"text": "target_node\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.",
			"name": "target_node",
			"type": "Vector3",
			"description": "The *normalised* name of the node to use to build the square spiral with."
		},
		{
			"directive": "param",
			"text": "interval\t\tnumber\t\tThe distance between the walls of the spiral.",
			"name": "interval",
			"type": "number",
			"description": "The distance between the walls of the spiral."
		},
		{
			"directive": "param",
			"text": "acceleration=0\tnumber\t\tIncreate the interval by this number every time we hit a corner of the square spiral.",
			"name": "acceleration",
			"type": "number",
			"description": "Increate the interval by this number every time we hit a corner of the square spiral.",
			"default_value": "0"
		},
		{
			"directive": "returns",
			"text": "bool,number|string\t\t\tA success boolean value, followed by either the number of the nodes set or an error message string.",
			"type": "bool,number|string",
			"description": "A success boolean value, followed by either the number of the nodes set or an error message string."
		}
	],
	"line": 19,
	"namespace": "worldeditadditions",
	"line_last": 26,
	"name": "spiral_square",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"target_node",
		"interval",
		"acceleration"
	],
	"text": "--- Creates a square spiral that fills the defined region.\n-- @param\tpos1\t\t\tVector3\t\tThe 1st position of the defined region.\n-- @param\tpos2\t\t\tVector3\t\tThe 2nd position of the defined region.\n-- @param\ttarget_node\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.\n-- @param\tinterval\t\tnumber\t\tThe distance between the walls of the spiral.\n-- @param\tacceleration=0\tnumber\t\tIncreate the interval by this number every time we hit a corner of the square spiral.\n-- @returns\tbool,number|string\t\t\tA success boolean value, followed by either the number of the nodes set or an error message string.\nfunction worldeditadditions.spiral_square(pos1, pos2, target_node, interval, acceleration)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tThe 1st position of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tThe 2nd position of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd position of the defined region."
		},
		{
			"directive": "param",
			"text": "target_node\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.",
			"name": "target_node",
			"type": "Vector3",
			"description": "The *normalised* name of the node to use to build the square spiral with."
		},
		{
			"directive": "param",
			"text": "interval\t\tnumber\t\tThe distance between the walls of the spiral.",
			"name": "interval",
			"type": "number",
			"description": "The distance between the walls of the spiral."
		},
		{
			"directive": "param",
			"text": "acceleration=0\tnumber\t\tIncreate the interval by this number every time we hit a corner of the square spiral.",
			"name": "acceleration",
			"type": "number",
			"description": "Increate the interval by this number every time we hit a corner of the square spiral.",
			"default_value": "0"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,number|string\t\t\tA success boolean value, followed by either the number of the nodes set or an error message string.",
		"type": "bool,number|string",
		"description": "A success boolean value, followed by either the number of the nodes set or an error message string."
	},
	"name_full": "worldeditadditions.spiral_square",
	"filename": "worldeditadditions/lib/spiral_square.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/spiral_square.lua#L20-L27"
}

spline 🔗

Creates a spline that follows the given list of points.

Arguments

NameTypeDefault valueDescription
pos_listVector3[]nil

The list of points that define the path the spline should follow. Minimum: 2

width_startnumbernil

The width of the spline at the start.

width_endnumbernil

The width of the spline at the end. If nil, then width_start is used.

stepsnumbernil

The number of smoothing passes to apply to the list of points.

target_nodeVector3nil

The normalised name of the node to use to build the square spiral with.

Returns

bool,number|string :

A success boolean value, followed by either the number of the nodes set or an error message string.

Source
--- Creates a spline that follows the given list of points.
-- @param	pos_list		Vector3[]	The list of points that define the path the spline should follow. Minimum: 2
-- @param	width_start		number	The width of the spline at the start.
-- @param	width_end		number	The width of the spline at the end. If nil, then width_start is used.
-- @param	steps			number		The number of smoothing passes to apply to the list of points.
-- @param	target_node		Vector3		The *normalised* name of the node to use to build the square spiral with.
-- @returns	bool,number|string			A success boolean value, followed by either the number of the nodes set or an error message string.
function worldeditadditions.spline(pos_list, width_start, width_end, steps, target_node)
{
	"type": "function",
	"internal": false,
	"description": "Creates a spline that follows the given list of points.",
	"directives": [
		{
			"directive": "param",
			"text": "pos_list\t\tVector3[]\tThe list of points that define the path the spline should follow. Minimum: 2",
			"name": "pos_list",
			"type": "Vector3[]",
			"description": "The list of points that define the path the spline should follow. Minimum: 2"
		},
		{
			"directive": "param",
			"text": "width_start\t\tnumber\tThe width of the spline at the start.",
			"name": "width_start",
			"type": "number",
			"description": "The width of the spline at the start."
		},
		{
			"directive": "param",
			"text": "width_end\t\tnumber\tThe width of the spline at the end. If nil, then width_start is used.",
			"name": "width_end",
			"type": "number",
			"description": "The width of the spline at the end. If nil, then width_start is used."
		},
		{
			"directive": "param",
			"text": "steps\t\t\tnumber\t\tThe number of smoothing passes to apply to the list of points.",
			"name": "steps",
			"type": "number",
			"description": "The number of smoothing passes to apply to the list of points."
		},
		{
			"directive": "param",
			"text": "target_node\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.",
			"name": "target_node",
			"type": "Vector3",
			"description": "The *normalised* name of the node to use to build the square spiral with."
		},
		{
			"directive": "returns",
			"text": "bool,number|string\t\t\tA success boolean value, followed by either the number of the nodes set or an error message string.",
			"type": "bool,number|string",
			"description": "A success boolean value, followed by either the number of the nodes set or an error message string."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 19,
	"name": "spline",
	"instanced": false,
	"args": [
		"pos_list",
		"width_start",
		"width_end",
		"steps",
		"target_node"
	],
	"text": "--- Creates a spline that follows the given list of points.\n-- @param\tpos_list\t\tVector3[]\tThe list of points that define the path the spline should follow. Minimum: 2\n-- @param\twidth_start\t\tnumber\tThe width of the spline at the start.\n-- @param\twidth_end\t\tnumber\tThe width of the spline at the end. If nil, then width_start is used.\n-- @param\tsteps\t\t\tnumber\t\tThe number of smoothing passes to apply to the list of points.\n-- @param\ttarget_node\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.\n-- @returns\tbool,number|string\t\t\tA success boolean value, followed by either the number of the nodes set or an error message string.\nfunction worldeditadditions.spline(pos_list, width_start, width_end, steps, target_node)",
	"params": [
		{
			"directive": "param",
			"text": "pos_list\t\tVector3[]\tThe list of points that define the path the spline should follow. Minimum: 2",
			"name": "pos_list",
			"type": "Vector3[]",
			"description": "The list of points that define the path the spline should follow. Minimum: 2"
		},
		{
			"directive": "param",
			"text": "width_start\t\tnumber\tThe width of the spline at the start.",
			"name": "width_start",
			"type": "number",
			"description": "The width of the spline at the start."
		},
		{
			"directive": "param",
			"text": "width_end\t\tnumber\tThe width of the spline at the end. If nil, then width_start is used.",
			"name": "width_end",
			"type": "number",
			"description": "The width of the spline at the end. If nil, then width_start is used."
		},
		{
			"directive": "param",
			"text": "steps\t\t\tnumber\t\tThe number of smoothing passes to apply to the list of points.",
			"name": "steps",
			"type": "number",
			"description": "The number of smoothing passes to apply to the list of points."
		},
		{
			"directive": "param",
			"text": "target_node\t\tVector3\t\tThe *normalised* name of the node to use to build the square spiral with.",
			"name": "target_node",
			"type": "Vector3",
			"description": "The *normalised* name of the node to use to build the square spiral with."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,number|string\t\t\tA success boolean value, followed by either the number of the nodes set or an error message string.",
		"type": "bool,number|string",
		"description": "A success boolean value, followed by either the number of the nodes set or an error message string."
	},
	"name_full": "worldeditadditions.spline",
	"filename": "worldeditadditions/lib/spline.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/spline.lua#L13-L20"
}

subdivide 🔗

Calls the given callback function once for each block in the defined area. This function is asynchronous, as it also uses minetest.emerge_area() to ensure that the blocks are loaded before calling the callback function. The callback functions will be passed the following arguments: pos1, pos2, stats pos1 and pos2 refer to the defined region of just the local block. stats is an table of statistics resembling the following: { chunks_completed, chunks_total, emerge = { ... }, times = { emerge = {}, emerge_last, callback = {}, callback_last, steps = {}, step_last } } The emerge property contains a table that holds a running total of statistics about what Minetest did to emerge the requested blocks in the world. callback_complete is called at the end of the process, and pos1 + pos2 will be set to that of the entire region.

Arguments

NameTypeDefault valueDescription
pos1Vectornil

The first position defining the area to emerge.

pos2Vectornil

The second position defining the area to emerge.

chunk_sizeVectornil

The size of the chunks to subdivide into.

callbackfunctionnil

The callback to call for each block.

callbackfunctionnil

The callback to call upon completion.

Returns

nil

Source
--- Calls the given callback function once for each block in the defined area.
-- This function is asynchronous, as it also uses minetest.emerge_area() to
-- ensure that the blocks are loaded before calling the callback function.
-- The callback functions will be passed the following arguments: pos1, pos2, stats
-- pos1 and pos2 refer to the defined region of just the local block.
-- stats is an table of statistics resembling the following:
-- { chunks_completed, chunks_total, emerge = { ... }, times = { emerge = {}, emerge_last, callback = {}, callback_last, steps = {}, step_last } }
-- The emerge property contains a table that holds a running total of statistics
-- about what Minetest did to emerge the requested blocks in the world.
-- callback_complete is called at the end of the process, and pos1 + pos2 will be set to that of the entire region.
-- @param	pos1		Vector		The first position defining the area to emerge.
-- @param	pos2		Vector		The second position defining the area to emerge.
-- @param	chunk_size	Vector		The size of the chunks to subdivide into.
-- @param	callback	function	The callback to call for each block.
-- @param	callback	function	The callback to call upon completion.
function worldeditadditions.subdivide(pos1, pos2, chunk_size, callback_subblock, callback_complete)
{
	"type": "function",
	"internal": false,
	"description": "Calls the given callback function once for each block in the defined area.\nThis function is asynchronous, as it also uses minetest.emerge_area() to\nensure that the blocks are loaded before calling the callback function.\nThe callback functions will be passed the following arguments: pos1, pos2, stats\npos1 and pos2 refer to the defined region of just the local block.\nstats is an table of statistics resembling the following:\n{ chunks_completed, chunks_total, emerge = { ... }, times = { emerge = {}, emerge_last, callback = {}, callback_last, steps = {}, step_last } }\nThe emerge property contains a table that holds a running total of statistics\nabout what Minetest did to emerge the requested blocks in the world.\ncallback_complete is called at the end of the process, and pos1 + pos2 will be set to that of the entire region.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\t\tThe first position defining the area to emerge.",
			"name": "pos1",
			"type": "Vector",
			"description": "The first position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\t\tThe second position defining the area to emerge.",
			"name": "pos2",
			"type": "Vector",
			"description": "The second position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "chunk_size\tVector\t\tThe size of the chunks to subdivide into.",
			"name": "chunk_size",
			"type": "Vector",
			"description": "The size of the chunks to subdivide into."
		},
		{
			"directive": "param",
			"text": "callback\tfunction\tThe callback to call for each block.",
			"name": "callback",
			"type": "function",
			"description": "The callback to call for each block."
		},
		{
			"directive": "param",
			"text": "callback\tfunction\tThe callback to call upon completion.",
			"name": "callback",
			"type": "function",
			"description": "The callback to call upon completion."
		}
	],
	"line": 137,
	"namespace": "worldeditadditions",
	"line_last": 152,
	"name": "subdivide",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"chunk_size",
		"callback_subblock",
		"callback_complete"
	],
	"text": "--- Calls the given callback function once for each block in the defined area.\n-- This function is asynchronous, as it also uses minetest.emerge_area() to\n-- ensure that the blocks are loaded before calling the callback function.\n-- The callback functions will be passed the following arguments: pos1, pos2, stats\n-- pos1 and pos2 refer to the defined region of just the local block.\n-- stats is an table of statistics resembling the following:\n-- { chunks_completed, chunks_total, emerge = { ... }, times = { emerge = {}, emerge_last, callback = {}, callback_last, steps = {}, step_last } }\n-- The emerge property contains a table that holds a running total of statistics\n-- about what Minetest did to emerge the requested blocks in the world.\n-- callback_complete is called at the end of the process, and pos1 + pos2 will be set to that of the entire region.\n-- @param\tpos1\t\tVector\t\tThe first position defining the area to emerge.\n-- @param\tpos2\t\tVector\t\tThe second position defining the area to emerge.\n-- @param\tchunk_size\tVector\t\tThe size of the chunks to subdivide into.\n-- @param\tcallback\tfunction\tThe callback to call for each block.\n-- @param\tcallback\tfunction\tThe callback to call upon completion.\nfunction worldeditadditions.subdivide(pos1, pos2, chunk_size, callback_subblock, callback_complete)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\t\tThe first position defining the area to emerge.",
			"name": "pos1",
			"type": "Vector",
			"description": "The first position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\t\tThe second position defining the area to emerge.",
			"name": "pos2",
			"type": "Vector",
			"description": "The second position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "chunk_size\tVector\t\tThe size of the chunks to subdivide into.",
			"name": "chunk_size",
			"type": "Vector",
			"description": "The size of the chunks to subdivide into."
		},
		{
			"directive": "param",
			"text": "callback\tfunction\tThe callback to call for each block.",
			"name": "callback",
			"type": "function",
			"description": "The callback to call for each block."
		},
		{
			"directive": "param",
			"text": "callback\tfunction\tThe callback to call upon completion.",
			"name": "callback",
			"type": "function",
			"description": "The callback to call upon completion."
		}
	],
	"name_full": "worldeditadditions.subdivide",
	"filename": "worldeditadditions/lib/subdivide.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/subdivide.lua#L138-L153"
}

torus 🔗

Generates a torus shape at the given position with the given parameters.

Arguments

NameTypeDefault valueDescription
positionVectornil

The position at which to generate the torus.

major_radiusnumbernil

The major radius of the torus - i.e. the distance from the middle to the ring.

minor_radiusnumbernil

The minor radius of the torus - i.e. the radius fo the ring itself.

target_nodestringnil

The name of the target node to generate the torus with.

axesstring|nilxz

The axes upon which the torus should lay flat.

hollowbooleanfalse

Whether the generated torus should be hollow or not.

Returns

number :

The number of nodes replaced.

Source
--- Generates a torus shape at the given position with the given parameters.
-- @param	position		Vector		The position at which to generate the torus.
-- @param	major_radius	number		The major radius of the torus - i.e. the distance from the middle to the ring.
-- @param	minor_radius	number		The minor radius of the torus - i.e. the radius fo the ring itself.
-- @param	target_node		string		The name of the target node to generate the torus with.
-- @param	axes=xz			string|nil	The axes upon which the torus should lay flat.
-- @param	hollow=false	boolean		Whether the generated torus should be hollow or not.
-- @returns	number			The number of nodes replaced.
function worldeditadditions.torus(position, major_radius, minor_radius, target_node, axes, hollow)
{
	"type": "function",
	"internal": false,
	"description": "Generates a torus shape at the given position with the given parameters.",
	"directives": [
		{
			"directive": "param",
			"text": "position\t\tVector\t\tThe position at which to generate the torus.",
			"name": "position",
			"type": "Vector",
			"description": "The position at which to generate the torus."
		},
		{
			"directive": "param",
			"text": "major_radius\tnumber\t\tThe major radius of the torus - i.e. the distance from the middle to the ring.",
			"name": "major_radius",
			"type": "number",
			"description": "The major radius of the torus - i.e. the distance from the middle to the ring."
		},
		{
			"directive": "param",
			"text": "minor_radius\tnumber\t\tThe minor radius of the torus - i.e. the radius fo the ring itself.",
			"name": "minor_radius",
			"type": "number",
			"description": "The minor radius of the torus - i.e. the radius fo the ring itself."
		},
		{
			"directive": "param",
			"text": "target_node\t\tstring\t\tThe name of the target node to generate the torus with.",
			"name": "target_node",
			"type": "string",
			"description": "The name of the target node to generate the torus with."
		},
		{
			"directive": "param",
			"text": "axes=xz\t\t\tstring|nil\tThe axes upon which the torus should lay flat.",
			"name": "axes",
			"type": "string|nil",
			"description": "The axes upon which the torus should lay flat.",
			"default_value": "xz"
		},
		{
			"directive": "param",
			"text": "hollow=false\tboolean\t\tWhether the generated torus should be hollow or not.",
			"name": "hollow",
			"type": "boolean",
			"description": "Whether the generated torus should be hollow or not.",
			"default_value": "false"
		},
		{
			"directive": "returns",
			"text": "number\t\t\tThe number of nodes replaced.",
			"type": "number",
			"description": "The number of nodes replaced."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions",
	"line_last": 14,
	"name": "torus",
	"instanced": false,
	"args": [
		"position",
		"major_radius",
		"minor_radius",
		"target_node",
		"axes",
		"hollow"
	],
	"text": "--- Generates a torus shape at the given position with the given parameters.\n-- @param\tposition\t\tVector\t\tThe position at which to generate the torus.\n-- @param\tmajor_radius\tnumber\t\tThe major radius of the torus - i.e. the distance from the middle to the ring.\n-- @param\tminor_radius\tnumber\t\tThe minor radius of the torus - i.e. the radius fo the ring itself.\n-- @param\ttarget_node\t\tstring\t\tThe name of the target node to generate the torus with.\n-- @param\taxes=xz\t\t\tstring|nil\tThe axes upon which the torus should lay flat.\n-- @param\thollow=false\tboolean\t\tWhether the generated torus should be hollow or not.\n-- @returns\tnumber\t\t\tThe number of nodes replaced.\nfunction worldeditadditions.torus(position, major_radius, minor_radius, target_node, axes, hollow)",
	"params": [
		{
			"directive": "param",
			"text": "position\t\tVector\t\tThe position at which to generate the torus.",
			"name": "position",
			"type": "Vector",
			"description": "The position at which to generate the torus."
		},
		{
			"directive": "param",
			"text": "major_radius\tnumber\t\tThe major radius of the torus - i.e. the distance from the middle to the ring.",
			"name": "major_radius",
			"type": "number",
			"description": "The major radius of the torus - i.e. the distance from the middle to the ring."
		},
		{
			"directive": "param",
			"text": "minor_radius\tnumber\t\tThe minor radius of the torus - i.e. the radius fo the ring itself.",
			"name": "minor_radius",
			"type": "number",
			"description": "The minor radius of the torus - i.e. the radius fo the ring itself."
		},
		{
			"directive": "param",
			"text": "target_node\t\tstring\t\tThe name of the target node to generate the torus with.",
			"name": "target_node",
			"type": "string",
			"description": "The name of the target node to generate the torus with."
		},
		{
			"directive": "param",
			"text": "axes=xz\t\t\tstring|nil\tThe axes upon which the torus should lay flat.",
			"name": "axes",
			"type": "string|nil",
			"description": "The axes upon which the torus should lay flat.",
			"default_value": "xz"
		},
		{
			"directive": "param",
			"text": "hollow=false\tboolean\t\tWhether the generated torus should be hollow or not.",
			"name": "hollow",
			"type": "boolean",
			"description": "Whether the generated torus should be hollow or not.",
			"default_value": "false"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\t\tThe number of nodes replaced.",
		"type": "number",
		"description": "The number of nodes replaced."
	},
	"name_full": "worldeditadditions.torus",
	"filename": "worldeditadditions/lib/torus.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/torus.lua#L7-L15"
}

walls 🔗

Creates vertical walls on the inside of the defined region.

Arguments

NameTypeDefault valueDescription
pos1Vectornil

Position 1 of the defined region,

pos2Vectornil

Position 2 of the defined region.

node_namestringnil

The name of the node to use to create the walls with.

thicknessnumber?nil

The thickness of the walls to create. Default: 1

Returns

nil

Source
--- Creates vertical walls on the inside of the defined region.
-- @apipath worldeditadditions.walls
-- @param	pos1		Vector	Position 1 of the defined region,
-- @param	pos2		Vector	Position 2 of the defined region.
-- @param	node_name	string	The name of the node to use to create the walls with.
-- @param	thickness	number?	The thickness of the walls to create. Default: 1
function worldeditadditions.walls(pos1, pos2, node_name, thickness)
{
	"type": "function",
	"internal": false,
	"description": "Creates vertical walls on the inside of the defined region.",
	"directives": [
		{
			"directive": "apipath",
			"text": "worldeditadditions.walls"
		},
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "node_name\tstring\tThe name of the node to use to create the walls with.",
			"name": "node_name",
			"type": "string",
			"description": "The name of the node to use to create the walls with."
		},
		{
			"directive": "param",
			"text": "thickness\tnumber?\tThe thickness of the walls to create. Default: 1",
			"name": "thickness",
			"type": "number?",
			"description": "The thickness of the walls to create. Default: 1"
		}
	],
	"line": 12,
	"namespace": "worldeditadditions",
	"line_last": 18,
	"name": "walls",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"node_name",
		"thickness"
	],
	"text": "--- Creates vertical walls on the inside of the defined region.\n-- @apipath worldeditadditions.walls\n-- @param\tpos1\t\tVector\tPosition 1 of the defined region,\n-- @param\tpos2\t\tVector\tPosition 2 of the defined region.\n-- @param\tnode_name\tstring\tThe name of the node to use to create the walls with.\n-- @param\tthickness\tnumber?\tThe thickness of the walls to create. Default: 1\nfunction worldeditadditions.walls(pos1, pos2, node_name, thickness)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector\tPosition 1 of the defined region,",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the defined region,"
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector\tPosition 2 of the defined region.",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the defined region."
		},
		{
			"directive": "param",
			"text": "node_name\tstring\tThe name of the node to use to create the walls with.",
			"name": "node_name",
			"type": "string",
			"description": "The name of the node to use to create the walls with."
		},
		{
			"directive": "param",
			"text": "thickness\tnumber?\tThe thickness of the walls to create. Default: 1",
			"name": "thickness",
			"type": "number?",
			"description": "The thickness of the walls to create. Default: 1"
		}
	],
	"name_full": "worldeditadditions.walls",
	"filename": "worldeditadditions/lib/walls.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/walls.lua#L13-L19"
}

wire_box 🔗

Fills the edges of the selection box with nodes.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The 1st position defining the WorldEdit selection

pos2Vector3nil

The 2nd positioon defining the WorldEdit selection

nodestringnil

Name of the node to place

Returns

nil

Source
--- Fills the edges of the selection box with nodes.
-- @param	pos1	Vector3	The 1st position defining the WorldEdit selection
-- @param	pos2	Vector3	The 2nd positioon defining the WorldEdit selection
-- @param	node	string	Name of the node to place
function worldeditadditions.wire_box(pos1,pos2,node)
{
	"type": "function",
	"internal": false,
	"description": "Fills the edges of the selection box with nodes.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\tThe 1st position defining the WorldEdit selection",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\tThe 2nd positioon defining the WorldEdit selection",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "node\tstring\tName of the node to place",
			"name": "node",
			"type": "string",
			"description": "Name of the node to place"
		}
	],
	"line": 11,
	"namespace": "worldeditadditions",
	"line_last": 15,
	"name": "wire_box",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"node"
	],
	"text": "--- Fills the edges of the selection box with nodes.\n-- @param\tpos1\tVector3\tThe 1st position defining the WorldEdit selection\n-- @param\tpos2\tVector3\tThe 2nd positioon defining the WorldEdit selection\n-- @param\tnode\tstring\tName of the node to place\nfunction worldeditadditions.wire_box(pos1,pos2,node)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\tThe 1st position defining the WorldEdit selection",
			"name": "pos1",
			"type": "Vector3",
			"description": "The 1st position defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\tThe 2nd positioon defining the WorldEdit selection",
			"name": "pos2",
			"type": "Vector3",
			"description": "The 2nd positioon defining the WorldEdit selection"
		},
		{
			"directive": "param",
			"text": "node\tstring\tName of the node to place",
			"name": "node",
			"type": "string",
			"description": "Name of the node to place"
		}
	],
	"name_full": "worldeditadditions.wire_box",
	"filename": "worldeditadditions/lib/wireframe/wire_box.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions/lib/wireframe/wire_box.lua#L12-L16"
}

worldeditadditions_commands 🔗

WorldEditAdditions-ChatCommands


worldeditadditions_core 🔗

WorldEditAdditions chat command registration


entities 🔗

Entities and functions to manage them.


pos_marker_wall 🔗

Functions

check_entity 🔗

Checks the given entity for whether it's in the current generation of wall markers or not. Only entities of type worldeditadditions:marker_wall will be removed.

Arguments

NameTypeDefault valueDescription
entityObjectRefnil

The entity to check.

Returns

nil

Source
--- Checks the given entity for whether it's in the current generation of wall markers or not.
-- Only entities of type worldeditadditions:marker_wall will be removed.
-- @param	entity	ObjectRef	The entity to check.
local function check_entity(entity)
{
	"type": "function",
	"internal": false,
	"description": "Checks the given entity for whether it's in the current generation of wall markers or not.\nOnly entities of type worldeditadditions:marker_wall will be removed.",
	"directives": [
		{
			"directive": "param",
			"text": "entity\tObjectRef\tThe entity to check.",
			"name": "entity",
			"type": "ObjectRef",
			"description": "The entity to check."
		}
	],
	"line": 94,
	"namespace": "worldeditadditions_core.entities.pos_marker_wall",
	"line_last": 97,
	"name": "check_entity",
	"instanced": false,
	"args": [
		"entity"
	],
	"text": "--- Checks the given entity for whether it's in the current generation of wall markers or not.\n-- Only entities of type worldeditadditions:marker_wall will be removed.\n-- @param\tentity\tObjectRef\tThe entity to check.\nlocal function check_entity(entity)",
	"params": [
		{
			"directive": "param",
			"text": "entity\tObjectRef\tThe entity to check.",
			"name": "entity",
			"type": "ObjectRef",
			"description": "The entity to check."
		}
	],
	"name_full": "worldeditadditions_core.entities.pos_marker_wall.check_entity",
	"filename": "worldeditadditions_core/core/entities/pos_marker_wall.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/entities/pos_marker_wall.lua#L95-L98"
}

create_single 🔗

Creates a single marker wall entity.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player it should belong to.

pos1Vector3nil

The pos1 corner of the area the SINGLE marker should cover.

pos2Vector3nil

The pos2 corner of the area the SINGLE marker should cover.

sidestringnil

The side that this wall is on. Valid values: x, -x, y, -y, z, -z.

Returns

Entity<WEAPositionMarkerWall>

Source
--- Creates a single marker wall entity.
-- @param	player_name	string	The name of the player it should belong to.
-- @param	pos1		Vector3	The pos1 corner of the area the SINGLE marker should cover.
-- @param	pos2		Vector3	The pos2 corner of the area the SINGLE marker should cover.
-- @param	side		string	The side that this wall is on. Valid values: x, -x, y, -y, z, -z.
-- @returns	Entity<WEAPositionMarkerWall>
local function create_single(player_name, pos1, pos2, side)
{
	"type": "function",
	"internal": false,
	"description": "Creates a single marker wall entity.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\tstring\tThe name of the player it should belong to.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player it should belong to."
		},
		{
			"directive": "param",
			"text": "pos1\t\tVector3\tThe pos1 corner of the area the SINGLE marker should cover.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The pos1 corner of the area the SINGLE marker should cover."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\tThe pos2 corner of the area the SINGLE marker should cover.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The pos2 corner of the area the SINGLE marker should cover."
		},
		{
			"directive": "param",
			"text": "side\t\tstring\tThe side that this wall is on. Valid values: x, -x, y, -y, z, -z.",
			"name": "side",
			"type": "string",
			"description": "The side that this wall is on. Valid values: x, -x, y, -y, z, -z."
		},
		{
			"directive": "returns",
			"text": "Entity<WEAPositionMarkerWall>",
			"type": "Entity<WEAPositionMarkerWall>"
		}
	],
	"line": 157,
	"namespace": "worldeditadditions_core.entities.pos_marker_wall",
	"line_last": 163,
	"name": "create_single",
	"instanced": false,
	"args": [
		"player_name",
		"pos1",
		"pos2",
		"side"
	],
	"text": "--- Creates a single marker wall entity.\n-- @param\tplayer_name\tstring\tThe name of the player it should belong to.\n-- @param\tpos1\t\tVector3\tThe pos1 corner of the area the SINGLE marker should cover.\n-- @param\tpos2\t\tVector3\tThe pos2 corner of the area the SINGLE marker should cover.\n-- @param\tside\t\tstring\tThe side that this wall is on. Valid values: x, -x, y, -y, z, -z.\n-- @returns\tEntity<WEAPositionMarkerWall>\nlocal function create_single(player_name, pos1, pos2, side)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\tstring\tThe name of the player it should belong to.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player it should belong to."
		},
		{
			"directive": "param",
			"text": "pos1\t\tVector3\tThe pos1 corner of the area the SINGLE marker should cover.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The pos1 corner of the area the SINGLE marker should cover."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\tThe pos2 corner of the area the SINGLE marker should cover.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The pos2 corner of the area the SINGLE marker should cover."
		},
		{
			"directive": "param",
			"text": "side\t\tstring\tThe side that this wall is on. Valid values: x, -x, y, -y, z, -z.",
			"name": "side",
			"type": "string",
			"description": "The side that this wall is on. Valid values: x, -x, y, -y, z, -z."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Entity<WEAPositionMarkerWall>",
		"type": "Entity<WEAPositionMarkerWall>"
	},
	"name_full": "worldeditadditions_core.entities.pos_marker_wall.create_single",
	"filename": "worldeditadditions_core/core/entities/pos_marker_wall.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/entities/pos_marker_wall.lua#L158-L164"
}

create_wall 🔗

Creates a marker wall around the defined region.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player that the wall belongs to.

pos1Vector3nil

pos1 of the defined region.

pos2Vector3nil

pos2 of the defined region.

sides_to_displaystringnil

The sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to "+x-x+z-z". Use "+x-x+z-z+y-y" to display all sides; add and remove sides as desired.

Returns

table<entitylist> :

A list of all created entities.

Source
--- Creates a marker wall around the defined region.
-- @param	player_name			string	The name of the player that the wall belongs to.
-- @param	pos1				Vector3	pos1 of the defined region.
-- @param	pos2				Vector3	pos2 of the defined region.
-- @param	sides_to_display	string	The sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to "+x-x+z-z". Use "+x-x+z-z+y-y" to display all sides; add and remove sides as desired.
-- @returns	table<entitylist>	A list of all created entities.
local function create_wall(player_name, pos1, pos2, sides_to_display)
{
	"type": "function",
	"internal": false,
	"description": "Creates a marker wall around the defined region.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\t\tstring\tThe name of the player that the wall belongs to.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player that the wall belongs to."
		},
		{
			"directive": "param",
			"text": "pos1\t\t\t\tVector3\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\t\tVector3\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "param",
			"text": "sides_to_display\tstring\tThe sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to \"+x-x+z-z\". Use \"+x-x+z-z+y-y\" to display all sides; add and remove sides as desired.",
			"name": "sides_to_display",
			"type": "string",
			"description": "The sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to \"+x-x+z-z\". Use \"+x-x+z-z+y-y\" to display all sides; add and remove sides as desired."
		},
		{
			"directive": "returns",
			"text": "table<entitylist>\tA list of all created entities.",
			"type": "table<entitylist>",
			"description": "A list of all created entities."
		}
	],
	"line": 183,
	"namespace": "worldeditadditions_core.entities.pos_marker_wall",
	"line_last": 189,
	"name": "create_wall",
	"instanced": false,
	"args": [
		"player_name",
		"pos1",
		"pos2",
		"sides_to_display"
	],
	"text": "--- Creates a marker wall around the defined region.\n-- @param\tplayer_name\t\t\tstring\tThe name of the player that the wall belongs to.\n-- @param\tpos1\t\t\t\tVector3\tpos1 of the defined region.\n-- @param\tpos2\t\t\t\tVector3\tpos2 of the defined region.\n-- @param\tsides_to_display\tstring\tThe sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to \"+x-x+z-z\". Use \"+x-x+z-z+y-y\" to display all sides; add and remove sides as desired.\n-- @returns\ttable<entitylist>\tA list of all created entities.\nlocal function create_wall(player_name, pos1, pos2, sides_to_display)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\t\tstring\tThe name of the player that the wall belongs to.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player that the wall belongs to."
		},
		{
			"directive": "param",
			"text": "pos1\t\t\t\tVector3\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\t\tVector3\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "param",
			"text": "sides_to_display\tstring\tThe sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to \"+x-x+z-z\". Use \"+x-x+z-z+y-y\" to display all sides; add and remove sides as desired.",
			"name": "sides_to_display",
			"type": "string",
			"description": "The sides of the marker wall that should actually be displayed, squished together into a single string. Defaults to \"+x-x+z-z\". Use \"+x-x+z-z+y-y\" to display all sides; add and remove sides as desired."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table<entitylist>\tA list of all created entities.",
		"type": "table<entitylist>",
		"description": "A list of all created entities."
	},
	"name_full": "worldeditadditions_core.entities.pos_marker_wall.create_wall",
	"filename": "worldeditadditions_core/core/entities/pos_marker_wall.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/entities/pos_marker_wall.lua#L184-L190"
}

delete 🔗

Deletes all entities in the given entity list

Arguments

NameTypeDefault valueDescription
entitylisttable<entity>nil

A list of wall entities that make up the wall to delete.

Returns

nil

Source
--- Deletes all entities in the given entity list
-- @param	entitylist	table<entity>	A list of wall entities that make up the wall to delete.
local function delete(entitylist)
{
	"type": "function",
	"internal": false,
	"description": "Deletes all entities in the given entity list",
	"directives": [
		{
			"directive": "param",
			"text": "entitylist\ttable<entity>\tA list of wall entities that make up the wall to delete.",
			"name": "entitylist",
			"type": "table<entity>",
			"description": "A list of wall entities that make up the wall to delete."
		}
	],
	"line": 486,
	"namespace": "worldeditadditions_core.entities.pos_marker_wall",
	"line_last": 488,
	"name": "delete",
	"instanced": false,
	"args": [
		"entitylist"
	],
	"text": "--- Deletes all entities in the given entity list\n-- @param\tentitylist\ttable<entity>\tA list of wall entities that make up the wall to delete.\nlocal function delete(entitylist)",
	"params": [
		{
			"directive": "param",
			"text": "entitylist\ttable<entity>\tA list of wall entities that make up the wall to delete.",
			"name": "entitylist",
			"type": "table<entity>",
			"description": "A list of wall entities that make up the wall to delete."
		}
	],
	"name_full": "worldeditadditions_core.entities.pos_marker_wall.delete",
	"filename": "worldeditadditions_core/core/entities/pos_marker_wall.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/entities/pos_marker_wall.lua#L487-L489"
}

get_last_reset 🔗

Gets the last_reset value for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the last_reset value for.

updateboolfalse

If true, then update the last_reset value for the given player to a new value.

Returns

nil

Source
--- Gets the last_reset value for the given player.
-- @internal
-- @param	player_name		string	The name of the player to fetch the last_reset value for.
-- @param	update=false	bool	If true, then update the last_reset value for the given player to a new value.
local function get_last_reset(player_name, update)
{
	"type": "function",
	"internal": true,
	"description": "Gets the last_reset value for the given player.",
	"directives": [
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the last_reset value for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the last_reset value for."
		},
		{
			"directive": "param",
			"text": "update=false\tbool\tIf true, then update the last_reset value for the given player to a new value.",
			"name": "update",
			"type": "bool",
			"description": "If true, then update the last_reset value for the given player to a new value.",
			"default_value": "false"
		}
	],
	"line": 17,
	"namespace": "worldeditadditions_core.entities.pos_marker_wall",
	"line_last": 21,
	"name": "get_last_reset",
	"instanced": false,
	"args": [
		"player_name",
		"update"
	],
	"text": "--- Gets the last_reset value for the given player.\n-- @internal\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the last_reset value for.\n-- @param\tupdate=false\tbool\tIf true, then update the last_reset value for the given player to a new value.\nlocal function get_last_reset(player_name, update)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the last_reset value for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the last_reset value for."
		},
		{
			"directive": "param",
			"text": "update=false\tbool\tIf true, then update the last_reset value for the given player to a new value.",
			"name": "update",
			"type": "bool",
			"description": "If true, then update the last_reset value for the given player to a new value.",
			"default_value": "false"
		}
	],
	"name_full": "worldeditadditions_core.entities.pos_marker_wall.get_last_reset",
	"filename": "worldeditadditions_core/core/entities/pos_marker_wall.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/entities/pos_marker_wall.lua#L18-L22"
}

EventEmitter 🔗

Event manager object.

Functions

addEventListener 🔗

Add a new listener to the given named event.

Arguments

NameTypeDefault valueDescription
thisEventEmitternil

The EventEmitter instance to add the listener to.

event_namestringnil

The name of the event to listen on.

funcfunctionnil

The callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit().

Returns

number :

The number of listeners attached to that event.

Source
--- Add a new listener to the given named event.
-- @param	this		EventEmitter	The EventEmitter instance to add the listener to.
-- @param	event_name	string			The name of the event to listen on.
-- @param	func		function		The callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit().
-- @returns	number		The number of listeners attached to that event.
function EventEmitter.addEventListener(this, event_name, func)
{
	"type": "function",
	"internal": false,
	"description": "Add a new listener to the given named event.",
	"directives": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to add the listener to.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to add the listener to."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to listen on.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to listen on."
		},
		{
			"directive": "param",
			"text": "func\t\tfunction\t\tThe callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit().",
			"name": "func",
			"type": "function",
			"description": "The callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit()."
		},
		{
			"directive": "returns",
			"text": "number\t\tThe number of listeners attached to that event.",
			"type": "number",
			"description": "The number of listeners attached to that event."
		}
	],
	"line": 18,
	"namespace": "worldeditadditions_core.EventEmitter",
	"line_last": 23,
	"name": "addEventListener",
	"instanced": false,
	"args": [
		"this",
		"event_name",
		"func"
	],
	"text": "--- Add a new listener to the given named event.\n-- @param\tthis\t\tEventEmitter\tThe EventEmitter instance to add the listener to.\n-- @param\tevent_name\tstring\t\t\tThe name of the event to listen on.\n-- @param\tfunc\t\tfunction\t\tThe callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit().\n-- @returns\tnumber\t\tThe number of listeners attached to that event.\nfunction EventEmitter.addEventListener(this, event_name, func)",
	"params": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to add the listener to.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to add the listener to."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to listen on.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to listen on."
		},
		{
			"directive": "param",
			"text": "func\t\tfunction\t\tThe callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit().",
			"name": "func",
			"type": "function",
			"description": "The callback function to call when the event is emitted. Will be passed a single argument - the object passed as the second argument to .emit()."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\tThe number of listeners attached to that event.",
		"type": "number",
		"description": "The number of listeners attached to that event."
	},
	"name_full": "worldeditadditions_core.EventEmitter.addEventListener",
	"filename": "worldeditadditions_core/utils/EventEmitter.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/EventEmitter.lua#L19-L24"
}

clear 🔗

Clear all listeners from a given event name.

Arguments

NameTypeDefault valueDescription
thisEventEmitternil

The EventEmitter instance to clear listeners from.

event_namestringnil

The name of the event to clear the listeners from.

Returns

nil

Source
--- Clear all listeners from a given event name.
-- @param	this		EventEmitter	The EventEmitter instance to clear listeners from.
-- @param	event_name	string			The name of the event to clear the listeners from.
function EventEmitter.clear(this, event_name)
{
	"type": "function",
	"internal": false,
	"description": "Clear all listeners from a given event name.",
	"directives": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to clear listeners from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to clear listeners from."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to clear the listeners from.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to clear the listeners from."
		}
	],
	"line": 73,
	"namespace": "worldeditadditions_core.EventEmitter",
	"line_last": 76,
	"name": "clear",
	"instanced": false,
	"args": [
		"this",
		"event_name"
	],
	"text": "--- Clear all listeners from a given event name.\n-- @param\tthis\t\tEventEmitter\tThe EventEmitter instance to clear listeners from.\n-- @param\tevent_name\tstring\t\t\tThe name of the event to clear the listeners from.\nfunction EventEmitter.clear(this, event_name)",
	"params": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to clear listeners from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to clear listeners from."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to clear the listeners from.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to clear the listeners from."
		}
	],
	"name_full": "worldeditadditions_core.EventEmitter.clear",
	"filename": "worldeditadditions_core/utils/EventEmitter.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/EventEmitter.lua#L74-L77"
}

clear_all 🔗

Clear all listeners.

Arguments

NameTypeDefault valueDescription
thisEventEmitternil

The EventEmitter instance to clear listeners from.

Returns

nil

Source
--- Clear all listeners.
-- @param	this		EventEmitter	The EventEmitter instance to clear listeners from.
function EventEmitter.clear_all(this, event_name)
{
	"type": "function",
	"internal": false,
	"description": "Clear all listeners.",
	"directives": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to clear listeners from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to clear listeners from."
		}
	],
	"line": 80,
	"namespace": "worldeditadditions_core.EventEmitter",
	"line_last": 82,
	"name": "clear_all",
	"instanced": false,
	"args": [
		"this",
		"event_name"
	],
	"text": "--- Clear all listeners.\n-- @param\tthis\t\tEventEmitter\tThe EventEmitter instance to clear listeners from.\nfunction EventEmitter.clear_all(this, event_name)",
	"params": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to clear listeners from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to clear listeners from."
		}
	],
	"name_full": "worldeditadditions_core.EventEmitter.clear_all",
	"filename": "worldeditadditions_core/utils/EventEmitter.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/EventEmitter.lua#L81-L83"
}

emit 🔗

Emit an event.

Arguments

NameTypeDefault valueDescription
thisEventEmitternil

The EventEmitter instance to emit the event from.

event_namestringnil

The name of the event to emit.

argstable|anynil

The argument(s) to pass to listener functions. It is strongly advised you pass a table here.

Returns

nil

Source
--- Emit an event.
-- @param	this		EventEmitter	The EventEmitter instance to emit the event from.
-- @param	event_name	string			The name of the event to emit.
-- @param	args		table|any		The argument(s) to pass to listener functions. It is strongly advised you pass a table here.
function EventEmitter.emit(this, event_name, args)
{
	"type": "function",
	"internal": false,
	"description": "Emit an event.",
	"directives": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to emit the event from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to emit the event from."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to emit.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to emit."
		},
		{
			"directive": "param",
			"text": "args\t\ttable|any\t\tThe argument(s) to pass to listener functions. It is strongly advised you pass a table here.",
			"name": "args",
			"type": "table|any",
			"description": "The argument(s) to pass to listener functions. It is strongly advised you pass a table here."
		}
	],
	"line": 55,
	"namespace": "worldeditadditions_core.EventEmitter",
	"line_last": 59,
	"name": "emit",
	"instanced": false,
	"args": [
		"this",
		"event_name",
		"args"
	],
	"text": "--- Emit an event.\n-- @param\tthis\t\tEventEmitter\tThe EventEmitter instance to emit the event from.\n-- @param\tevent_name\tstring\t\t\tThe name of the event to emit.\n-- @param\targs\t\ttable|any\t\tThe argument(s) to pass to listener functions. It is strongly advised you pass a table here.\nfunction EventEmitter.emit(this, event_name, args)",
	"params": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to emit the event from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to emit the event from."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to emit.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to emit."
		},
		{
			"directive": "param",
			"text": "args\t\ttable|any\t\tThe argument(s) to pass to listener functions. It is strongly advised you pass a table here.",
			"name": "args",
			"type": "table|any",
			"description": "The argument(s) to pass to listener functions. It is strongly advised you pass a table here."
		}
	],
	"name_full": "worldeditadditions_core.EventEmitter.emit",
	"filename": "worldeditadditions_core/utils/EventEmitter.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/EventEmitter.lua#L56-L60"
}

new 🔗

Create a new event emitter.

Arguments

NameTypeDefault valueDescription
tbltable|nilnil

Optional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!

Returns

table :

The new EventEmitter object. If a table is passed in, a new table is NOT created.

Source
--- Create a new event emitter.
-- @param	tbl	table|nil	Optional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!
-- @returns	table	The new EventEmitter object. If a table is passed in, a new table is NOT created.
function EventEmitter.new(tbl)
{
	"type": "function",
	"internal": false,
	"description": "Create a new event emitter.",
	"directives": [
		{
			"directive": "param",
			"text": "tbl\ttable|nil\tOptional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!",
			"name": "tbl",
			"type": "table|nil",
			"description": "Optional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!"
		},
		{
			"directive": "returns",
			"text": "table\tThe new EventEmitter object. If a table is passed in, a new table is NOT created.",
			"type": "table",
			"description": "The new EventEmitter object. If a table is passed in, a new table is NOT created."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions_core.EventEmitter",
	"line_last": 10,
	"name": "new",
	"instanced": false,
	"args": [
		"tbl"
	],
	"text": "--- Create a new event emitter.\n-- @param\ttbl\ttable|nil\tOptional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!\n-- @returns\ttable\tThe new EventEmitter object. If a table is passed in, a new table is NOT created.\nfunction EventEmitter.new(tbl)",
	"params": [
		{
			"directive": "param",
			"text": "tbl\ttable|nil\tOptional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!",
			"name": "tbl",
			"type": "table|nil",
			"description": "Optional. A table to base the new EventEmitter object on. EventEmitter will attach ann instance of itself to this object. The 'events' property on the object MUST NOT be set. IT WILL BE OVERWRITTEN!"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table\tThe new EventEmitter object. If a table is passed in, a new table is NOT created.",
		"type": "table",
		"description": "The new EventEmitter object. If a table is passed in, a new table is NOT created."
	},
	"name_full": "worldeditadditions_core.EventEmitter.new",
	"filename": "worldeditadditions_core/utils/EventEmitter.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/EventEmitter.lua#L8-L11"
}

removeEventListener 🔗

Remove an existing listener from the given named event.

Arguments

NameTypeDefault valueDescription
thisEventEmitternil

The EventEmitter instance to remove the listener from.

event_namestringnil

The name of the event to remove from.

funcfunctionnil

The callback function to remove from the list of listeners for the given named event.

Returns

bool :

Whether it was actually removed or not. False means it failed to find the given listener function.

Source
--- Remove an existing listener from the given named event.
-- @param	this		EventEmitter	The EventEmitter instance to remove the listener from.
-- @param	event_name	string			The name of the event to remove from.
-- @param	func		function		The callback function to remove from the list of listeners for the given named event.
-- @return	bool		Whether it was actually removed or not. False means it failed to find the given listener function.
function EventEmitter.removeEventListener(this, event_name, func)
{
	"type": "function",
	"internal": false,
	"description": "Remove an existing listener from the given named event.",
	"directives": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to remove the listener from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to remove the listener from."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to remove from.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to remove from."
		},
		{
			"directive": "param",
			"text": "func\t\tfunction\t\tThe callback function to remove from the list of listeners for the given named event.",
			"name": "func",
			"type": "function",
			"description": "The callback function to remove from the list of listeners for the given named event."
		},
		{
			"directive": "returns",
			"text": "bool\t\tWhether it was actually removed or not. False means it failed to find the given listener function.",
			"type": "bool",
			"description": "Whether it was actually removed or not. False means it failed to find the given listener function."
		}
	],
	"line": 36,
	"namespace": "worldeditadditions_core.EventEmitter",
	"line_last": 41,
	"name": "removeEventListener",
	"instanced": false,
	"args": [
		"this",
		"event_name",
		"func"
	],
	"text": "--- Remove an existing listener from the given named event.\n-- @param\tthis\t\tEventEmitter\tThe EventEmitter instance to remove the listener from.\n-- @param\tevent_name\tstring\t\t\tThe name of the event to remove from.\n-- @param\tfunc\t\tfunction\t\tThe callback function to remove from the list of listeners for the given named event.\n-- @return\tbool\t\tWhether it was actually removed or not. False means it failed to find the given listener function.\nfunction EventEmitter.removeEventListener(this, event_name, func)",
	"params": [
		{
			"directive": "param",
			"text": "this\t\tEventEmitter\tThe EventEmitter instance to remove the listener from.",
			"name": "this",
			"type": "EventEmitter",
			"description": "The EventEmitter instance to remove the listener from."
		},
		{
			"directive": "param",
			"text": "event_name\tstring\t\t\tThe name of the event to remove from.",
			"name": "event_name",
			"type": "string",
			"description": "The name of the event to remove from."
		},
		{
			"directive": "param",
			"text": "func\t\tfunction\t\tThe callback function to remove from the list of listeners for the given named event.",
			"name": "func",
			"type": "function",
			"description": "The callback function to remove from the list of listeners for the given named event."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\tWhether it was actually removed or not. False means it failed to find the given listener function.",
		"type": "bool",
		"description": "Whether it was actually removed or not. False means it failed to find the given listener function."
	},
	"name_full": "worldeditadditions_core.EventEmitter.removeEventListener",
	"filename": "worldeditadditions_core/utils/EventEmitter.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/EventEmitter.lua#L37-L42"
}

Face 🔗

A single face of a Mesh.

Functions

equal 🔗

Determines whether this face is equal to another face or not.

Arguments

NameTypeDefault valueDescription
aFacenil

The first face to compare.

bFacenil

The second face to compare.

Returns

bool :

Whether the 2 faces are equal or not.

Source
--- Determines whether this face is equal to another face or not.
-- @param	a	Face	The first face to compare.
-- @param	b	Face	The second face to compare.
-- @returns	bool		Whether the 2 faces are equal or not.
function Face.equal(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Determines whether this face is equal to another face or not.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tFace\tThe first face to compare.",
			"name": "a",
			"type": "Face",
			"description": "The first face to compare."
		},
		{
			"directive": "param",
			"text": "b\tFace\tThe second face to compare.",
			"name": "b",
			"type": "Face",
			"description": "The second face to compare."
		},
		{
			"directive": "returns",
			"text": "bool\t\tWhether the 2 faces are equal or not.",
			"type": "bool",
			"description": "Whether the 2 faces are equal or not."
		}
	],
	"line": 23,
	"namespace": "worldeditadditions_core.Face",
	"line_last": 27,
	"name": "equal",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Determines whether this face is equal to another face or not.\n-- @param\ta\tFace\tThe first face to compare.\n-- @param\tb\tFace\tThe second face to compare.\n-- @returns\tbool\t\tWhether the 2 faces are equal or not.\nfunction Face.equal(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\tFace\tThe first face to compare.",
			"name": "a",
			"type": "Face",
			"description": "The first face to compare."
		},
		{
			"directive": "param",
			"text": "b\tFace\tThe second face to compare.",
			"name": "b",
			"type": "Face",
			"description": "The second face to compare."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\tWhether the 2 faces are equal or not.",
		"type": "bool",
		"description": "Whether the 2 faces are equal or not."
	},
	"name_full": "worldeditadditions_core.Face.equal",
	"filename": "worldeditadditions_core/utils/mesh.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/mesh.lua#L24-L28"
}

new 🔗

Creates a new face from a list of vertices. The list of vertices should be anti-clockwise.

Arguments

NameTypeDefault valueDescription
verticesVector3[]nil

A list of Vector3 vertices that define the face.

Returns

nil

Source
--- Creates a new face from a list of vertices.
-- The list of vertices should be anti-clockwise.
-- @param	vertices	Vector3[]	A list of Vector3 vertices that define the face.
function Face.new(vertices)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new face from a list of vertices.\nThe list of vertices should be anti-clockwise.",
	"directives": [
		{
			"directive": "param",
			"text": "vertices\tVector3[]\tA list of Vector3 vertices that define the face.",
			"name": "vertices",
			"type": "Vector3[]",
			"description": "A list of Vector3 vertices that define the face."
		}
	],
	"line": 14,
	"namespace": "worldeditadditions_core.Face",
	"line_last": 17,
	"name": "new",
	"instanced": false,
	"args": [
		"vertices"
	],
	"text": "--- Creates a new face from a list of vertices.\n-- The list of vertices should be anti-clockwise.\n-- @param\tvertices\tVector3[]\tA list of Vector3 vertices that define the face.\nfunction Face.new(vertices)",
	"params": [
		{
			"directive": "param",
			"text": "vertices\tVector3[]\tA list of Vector3 vertices that define the face.",
			"name": "vertices",
			"type": "Vector3[]",
			"description": "A list of Vector3 vertices that define the face."
		}
	],
	"name_full": "worldeditadditions_core.Face.new",
	"filename": "worldeditadditions_core/utils/mesh.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/mesh.lua#L15-L18"
}

io 🔗

Functions to abstract file I/O away. I'm very suspicious of Minetest's API changing from under our feet.


FileFormats 🔗

File formats WorldEditAdditions supports reading and/or writing. It is currently unclear which of these formats we will actually implement.

Current Status:

FormatReadWrite
weaschem
mtschem
we

StagedVoxelRegion 🔗

A region of the world that is to be or has been saved to/from disk. This class exists to make moving things to/from disk easier and less complicated.

In short, use StagedVoxelRegion.NewFromVoxelManip or StagedVoxelRegion.NewFromTable to SAVE data, and StagedVoxelRegion.Load or StagedVoxelRegion.LoadIntoVoxelManip to LOAD data.

Functions

load 🔗

Loads a file of the an array.

Arguments

NameTypeDefault valueDescription
filepathstringnil

The filepath to load the .weaschem file from.

formatstring"auto"

The format in which the target is written in.

Returns

nil

Source
--- Loads a file of the an array.
-- @param	filepath		string	The filepath to load the .weaschem file from.
-- @param	format="auto"	string	The format in which the target is written in.
function StagedVoxelRegion.load(filepath, format)
{
	"type": "function",
	"internal": false,
	"description": "Loads a file of the an array.",
	"directives": [
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to load the .weaschem file from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load the .weaschem file from."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format in which the target is written in.",
			"name": "format",
			"type": "string",
			"description": "The format in which the target is written in.",
			"default_value": "\"auto\""
		}
	],
	"line": 197,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 200,
	"name": "load",
	"instanced": false,
	"args": [
		"filepath",
		"format"
	],
	"text": "--- Loads a file of the an array.\n-- @param\tfilepath\t\tstring\tThe filepath to load the .weaschem file from.\n-- @param\tformat=\"auto\"\tstring\tThe format in which the target is written in.\nfunction StagedVoxelRegion.load(filepath, format)",
	"params": [
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to load the .weaschem file from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load the .weaschem file from."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format in which the target is written in.",
			"name": "format",
			"type": "string",
			"description": "The format in which the target is written in.",
			"default_value": "\"auto\""
		}
	],
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.load",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L198-L201"
}

Load 🔗

Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.

Note: This function does NOT modify the world.

Arguments

NameTypeDefault valueDescription
filepathstringnil

The filepath to load data from.

voxelareaVoxelAreanil

The VoxelArea from the target VoxelManipulator instance.

pos1Vector3nil

Position 1 in WORLD space to load the data into.

pos2Vector3nil

Position 2 in WORLD space to load the data into.

formatstring"auto"

The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.

Returns

bool,table :

A success/failure bool, followed by TODO: The format of this table is still to be decided.

Source
--- Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.
--
-- **Note:** This function does NOT modify the world.
-- @static
-- @param	filepath		string		The filepath to load data from.
-- @param	voxelarea		VoxelArea	The VoxelArea from the target VoxelManipulator instance.
-- @param	pos1			Vector3		Position 1 in WORLD space to load the data into.
-- @param	pos2			Vector3		Position 2 in WORLD space to load the data into.
-- @param	format="auto"	string		The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.
-- @returns	bool,table	A success/failure bool, followed by TODO: The format of this table is still to be decided.
function StagedVoxelRegion.Load(filepath, voxelarea, pos1, pos2, format)
{
	"type": "function",
	"internal": false,
	"description": "Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.\n\n**Note:** This function does NOT modify the world.",
	"directives": [
		{
			"directive": "static",
			"text": ""
		},
		{
			"directive": "param",
			"text": "filepath\t\tstring\t\tThe filepath to load data from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load data from."
		},
		{
			"directive": "param",
			"text": "voxelarea\t\tVoxelArea\tThe VoxelArea from the target VoxelManipulator instance.",
			"name": "voxelarea",
			"type": "VoxelArea",
			"description": "The VoxelArea from the target VoxelManipulator instance."
		},
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tPosition 1 in WORLD space to load the data into.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tPosition 2 in WORLD space to load the data into.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\t\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		},
		{
			"directive": "returns",
			"text": "bool,table\tA success/failure bool, followed by TODO: The format of this table is still to be decided.",
			"type": "bool,table",
			"description": "A success/failure bool, followed by TODO: The format of this table is still to be decided."
		}
	],
	"line": 99,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 109,
	"name": "Load",
	"instanced": false,
	"args": [
		"filepath",
		"voxelarea",
		"pos1",
		"pos2",
		"format"
	],
	"text": "--- Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.\n--\n-- **Note:** This function does NOT modify the world.\n-- @static\n-- @param\tfilepath\t\tstring\t\tThe filepath to load data from.\n-- @param\tvoxelarea\t\tVoxelArea\tThe VoxelArea from the target VoxelManipulator instance.\n-- @param\tpos1\t\t\tVector3\t\tPosition 1 in WORLD space to load the data into.\n-- @param\tpos2\t\t\tVector3\t\tPosition 2 in WORLD space to load the data into.\n-- @param\tformat=\"auto\"\tstring\t\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.\n-- @returns\tbool,table\tA success/failure bool, followed by TODO: The format of this table is still to be decided.\nfunction StagedVoxelRegion.Load(filepath, voxelarea, pos1, pos2, format)",
	"params": [
		{
			"directive": "param",
			"text": "filepath\t\tstring\t\tThe filepath to load data from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load data from."
		},
		{
			"directive": "param",
			"text": "voxelarea\t\tVoxelArea\tThe VoxelArea from the target VoxelManipulator instance.",
			"name": "voxelarea",
			"type": "VoxelArea",
			"description": "The VoxelArea from the target VoxelManipulator instance."
		},
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\t\tPosition 1 in WORLD space to load the data into.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\t\tPosition 2 in WORLD space to load the data into.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\t\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,table\tA success/failure bool, followed by TODO: The format of this table is still to be decided.",
		"type": "bool,table",
		"description": "A success/failure bool, followed by TODO: The format of this table is still to be decided."
	},
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.Load",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L100-L110"
}

LoadIntoVoxelManip 🔗

Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.

Note: This function DOES NOT call finish on the VoxelManipulator!

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

Position 1 in WORLD space to load the data into.

pos2Vector3nil

Position 2 in WORLD space to load the data into.

voxelmanipVoxelManipulatornil

The VoxelManipulator to load the data into.

filepathstringnil

The filepath to load data from.

formatstring"auto"

The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.

Returns

bool,table :

A success/failure bool, followed by TODO: The format of this table is still to be decided.

Source
--- Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.
--
-- **Note:** This function DOES NOT call finish on the VoxelManipulator!
-- @static
-- @param	pos1			Vector3	Position 1 in WORLD space to load the data into.
-- @param	pos2			Vector3	Position 2 in WORLD space to load the data into.
-- @param	voxelmanip	VoxelManipulator	The VoxelManipulator to load the data into.
-- @param	filepath		string	The filepath to load data from.
-- @param	format="auto"	string	The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.
-- @returns	bool,table	A success/failure bool, followed by TODO: The format of this table is still to be decided.
function StagedVoxelRegion.LoadIntoVoxelManip(filepath, voxelmanip, pos1, pos2, format)
{
	"type": "function",
	"internal": false,
	"description": "Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.\n\n**Note:** This function DOES NOT call finish on the VoxelManipulator!",
	"directives": [
		{
			"directive": "static",
			"text": ""
		},
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\tPosition 1 in WORLD space to load the data into.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\tPosition 2 in WORLD space to load the data into.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "voxelmanip\tVoxelManipulator\tThe VoxelManipulator to load the data into.",
			"name": "voxelmanip",
			"type": "VoxelManipulator",
			"description": "The VoxelManipulator to load the data into."
		},
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to load data from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load data from."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		},
		{
			"directive": "returns",
			"text": "bool,table\tA success/failure bool, followed by TODO: The format of this table is still to be decided.",
			"type": "bool,table",
			"description": "A success/failure bool, followed by TODO: The format of this table is still to be decided."
		}
	],
	"line": 85,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 95,
	"name": "LoadIntoVoxelManip",
	"instanced": false,
	"args": [
		"filepath",
		"voxelmanip",
		"pos1",
		"pos2",
		"format"
	],
	"text": "--- Loads voxel data from disk, returning padded arrays suitable for use with VoxelManipulator instances.\n--\n-- **Note:** This function DOES NOT call finish on the VoxelManipulator!\n-- @static\n-- @param\tpos1\t\t\tVector3\tPosition 1 in WORLD space to load the data into.\n-- @param\tpos2\t\t\tVector3\tPosition 2 in WORLD space to load the data into.\n-- @param\tvoxelmanip\tVoxelManipulator\tThe VoxelManipulator to load the data into.\n-- @param\tfilepath\t\tstring\tThe filepath to load data from.\n-- @param\tformat=\"auto\"\tstring\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.\n-- @returns\tbool,table\tA success/failure bool, followed by TODO: The format of this table is still to be decided.\nfunction StagedVoxelRegion.LoadIntoVoxelManip(filepath, voxelmanip, pos1, pos2, format)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\tPosition 1 in WORLD space to load the data into.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\tPosition 2 in WORLD space to load the data into.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "voxelmanip\tVoxelManipulator\tThe VoxelManipulator to load the data into.",
			"name": "voxelmanip",
			"type": "VoxelManipulator",
			"description": "The VoxelManipulator to load the data into."
		},
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to load data from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load data from."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,table\tA success/failure bool, followed by TODO: The format of this table is still to be decided.",
		"type": "bool,table",
		"description": "A success/failure bool, followed by TODO: The format of this table is still to be decided."
	},
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.LoadIntoVoxelManip",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L86-L96"
}

LoadRaw 🔗

Loads voxel data from disk, returning the raw UNPADDED arrays. In other words, the tables returned by this function WILL NOT fit directly into a VoxelManipulator, because VoxelManipulator data/param2 tables also contain padding data (likely because VoxelManip load only chunks at a time).

Note: This function does NOT modify the world.

Arguments

NameTypeDefault valueDescription
filepathstringnil

The filepath to load data from.

pos1Vector3nil

Position 1 in WORLD space to load the data into.

pos2Vector3nil

Position 2 in WORLD space to load the data into.

formatstring"auto"

The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.

Returns

bool,table :

A success/failure bool, followed by TODO: The format of this table is still to be decided.

Source
--- Loads voxel data from disk, returning the raw UNPADDED arrays.
-- In other words, the tables returned by this function WILL NOT fit directly into a VoxelManipulator, because VoxelManipulator data/param2 tables also contain padding data (likely because VoxelManip load only chunks at a time).
-- 
-- **Note:** This function does NOT modify the world.
-- @static
-- @param	filepath		string	The filepath to load data from.
-- @param	pos1			Vector3	Position 1 in WORLD space to load the data into.
-- @param	pos2			Vector3	Position 2 in WORLD space to load the data into.
-- @param	format="auto"	string	The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.
-- @returns	bool,table		A success/failure bool, followed by TODO: The format of this table is still to be decided.
function StagedVoxelRegion.LoadRaw(filepath, pos1, pos2, format)
{
	"type": "function",
	"internal": false,
	"description": "Loads voxel data from disk, returning the raw UNPADDED arrays.\nIn other words, the tables returned by this function WILL NOT fit directly into a VoxelManipulator, because VoxelManipulator data/param2 tables also contain padding data (likely because VoxelManip load only chunks at a time).\n\n**Note:** This function does NOT modify the world.",
	"directives": [
		{
			"directive": "static",
			"text": ""
		},
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to load data from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load data from."
		},
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\tPosition 1 in WORLD space to load the data into.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\tPosition 2 in WORLD space to load the data into.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		},
		{
			"directive": "returns",
			"text": "bool,table\t\tA success/failure bool, followed by TODO: The format of this table is still to be decided.",
			"type": "bool,table",
			"description": "A success/failure bool, followed by TODO: The format of this table is still to be decided."
		}
	],
	"line": 113,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 123,
	"name": "LoadRaw",
	"instanced": false,
	"args": [
		"filepath",
		"pos1",
		"pos2",
		"format"
	],
	"text": "--- Loads voxel data from disk, returning the raw UNPADDED arrays.\n-- In other words, the tables returned by this function WILL NOT fit directly into a VoxelManipulator, because VoxelManipulator data/param2 tables also contain padding data (likely because VoxelManip load only chunks at a time).\n-- \n-- **Note:** This function does NOT modify the world.\n-- @static\n-- @param\tfilepath\t\tstring\tThe filepath to load data from.\n-- @param\tpos1\t\t\tVector3\tPosition 1 in WORLD space to load the data into.\n-- @param\tpos2\t\t\tVector3\tPosition 2 in WORLD space to load the data into.\n-- @param\tformat=\"auto\"\tstring\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.\n-- @returns\tbool,table\t\tA success/failure bool, followed by TODO: The format of this table is still to be decided.\nfunction StagedVoxelRegion.LoadRaw(filepath, pos1, pos2, format)",
	"params": [
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to load data from.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to load data from."
		},
		{
			"directive": "param",
			"text": "pos1\t\t\tVector3\tPosition 1 in WORLD space to load the data into.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "pos2\t\t\tVector3\tPosition 2 in WORLD space to load the data into.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 in WORLD space to load the data into."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format that the source data is in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,table\t\tA success/failure bool, followed by TODO: The format of this table is still to be decided.",
		"type": "bool,table",
		"description": "A success/failure bool, followed by TODO: The format of this table is still to be decided."
	},
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.LoadRaw",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L114-L124"
}

NewFromRaw 🔗

Creates a new StagedVoxelRegion from raw data/param2 tables.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The position in WORLD SPACE of pos1 of the defined region to stage for saving.

pos2Vector3nil

The position in WORLD SPACE of pos2 of the defined region to stage for saving.

offsetVector3nil

Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.

datanumber[]nil

A table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!

param2number[]nil

A table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!

Returns

bool,StagedVoxelRegion :

A success boolean, followed by the new StagedVoxelRegion instance.

Source
--- Creates a new StagedVoxelRegion from raw data/param2 tables.
-- @static
-- @param	pos1		Vector3		The position in WORLD SPACE of pos1 of the defined region to stage for saving.
-- @param	pos2		Vector3		The position in WORLD SPACE of pos2 of the defined region to stage for saving.
-- @param	offset		Vector3		Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.
-- @param	data	number[]		A table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!
-- @param	param2	number[]		A table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!
-- @returns	bool,StagedVoxelRegion	A success boolean, followed by the new StagedVoxelRegion instance.
function StagedVoxelRegion.NewFromRaw(pos1, pos2, offset, data, param2)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new StagedVoxelRegion from raw data/param2 tables.",
	"directives": [
		{
			"directive": "static",
			"text": ""
		},
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe position in WORLD SPACE of pos1 of the defined region to stage for saving.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos1 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tThe position in WORLD SPACE of pos2 of the defined region to stage for saving.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos2 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "offset\t\tVector3\t\tApply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.",
			"name": "offset",
			"type": "Vector3",
			"description": "Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof."
		},
		{
			"directive": "param",
			"text": "data\tnumber[]\t\tA table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!",
			"name": "data",
			"type": "number[]",
			"description": "A table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!"
		},
		{
			"directive": "param",
			"text": "param2\tnumber[]\t\tA table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!",
			"name": "param2",
			"type": "number[]",
			"description": "A table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!"
		},
		{
			"directive": "returns",
			"text": "bool,StagedVoxelRegion\tA success boolean, followed by the new StagedVoxelRegion instance.",
			"type": "bool,StagedVoxelRegion",
			"description": "A success boolean, followed by the new StagedVoxelRegion instance."
		}
	],
	"line": 60,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 68,
	"name": "NewFromRaw",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"offset",
		"data",
		"param2"
	],
	"text": "--- Creates a new StagedVoxelRegion from raw data/param2 tables.\n-- @static\n-- @param\tpos1\t\tVector3\t\tThe position in WORLD SPACE of pos1 of the defined region to stage for saving.\n-- @param\tpos2\t\tVector3\t\tThe position in WORLD SPACE of pos2 of the defined region to stage for saving.\n-- @param\toffset\t\tVector3\t\tApply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.\n-- @param\tdata\tnumber[]\t\tA table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!\n-- @param\tparam2\tnumber[]\t\tA table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!\n-- @returns\tbool,StagedVoxelRegion\tA success boolean, followed by the new StagedVoxelRegion instance.\nfunction StagedVoxelRegion.NewFromRaw(pos1, pos2, offset, data, param2)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\tThe position in WORLD SPACE of pos1 of the defined region to stage for saving.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos1 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\tThe position in WORLD SPACE of pos2 of the defined region to stage for saving.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos2 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "offset\t\tVector3\t\tApply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.",
			"name": "offset",
			"type": "Vector3",
			"description": "Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof."
		},
		{
			"directive": "param",
			"text": "data\tnumber[]\t\tA table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!",
			"name": "data",
			"type": "number[]",
			"description": "A table of numbers representing the node ids. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!"
		},
		{
			"directive": "param",
			"text": "param2\tnumber[]\t\tA table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!",
			"name": "param2",
			"type": "number[]",
			"description": "A table of numbers representing the param2 data. Should exactly match the data number[] in size. Must be ALREADY TRIMMED, NOT just taken straight from a VoxelManip!"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,StagedVoxelRegion\tA success boolean, followed by the new StagedVoxelRegion instance.",
		"type": "bool,StagedVoxelRegion",
		"description": "A success boolean, followed by the new StagedVoxelRegion instance."
	},
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.NewFromRaw",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L61-L69"
}

NewFromVoxelManip 🔗

Creates a new StagedVoxelRegion from the data in a VoxelManipulator. To save data, you probably want to call the save() method.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The position in WORLD SPACE of pos1 of the defined region to stage for saving.

pos2Vector3nil

The position in WORLD SPACE of pos2 of the defined region to stage for saving.

offsetVector3nil

Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.

voxelmanipVoxelManipulatornil

The voxel manipulator to take data from and save to disk.

Returns

bool,StagedVoxelRegion :

A success boolean, followed by the new StagedVoxelRegion instance.

Source
--- Creates a new StagedVoxelRegion from the data in a VoxelManipulator.
-- To save data, you probably want to call the save() method.
-- @param	pos1		Vector3				The position in WORLD SPACE of pos1 of the defined region to stage for saving.
-- @param	pos2		Vector3				The position in WORLD SPACE of pos2 of the defined region to stage for saving.
-- @param	offset		Vector3		Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.
-- @param	voxelmanip	VoxelManipulator	The voxel manipulator to take data from and save to disk.
-- @returns	bool,StagedVoxelRegion	A success boolean, followed by the new StagedVoxelRegion instance.
function StagedVoxelRegion.NewFromVoxelManip(pos1, pos2, offset, voxelmanip)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new StagedVoxelRegion from the data in a VoxelManipulator.\nTo save data, you probably want to call the save() method.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\t\t\tThe position in WORLD SPACE of pos1 of the defined region to stage for saving.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos1 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\t\t\tThe position in WORLD SPACE of pos2 of the defined region to stage for saving.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos2 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "offset\t\tVector3\t\tApply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.",
			"name": "offset",
			"type": "Vector3",
			"description": "Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof."
		},
		{
			"directive": "param",
			"text": "voxelmanip\tVoxelManipulator\tThe voxel manipulator to take data from and save to disk.",
			"name": "voxelmanip",
			"type": "VoxelManipulator",
			"description": "The voxel manipulator to take data from and save to disk."
		},
		{
			"directive": "returns",
			"text": "bool,StagedVoxelRegion\tA success boolean, followed by the new StagedVoxelRegion instance.",
			"type": "bool,StagedVoxelRegion",
			"description": "A success boolean, followed by the new StagedVoxelRegion instance."
		}
	],
	"line": 36,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 43,
	"name": "NewFromVoxelManip",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"offset",
		"voxelmanip"
	],
	"text": "--- Creates a new StagedVoxelRegion from the data in a VoxelManipulator.\n-- To save data, you probably want to call the save() method.\n-- @param\tpos1\t\tVector3\t\t\t\tThe position in WORLD SPACE of pos1 of the defined region to stage for saving.\n-- @param\tpos2\t\tVector3\t\t\t\tThe position in WORLD SPACE of pos2 of the defined region to stage for saving.\n-- @param\toffset\t\tVector3\t\tApply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.\n-- @param\tvoxelmanip\tVoxelManipulator\tThe voxel manipulator to take data from and save to disk.\n-- @returns\tbool,StagedVoxelRegion\tA success boolean, followed by the new StagedVoxelRegion instance.\nfunction StagedVoxelRegion.NewFromVoxelManip(pos1, pos2, offset, voxelmanip)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\t\tVector3\t\t\t\tThe position in WORLD SPACE of pos1 of the defined region to stage for saving.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos1 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "pos2\t\tVector3\t\t\t\tThe position in WORLD SPACE of pos2 of the defined region to stage for saving.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The position in WORLD SPACE of pos2 of the defined region to stage for saving."
		},
		{
			"directive": "param",
			"text": "offset\t\tVector3\t\tApply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof.",
			"name": "offset",
			"type": "Vector3",
			"description": "Apply this offset before placing in the world. e.g. if you have a schematic of a tree, and want it to place centred on the base thereof."
		},
		{
			"directive": "param",
			"text": "voxelmanip\tVoxelManipulator\tThe voxel manipulator to take data from and save to disk.",
			"name": "voxelmanip",
			"type": "VoxelManipulator",
			"description": "The voxel manipulator to take data from and save to disk."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,StagedVoxelRegion\tA success boolean, followed by the new StagedVoxelRegion instance.",
		"type": "bool,StagedVoxelRegion",
		"description": "A success boolean, followed by the new StagedVoxelRegion instance."
	},
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.NewFromVoxelManip",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L37-L44"
}

save 🔗

Saves the StagedVoxelRegion to the filepath.

Arguments

NameTypeDefault valueDescription
filepathstringnil

The filepath to save the StagedVoxelRegion to.

formatstring"auto"

The format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.

Returns

bool :

Whether the operation was successful or not.

Source
--- Saves the StagedVoxelRegion to the filepath.
-- @param	filepath		string	The filepath to save the StagedVoxelRegion to.
-- @param	format="auto"	string	The format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.
-- @returns	bool			Whether the operation was successful or not.
function StagedVoxelRegion.save(svr, filepath, format)
{
	"type": "function",
	"internal": false,
	"description": "Saves the StagedVoxelRegion to the filepath.",
	"directives": [
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to save the StagedVoxelRegion to.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to save the StagedVoxelRegion to."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		},
		{
			"directive": "returns",
			"text": "bool\t\t\tWhether the operation was successful or not.",
			"type": "bool",
			"description": "Whether the operation was successful or not."
		}
	],
	"line": 138,
	"namespace": "worldeditadditions_core.io.StagedVoxelRegion",
	"line_last": 142,
	"name": "save",
	"instanced": false,
	"args": [
		"svr",
		"filepath",
		"format"
	],
	"text": "--- Saves the StagedVoxelRegion to the filepath.\n-- @param\tfilepath\t\tstring\tThe filepath to save the StagedVoxelRegion to.\n-- @param\tformat=\"auto\"\tstring\tThe format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.\n-- @returns\tbool\t\t\tWhether the operation was successful or not.\nfunction StagedVoxelRegion.save(svr, filepath, format)",
	"params": [
		{
			"directive": "param",
			"text": "filepath\t\tstring\tThe filepath to save the StagedVoxelRegion to.",
			"name": "filepath",
			"type": "string",
			"description": "The filepath to save the StagedVoxelRegion to."
		},
		{
			"directive": "param",
			"text": "format=\"auto\"\tstring\tThe format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"name": "format",
			"type": "string",
			"description": "The format to save in. Default: automatic, determine from file extension. See worldeditadditions_core.io.FileFormats for more information.",
			"default_value": "\"auto\""
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\t\tWhether the operation was successful or not.",
		"type": "bool",
		"description": "Whether the operation was successful or not."
	},
	"name_full": "worldeditadditions_core.io.StagedVoxelRegion.save",
	"filename": "worldeditadditions_core/utils/io/StagedVoxelRegion.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/io/StagedVoxelRegion.lua#L139-L143"
}

LRU 🔗

A least-recently-used cache implementation.

Functions

get 🔗

Gets the value associated with the given key.

Arguments

NameTypeDefault valueDescription
keystringnil

The key to retrieve the value for.

Returns

any|nil :

The value associated with the given key, or nil if it doesn't exist in this cache.

Source
--- Gets the value associated with the given key.
-- @param	key		string	The key to retrieve the value for.
-- @returns	any|nil	The value associated with the given key, or nil if it doesn't exist in this cache.
function LRU:get(key)
{
	"type": "function",
	"internal": false,
	"description": "Gets the value associated with the given key.",
	"directives": [
		{
			"directive": "param",
			"text": "key\t\tstring\tThe key to retrieve the value for.",
			"name": "key",
			"type": "string",
			"description": "The key to retrieve the value for."
		},
		{
			"directive": "returns",
			"text": "any|nil\tThe value associated with the given key, or nil if it doesn't exist in this cache.",
			"type": "any|nil",
			"description": "The value associated with the given key, or nil if it doesn't exist in this cache."
		}
	],
	"line": 36,
	"namespace": "worldeditadditions_core.LRU",
	"line_last": 39,
	"name": "get",
	"instanced": true,
	"args": [
		"key"
	],
	"text": "--- Gets the value associated with the given key.\n-- @param\tkey\t\tstring\tThe key to retrieve the value for.\n-- @returns\tany|nil\tThe value associated with the given key, or nil if it doesn't exist in this cache.\nfunction LRU:get(key)",
	"params": [
		{
			"directive": "param",
			"text": "key\t\tstring\tThe key to retrieve the value for.",
			"name": "key",
			"type": "string",
			"description": "The key to retrieve the value for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "any|nil\tThe value associated with the given key, or nil if it doesn't exist in this cache.",
		"type": "any|nil",
		"description": "The value associated with the given key, or nil if it doesn't exist in this cache."
	},
	"name_full": "worldeditadditions_core.LRU.get",
	"filename": "worldeditadditions_core/utils/lru.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/lru.lua#L37-L40"
}

has 🔗

Determines whether the given key is present in this cache object. Does NOT update the most recently used status of said key.

Arguments

NameTypeDefault valueDescription
keystringnil

The key to check.

Returns

bool :

Whether the given key exists in the cache or not.

Source
--- Determines whether the given key is present in this cache object.
-- Does NOT update the most recently used status of said key.
-- @param	key		string	The key to check.
-- @returns	bool	Whether the given key exists in the cache or not.
function LRU:has(key)
{
	"type": "function",
	"internal": false,
	"description": "Determines whether the given key is present in this cache object.\nDoes NOT update the most recently used status of said key.",
	"directives": [
		{
			"directive": "param",
			"text": "key\t\tstring\tThe key to check.",
			"name": "key",
			"type": "string",
			"description": "The key to check."
		},
		{
			"directive": "returns",
			"text": "bool\tWhether the given key exists in the cache or not.",
			"type": "bool",
			"description": "Whether the given key exists in the cache or not."
		}
	],
	"line": 28,
	"namespace": "worldeditadditions_core.LRU",
	"line_last": 32,
	"name": "has",
	"instanced": true,
	"args": [
		"key"
	],
	"text": "--- Determines whether the given key is present in this cache object.\n-- Does NOT update the most recently used status of said key.\n-- @param\tkey\t\tstring\tThe key to check.\n-- @returns\tbool\tWhether the given key exists in the cache or not.\nfunction LRU:has(key)",
	"params": [
		{
			"directive": "param",
			"text": "key\t\tstring\tThe key to check.",
			"name": "key",
			"type": "string",
			"description": "The key to check."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the given key exists in the cache or not.",
		"type": "bool",
		"description": "Whether the given key exists in the cache or not."
	},
	"name_full": "worldeditadditions_core.LRU.has",
	"filename": "worldeditadditions_core/utils/lru.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/lru.lua#L29-L33"
}

new 🔗

Creates a new LRU cache. Optimal sizes: 8, 16, 32, 64 or any value above

Arguments

NameTypeDefault valueDescription
max_sizenumber32

The maximum number of items to store in the cache.

Returns

LRU :

A new LRU cache.

Source
--- Creates a new LRU cache.
-- Optimal sizes: 8, 16, 32, 64 or any value above
-- @param	max_size=32		number	The maximum number of items to store in the cache.
-- @returns	LRU				A new LRU cache.
function LRU.new(max_size)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new LRU cache.\nOptimal sizes: 8, 16, 32, 64 or any value above",
	"directives": [
		{
			"directive": "param",
			"text": "max_size=32\t\tnumber\tThe maximum number of items to store in the cache.",
			"name": "max_size",
			"type": "number",
			"description": "The maximum number of items to store in the cache.",
			"default_value": "32"
		},
		{
			"directive": "returns",
			"text": "LRU\t\t\t\tA new LRU cache.",
			"type": "LRU",
			"description": "A new LRU cache."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions_core.LRU",
	"line_last": 16,
	"name": "new",
	"instanced": false,
	"args": [
		"max_size"
	],
	"text": "--- Creates a new LRU cache.\n-- Optimal sizes: 8, 16, 32, 64 or any value above\n-- @param\tmax_size=32\t\tnumber\tThe maximum number of items to store in the cache.\n-- @returns\tLRU\t\t\t\tA new LRU cache.\nfunction LRU.new(max_size)",
	"params": [
		{
			"directive": "param",
			"text": "max_size=32\t\tnumber\tThe maximum number of items to store in the cache.",
			"name": "max_size",
			"type": "number",
			"description": "The maximum number of items to store in the cache.",
			"default_value": "32"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "LRU\t\t\t\tA new LRU cache.",
		"type": "LRU",
		"description": "A new LRU cache."
	},
	"name_full": "worldeditadditions_core.LRU.new",
	"filename": "worldeditadditions_core/utils/lru.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/lru.lua#L13-L17"
}

set 🔗

Adds a given key-value pair to this cache. Note that this might (or might not) result in the eviction of another item.

Arguments

NameTypeDefault valueDescription
keystringnil

The key of the item to add.

valueanynil

The value to associate with the given key.

Returns

nil

Source
--- Adds a given key-value pair to this cache.
-- Note that this might (or might not) result in the eviction of another item.
-- @param	key		string	The key of the item to add.
-- @param	value	any		The value to associate with the given key.
-- @returns nil
function LRU:set(key, value)
{
	"type": "function",
	"internal": false,
	"description": "Adds a given key-value pair to this cache.\nNote that this might (or might not) result in the eviction of another item.",
	"directives": [
		{
			"directive": "param",
			"text": "key\t\tstring\tThe key of the item to add.",
			"name": "key",
			"type": "string",
			"description": "The key of the item to add."
		},
		{
			"directive": "param",
			"text": "value\tany\t\tThe value to associate with the given key.",
			"name": "value",
			"type": "any",
			"description": "The value to associate with the given key."
		},
		{
			"directive": "returns",
			"text": "nil",
			"type": "nil"
		}
	],
	"line": 49,
	"namespace": "worldeditadditions_core.LRU",
	"line_last": 54,
	"name": "set",
	"instanced": true,
	"args": [
		"key",
		"value"
	],
	"text": "--- Adds a given key-value pair to this cache.\n-- Note that this might (or might not) result in the eviction of another item.\n-- @param\tkey\t\tstring\tThe key of the item to add.\n-- @param\tvalue\tany\t\tThe value to associate with the given key.\n-- @returns nil\nfunction LRU:set(key, value)",
	"params": [
		{
			"directive": "param",
			"text": "key\t\tstring\tThe key of the item to add.",
			"name": "key",
			"type": "string",
			"description": "The key of the item to add."
		},
		{
			"directive": "param",
			"text": "value\tany\t\tThe value to associate with the given key.",
			"name": "value",
			"type": "any",
			"description": "The value to associate with the given key."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "nil",
		"type": "nil"
	},
	"name_full": "worldeditadditions_core.LRU.set",
	"filename": "worldeditadditions_core/utils/lru.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/lru.lua#L50-L55"
}

Mesh 🔗

A mesh of faces.

Functions

add_face 🔗

Adds a face to this mesh.

Arguments

NameTypeDefault valueDescription
selfMeshnil

The mesh instance to operate on.

faceFacenil

The face to add.

Returns

void

Source
--- Adds a face to this mesh.
-- @param	self	Mesh	The mesh instance to operate on.
-- @param	face	Face	The face to add.
-- @returns	void
function Mesh.add_face(self, face)
{
	"type": "function",
	"internal": false,
	"description": "Adds a face to this mesh.",
	"directives": [
		{
			"directive": "param",
			"text": "self\tMesh\tThe mesh instance to operate on.",
			"name": "self",
			"type": "Mesh",
			"description": "The mesh instance to operate on."
		},
		{
			"directive": "param",
			"text": "face\tFace\tThe face to add.",
			"name": "face",
			"type": "Face",
			"description": "The face to add."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 55,
	"namespace": "worldeditadditions_core.Mesh",
	"line_last": 59,
	"name": "add_face",
	"instanced": false,
	"args": [
		"self",
		"face"
	],
	"text": "--- Adds a face to this mesh.\n-- @param\tself\tMesh\tThe mesh instance to operate on.\n-- @param\tface\tFace\tThe face to add.\n-- @returns\tvoid\nfunction Mesh.add_face(self, face)",
	"params": [
		{
			"directive": "param",
			"text": "self\tMesh\tThe mesh instance to operate on.",
			"name": "self",
			"type": "Mesh",
			"description": "The mesh instance to operate on."
		},
		{
			"directive": "param",
			"text": "face\tFace\tThe face to add.",
			"name": "face",
			"type": "Face",
			"description": "The face to add."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions_core.Mesh.add_face",
	"filename": "worldeditadditions_core/utils/mesh.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/mesh.lua#L56-L60"
}

dedupe 🔗

Deduplicate the list of faces in this Mesh. Removes all faces that are exactly equal to one another. This reduces the filesize.

Arguments

NameTypeDefault valueDescription

Returns

number :

The number of faces removed.

Source
--- Deduplicate the list of faces in this Mesh.
-- Removes all faces that are exactly equal to one another. This reduces the
-- filesize.
-- @returns	number	The number of faces removed.
function Mesh.dedupe(self)
{
	"type": "function",
	"internal": false,
	"description": "Deduplicate the list of faces in this Mesh.\nRemoves all faces that are exactly equal to one another. This reduces the\nfilesize.",
	"directives": [
		{
			"directive": "returns",
			"text": "number\tThe number of faces removed.",
			"type": "number",
			"description": "The number of faces removed."
		}
	],
	"line": 63,
	"namespace": "worldeditadditions_core.Mesh",
	"line_last": 67,
	"name": "dedupe",
	"instanced": false,
	"args": [
		"self"
	],
	"text": "--- Deduplicate the list of faces in this Mesh.\n-- Removes all faces that are exactly equal to one another. This reduces the\n-- filesize.\n-- @returns\tnumber\tThe number of faces removed.\nfunction Mesh.dedupe(self)",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "number\tThe number of faces removed.",
		"type": "number",
		"description": "The number of faces removed."
	},
	"name_full": "worldeditadditions_core.Mesh.dedupe",
	"filename": "worldeditadditions_core/utils/mesh.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/mesh.lua#L64-L68"
}

new 🔗

Creates a new empty mesh object container.

Arguments

NameTypeDefault valueDescription

Returns

Mesh

Source
--- Creates a new empty mesh object container.
-- @returns	Mesh
function Mesh.new()
{
	"type": "function",
	"internal": false,
	"description": "Creates a new empty mesh object container.",
	"directives": [
		{
			"directive": "returns",
			"text": "Mesh",
			"type": "Mesh"
		}
	],
	"line": 48,
	"namespace": "worldeditadditions_core.Mesh",
	"line_last": 50,
	"name": "new",
	"instanced": false,
	"args": [
		""
	],
	"text": "--- Creates a new empty mesh object container.\n-- @returns\tMesh\nfunction Mesh.new()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "Mesh",
		"type": "Mesh"
	},
	"name_full": "worldeditadditions_core.Mesh.new",
	"filename": "worldeditadditions_core/utils/mesh.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/mesh.lua#L49-L51"
}

NodeListMatcher 🔗

Matcherer that compares node ids to given list of node names. This is a class so that caching can be done locally and per-task.

Functions

__parse_nodelist 🔗

Parses a list of node names, accounting for special keywords and group names.

Arguments

NameTypeDefault valueDescription
nodeliststring[]nil

The list of nodes to parse.

Returns

bool,string|table<string|function|number> :

A success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.

Different data types in the parsed nodelist mean different things:

  • string: The name of a group
  • function: A special function to call with the node id to match against as the first and only argument.
  • number: The id of the node to check against.

Source
--- Parses a list of node names, accounting for special keywords and group names.
-- @param	nodelist	string[]	The list of nodes to parse.
-- @returns	bool,string|table<string|function|number>	A success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.
-- 
-- Different data types in the parsed nodelist mean different things:
-- 
-- - **string:** The name of a group
-- - **function:** A special function to call with the node id to match against as the first and only argument.
-- - **number:** The id of the node to check against.
local function __parse_nodelist(nodelist)
{
	"type": "function",
	"internal": false,
	"description": "Parses a list of node names, accounting for special keywords and group names.",
	"directives": [
		{
			"directive": "param",
			"text": "nodelist\tstring[]\tThe list of nodes to parse.",
			"name": "nodelist",
			"type": "string[]",
			"description": "The list of nodes to parse."
		},
		{
			"directive": "returns",
			"text": "bool,string|table<string|function|number>\tA success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.\n\nDifferent data types in the parsed nodelist mean different things:\n\n- **string:** The name of a group\n- **function:** A special function to call with the node id to match against as the first and only argument.\n- **number:** The id of the node to check against.",
			"type": "bool,string|table<string|function|number>",
			"description": "A success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.\n\nDifferent data types in the parsed nodelist mean different things:\n\n- **string:** The name of a group\n- **function:** A special function to call with the node id to match against as the first and only argument.\n- **number:** The id of the node to check against."
		}
	],
	"line": 19,
	"namespace": "worldeditadditions_core.NodeListMatcher",
	"line_last": 28,
	"name": "__parse_nodelist",
	"instanced": false,
	"args": [
		"nodelist"
	],
	"text": "--- Parses a list of node names, accounting for special keywords and group names.\n-- @param\tnodelist\tstring[]\tThe list of nodes to parse.\n-- @returns\tbool,string|table<string|function|number>\tA success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.\n-- \n-- Different data types in the parsed nodelist mean different things:\n-- \n-- - **string:** The name of a group\n-- - **function:** A special function to call with the node id to match against as the first and only argument.\n-- - **number:** The id of the node to check against.\nlocal function __parse_nodelist(nodelist)",
	"params": [
		{
			"directive": "param",
			"text": "nodelist\tstring[]\tThe list of nodes to parse.",
			"name": "nodelist",
			"type": "string[]",
			"description": "The list of nodes to parse."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string|table<string|function|number>\tA success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.\n\nDifferent data types in the parsed nodelist mean different things:\n\n- **string:** The name of a group\n- **function:** A special function to call with the node id to match against as the first and only argument.\n- **number:** The id of the node to check against.",
		"type": "bool,string|table<string|function|number>",
		"description": "A success bool (true = success), followed by eitheran error string if success == false or the parsed nodelist if success == true.\n\nDifferent data types in the parsed nodelist mean different things:\n\n- **string:** The name of a group\n- **function:** A special function to call with the node id to match against as the first and only argument.\n- **number:** The id of the node to check against."
	},
	"name_full": "worldeditadditions_core.NodeListMatcher.__parse_nodelist",
	"filename": "worldeditadditions_core/utils/NodeListMatcher.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/NodeListMatcher.lua#L20-L29"
}

match_group 🔗

Determines if the given node id has the given group name. Caches the result for performance. You probably want NodeListMatcher:match_id(node_id).

Arguments

NameTypeDefault valueDescription
matcherNodeListMatchernil

The NodeListMatcher instance to use to make the query.

node_idnumbernil

The numerical id of the node to check.

group_namestringnil

The name of the group to check if the given node id has.

Returns

bool :

True if the given node id belongs to the specified group, and false if it does not.

Source
--- Determines if the given node id has the given group name.
-- Caches the result for performance. You probably want NodeListMatcher:match_id(node_id).
-- @param	matcher		NodeListMatcher		The NodeListMatcher instance to use to make the query.
-- @param	node_id		number				The numerical id of the node to check.
-- @param	group_name	string				The name of the group to check if the given node id has.
-- @returns	bool		True if the given node id belongs to the specified group, and false if it does not.
function NodeListMatcher.match_group(matcher, node_id, group_name)
{
	"type": "function",
	"internal": false,
	"description": "Determines if the given node id has the given group name.\nCaches the result for performance. You probably want NodeListMatcher:match_id(node_id).",
	"directives": [
		{
			"directive": "param",
			"text": "matcher\t\tNodeListMatcher\t\tThe NodeListMatcher instance to use to make the query.",
			"name": "matcher",
			"type": "NodeListMatcher",
			"description": "The NodeListMatcher instance to use to make the query."
		},
		{
			"directive": "param",
			"text": "node_id\t\tnumber\t\t\t\tThe numerical id of the node to check.",
			"name": "node_id",
			"type": "number",
			"description": "The numerical id of the node to check."
		},
		{
			"directive": "param",
			"text": "group_name\tstring\t\t\t\tThe name of the group to check if the given node id has.",
			"name": "group_name",
			"type": "string",
			"description": "The name of the group to check if the given node id has."
		},
		{
			"directive": "returns",
			"text": "bool\t\tTrue if the given node id belongs to the specified group, and false if it does not.",
			"type": "bool",
			"description": "True if the given node id belongs to the specified group, and false if it does not."
		}
	],
	"line": 99,
	"namespace": "worldeditadditions_core.NodeListMatcher",
	"line_last": 105,
	"name": "match_group",
	"instanced": false,
	"args": [
		"matcher",
		"node_id",
		"group_name"
	],
	"text": "--- Determines if the given node id has the given group name.\n-- Caches the result for performance. You probably want NodeListMatcher:match_id(node_id).\n-- @param\tmatcher\t\tNodeListMatcher\t\tThe NodeListMatcher instance to use to make the query.\n-- @param\tnode_id\t\tnumber\t\t\t\tThe numerical id of the node to check.\n-- @param\tgroup_name\tstring\t\t\t\tThe name of the group to check if the given node id has.\n-- @returns\tbool\t\tTrue if the given node id belongs to the specified group, and false if it does not.\nfunction NodeListMatcher.match_group(matcher, node_id, group_name)",
	"params": [
		{
			"directive": "param",
			"text": "matcher\t\tNodeListMatcher\t\tThe NodeListMatcher instance to use to make the query.",
			"name": "matcher",
			"type": "NodeListMatcher",
			"description": "The NodeListMatcher instance to use to make the query."
		},
		{
			"directive": "param",
			"text": "node_id\t\tnumber\t\t\t\tThe numerical id of the node to check.",
			"name": "node_id",
			"type": "number",
			"description": "The numerical id of the node to check."
		},
		{
			"directive": "param",
			"text": "group_name\tstring\t\t\t\tThe name of the group to check if the given node id has.",
			"name": "group_name",
			"type": "string",
			"description": "The name of the group to check if the given node id has."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\tTrue if the given node id belongs to the specified group, and false if it does not.",
		"type": "bool",
		"description": "True if the given node id belongs to the specified group, and false if it does not."
	},
	"name_full": "worldeditadditions_core.NodeListMatcher.match_group",
	"filename": "worldeditadditions_core/utils/NodeListMatcher.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/NodeListMatcher.lua#L100-L106"
}

match_id 🔗

Matches the given node id against the nodelist provided at the instantiation of this NodeListMatcher instance. Returns true if the given node_id matches against any one of the items in the nodelist. In other words, performs a logical OR operation.

We use the term 'item' and not 'node' here since not all items in the nodelist are nodes: nodelists support special keywords such as 'liquidlike' and 'airlike', as well as group names (prefixed with an at sign @).

Arguments

NameTypeDefault valueDescription
matcherNodeListMatchernil

The NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there).

node_idnumbernil

The numerical id of the node to match against the internal nodelist.

Returns

bool :

True if the given node id matches against any of the items in the nodelist.

Source
--- Matches the given node id against the nodelist provided at the instantiation of this NodeListMatcher instance.
-- Returns true if the given node_id matches against any one of the items in the nodelist. In other words, performs a logical OR operation.
-- 
-- We use the term 'item' and not 'node' here since not all items in the nodelist are nodes: nodelists support special keywords such as 'liquidlike' and 'airlike', as well as group names (prefixed with an at sign @).
-- @param	matcher		NodeListMatcher		The NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there).
-- @param	node_id		number				The numerical id of the node to match against the internal nodelist.
-- @returns	bool		True if the given node id matches against any of the items in the nodelist.
function NodeListMatcher.match_id(matcher, node_id)
{
	"type": "function",
	"internal": false,
	"description": "Matches the given node id against the nodelist provided at the instantiation of this NodeListMatcher instance.\nReturns true if the given node_id matches against any one of the items in the nodelist. In other words, performs a logical OR operation.\n\nWe use the term 'item' and not 'node' here since not all items in the nodelist are nodes: nodelists support special keywords such as 'liquidlike' and 'airlike', as well as group names (prefixed with an at sign @).",
	"directives": [
		{
			"directive": "param",
			"text": "matcher\t\tNodeListMatcher\t\tThe NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there).",
			"name": "matcher",
			"type": "NodeListMatcher",
			"description": "The NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there)."
		},
		{
			"directive": "param",
			"text": "node_id\t\tnumber\t\t\t\tThe numerical id of the node to match against the internal nodelist.",
			"name": "node_id",
			"type": "number",
			"description": "The numerical id of the node to match against the internal nodelist."
		},
		{
			"directive": "returns",
			"text": "bool\t\tTrue if the given node id matches against any of the items in the nodelist.",
			"type": "bool",
			"description": "True if the given node id matches against any of the items in the nodelist."
		}
	],
	"line": 73,
	"namespace": "worldeditadditions_core.NodeListMatcher",
	"line_last": 80,
	"name": "match_id",
	"instanced": false,
	"args": [
		"matcher",
		"node_id"
	],
	"text": "--- Matches the given node id against the nodelist provided at the instantiation of this NodeListMatcher instance.\n-- Returns true if the given node_id matches against any one of the items in the nodelist. In other words, performs a logical OR operation.\n-- \n-- We use the term 'item' and not 'node' here since not all items in the nodelist are nodes: nodelists support special keywords such as 'liquidlike' and 'airlike', as well as group names (prefixed with an at sign @).\n-- @param\tmatcher\t\tNodeListMatcher\t\tThe NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there).\n-- @param\tnode_id\t\tnumber\t\t\t\tThe numerical id of the node to match against the internal nodelist.\n-- @returns\tbool\t\tTrue if the given node id matches against any of the items in the nodelist.\nfunction NodeListMatcher.match_id(matcher, node_id)",
	"params": [
		{
			"directive": "param",
			"text": "matcher\t\tNodeListMatcher\t\tThe NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there).",
			"name": "matcher",
			"type": "NodeListMatcher",
			"description": "The NodeListMatcher instance to query against. Use some_matcher:match_id(node_id) to avoid specifying this manually (note the colon : and not a dot . there)."
		},
		{
			"directive": "param",
			"text": "node_id\t\tnumber\t\t\t\tThe numerical id of the node to match against the internal nodelist.",
			"name": "node_id",
			"type": "number",
			"description": "The numerical id of the node to match against the internal nodelist."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\tTrue if the given node id matches against any of the items in the nodelist.",
		"type": "bool",
		"description": "True if the given node id matches against any of the items in the nodelist."
	},
	"name_full": "worldeditadditions_core.NodeListMatcher.match_id",
	"filename": "worldeditadditions_core/utils/NodeListMatcher.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/NodeListMatcher.lua#L74-L81"
}

new 🔗

Creates a new NodeListMatcher instance with the given node list. Once created, you probably want to call the :match_id(node_id) function.

Arguments

NameTypeDefault valueDescription
nodeliststring[]nil

The list of nodes to match against.

airlike and liquidlike are special keywords that instead check if a given node id behaves like air or a liquid respectively.

Node names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group.

Returns

bool,string|NodeListMatcher :

A success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance.

Source
--- Creates a new NodeListMatcher instance with the given node list.
-- Once created, you probably want to call the :match_id(node_id) function.
-- @param	nodelist	string[]	The list of nodes to match against.
-- 
-- `airlike` and `liquidlike` are special keywords that instead check if a given node id behaves like air or a liquid respectively.
-- 
-- Node names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group.
-- @returns	bool,string|NodeListMatcher			A success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance.
function NodeListMatcher.new(nodelist)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new NodeListMatcher instance with the given node list.\nOnce created, you probably want to call the :match_id(node_id) function.",
	"directives": [
		{
			"directive": "param",
			"text": "nodelist\tstring[]\tThe list of nodes to match against.\n\n`airlike` and `liquidlike` are special keywords that instead check if a given node id behaves like air or a liquid respectively.\n\nNode names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group.",
			"name": "nodelist",
			"type": "string[]",
			"description": "The list of nodes to match against.\n\n`airlike` and `liquidlike` are special keywords that instead check if a given node id behaves like air or a liquid respectively.\n\nNode names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group."
		},
		{
			"directive": "returns",
			"text": "bool,string|NodeListMatcher\t\t\tA success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance.",
			"type": "bool,string|NodeListMatcher",
			"description": "A success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance."
		}
	],
	"line": 51,
	"namespace": "worldeditadditions_core.NodeListMatcher",
	"line_last": 59,
	"name": "new",
	"instanced": false,
	"args": [
		"nodelist"
	],
	"text": "--- Creates a new NodeListMatcher instance with the given node list.\n-- Once created, you probably want to call the :match_id(node_id) function.\n-- @param\tnodelist\tstring[]\tThe list of nodes to match against.\n-- \n-- `airlike` and `liquidlike` are special keywords that instead check if a given node id behaves like air or a liquid respectively.\n-- \n-- Node names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group.\n-- @returns\tbool,string|NodeListMatcher\t\t\tA success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance.\nfunction NodeListMatcher.new(nodelist)",
	"params": [
		{
			"directive": "param",
			"text": "nodelist\tstring[]\tThe list of nodes to match against.\n\n`airlike` and `liquidlike` are special keywords that instead check if a given node id behaves like air or a liquid respectively.\n\nNode names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group.",
			"name": "nodelist",
			"type": "string[]",
			"description": "The list of nodes to match against.\n\n`airlike` and `liquidlike` are special keywords that instead check if a given node id behaves like air or a liquid respectively.\n\nNode names prefixed with an at sign (@) are considered group names, and given node ids are checked for membership of the given group."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string|NodeListMatcher\t\t\tA success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance.",
		"type": "bool,string|NodeListMatcher",
		"description": "A success bool (true == success), and then either a string (if succes == false) or otherwise the newly created NodeListMatcher instance."
	},
	"name_full": "worldeditadditions_core.NodeListMatcher.new",
	"filename": "worldeditadditions_core/utils/NodeListMatcher.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/NodeListMatcher.lua#L52-L60"
}

param2 🔗

Functions

orient 🔗

Rotates the given param2 value of the given type by the given COMPILED list of rotations. In other words, reorients a given param2 value of a given param2_type (aka paramtype2 in the Minetest engine but the Minetest engine naming scheme is dumb in this case) according to a given COMPILED rotation list.

Arguments

NameTypeDefault valueDescription
param2numbernil

The param2 value to rotate.

param2_typestringnil

The type of param2 value we're talking about here. Currently, only a value of facedir is supported.

rotlist_cVector3[]nil

The list of vector rotations to apply to param2. Call worldeditadditions_core.rotation.rotlist_compile on a rotation list to get this value. Each one is iteratively applied using the rotate argument to Vector3.rotate3d.

Returns

number? :

Returns the rotated param2 value, or nil if an invalid param2_type value was passed.

Source
--- Rotates the given param2 value of the given type by the given COMPILED list of rotations.
-- In other words, reorients a given param2 value of a given param2_type (aka paramtype2 in the Minetest engine but the Minetest engine naming scheme is dumb in this case) according to a given COMPILED rotation list. 
-- @param	param2		number		The param2 value to rotate.
-- @param	param2_type	string		The type of param2 value we're talking about here. Currently, only a value of `facedir` is supported.
-- @param	rotlist_c	Vector3[]	The list of vector rotations to apply to param2. Call `worldeditadditions_core.rotation.rotlist_compile` on a rotation list to get this value. Each one is iteratively applied using the `rotate` argument to Vector3.rotate3d.
-- @returns	number?		Returns the rotated param2 value, or nil if an invalid param2_type value was passed.
local function orient(param2, param2_type, rotlist_c)
{
	"type": "function",
	"internal": false,
	"description": "Rotates the given param2 value of the given type by the given COMPILED list of rotations.\nIn other words, reorients a given param2 value of a given param2_type (aka paramtype2 in the Minetest engine but the Minetest engine naming scheme is dumb in this case) according to a given COMPILED rotation list.",
	"directives": [
		{
			"directive": "param",
			"text": "param2\t\tnumber\t\tThe param2 value to rotate.",
			"name": "param2",
			"type": "number",
			"description": "The param2 value to rotate."
		},
		{
			"directive": "param",
			"text": "param2_type\tstring\t\tThe type of param2 value we're talking about here. Currently, only a value of `facedir` is supported.",
			"name": "param2_type",
			"type": "string",
			"description": "The type of param2 value we're talking about here. Currently, only a value of `facedir` is supported."
		},
		{
			"directive": "param",
			"text": "rotlist_c\tVector3[]\tThe list of vector rotations to apply to param2. Call `worldeditadditions_core.rotation.rotlist_compile` on a rotation list to get this value. Each one is iteratively applied using the `rotate` argument to Vector3.rotate3d.",
			"name": "rotlist_c",
			"type": "Vector3[]",
			"description": "The list of vector rotations to apply to param2. Call `worldeditadditions_core.rotation.rotlist_compile` on a rotation list to get this value. Each one is iteratively applied using the `rotate` argument to Vector3.rotate3d."
		},
		{
			"directive": "returns",
			"text": "number?\t\tReturns the rotated param2 value, or nil if an invalid param2_type value was passed.",
			"type": "number?",
			"description": "Returns the rotated param2 value, or nil if an invalid param2_type value was passed."
		}
	],
	"line": 30,
	"namespace": "worldeditadditions_core.param2",
	"line_last": 36,
	"name": "orient",
	"instanced": false,
	"args": [
		"param2",
		"param2_type",
		"rotlist_c"
	],
	"text": "--- Rotates the given param2 value of the given type by the given COMPILED list of rotations.\n-- In other words, reorients a given param2 value of a given param2_type (aka paramtype2 in the Minetest engine but the Minetest engine naming scheme is dumb in this case) according to a given COMPILED rotation list. \n-- @param\tparam2\t\tnumber\t\tThe param2 value to rotate.\n-- @param\tparam2_type\tstring\t\tThe type of param2 value we're talking about here. Currently, only a value of `facedir` is supported.\n-- @param\trotlist_c\tVector3[]\tThe list of vector rotations to apply to param2. Call `worldeditadditions_core.rotation.rotlist_compile` on a rotation list to get this value. Each one is iteratively applied using the `rotate` argument to Vector3.rotate3d.\n-- @returns\tnumber?\t\tReturns the rotated param2 value, or nil if an invalid param2_type value was passed.\nlocal function orient(param2, param2_type, rotlist_c)",
	"params": [
		{
			"directive": "param",
			"text": "param2\t\tnumber\t\tThe param2 value to rotate.",
			"name": "param2",
			"type": "number",
			"description": "The param2 value to rotate."
		},
		{
			"directive": "param",
			"text": "param2_type\tstring\t\tThe type of param2 value we're talking about here. Currently, only a value of `facedir` is supported.",
			"name": "param2_type",
			"type": "string",
			"description": "The type of param2 value we're talking about here. Currently, only a value of `facedir` is supported."
		},
		{
			"directive": "param",
			"text": "rotlist_c\tVector3[]\tThe list of vector rotations to apply to param2. Call `worldeditadditions_core.rotation.rotlist_compile` on a rotation list to get this value. Each one is iteratively applied using the `rotate` argument to Vector3.rotate3d.",
			"name": "rotlist_c",
			"type": "Vector3[]",
			"description": "The list of vector rotations to apply to param2. Call `worldeditadditions_core.rotation.rotlist_compile` on a rotation list to get this value. Each one is iteratively applied using the `rotate` argument to Vector3.rotate3d."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number?\t\tReturns the rotated param2 value, or nil if an invalid param2_type value was passed.",
		"type": "number?",
		"description": "Returns the rotated param2 value, or nil if an invalid param2_type value was passed."
	},
	"name_full": "worldeditadditions_core.param2.orient",
	"filename": "worldeditadditions_core/utils/param2.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/param2.lua#L31-L37"
}

parse 🔗

Functions for parsing things.


file 🔗

Parsers specifically for file formats.


weaschem 🔗

Library for parsing .weaschem WorldEditAdditions Schematic files.

Most of these functions return 3 values rather than the usual 2. This might seem overcomplicated, but it enables a higher level of validation in automated testing. These 3 return values take the following form:

  1. bool: A success/failure bool. true means success, and false, means failure.
  2. string: The error code. "SUCCESS" if #1 (the bool) is true. Otherwise set to a code to indicate exactly which error ocurred.
  3. any|string: EITHER the expected return value, OR a string with a human-readable error message if bool=false.

Functions

parse 🔗

Parses the WorldEditAdditions schematic file from the given handle. This requires a file handle, as significant optimisations can be made in the case of invalid files.

Arguments

NameTypeDefault valueDescription
handleFilenil

A Lua file handle to read from.

[delta_whichstringboth]

If the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).

Returns

bool,string,table|string :

  1. Success bool (true == success)
  2. Error code. "SUCCESS" is passed if the operation was successful.
  3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.

Source
--- Parses the WorldEditAdditions schematic file from the given handle.
-- This requires a file handle, as significant optimisations can be made in the case of invalid files.
-- @param	handle		File	A Lua file handle to read from.
-- @param	[delta_which=both]	string	If the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).
-- @returns	bool,string,table|string	1. Success bool (`true` == success)
-- 2. Error code. "SUCCESS" is passed if the operation was successful.
-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.
function weaschem.parse(handle, delta_which)
{
	"type": "function",
	"internal": false,
	"description": "Parses the WorldEditAdditions schematic file from the given handle.\nThis requires a file handle, as significant optimisations can be made in the case of invalid files.",
	"directives": [
		{
			"directive": "param",
			"text": "handle\t\tFile\tA Lua file handle to read from.",
			"name": "handle",
			"type": "File",
			"description": "A Lua file handle to read from."
		},
		{
			"directive": "param",
			"text": "[delta_which=both]\tstring\tIf the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).",
			"name": "[delta_which",
			"type": "string",
			"description": "If the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).",
			"default_value": "both]"
		},
		{
			"directive": "returns",
			"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
			"type": "bool,string,table|string",
			"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
		}
	],
	"line": 222,
	"namespace": "worldeditadditions_core.parse.file.weaschem",
	"line_last": 229,
	"name": "parse",
	"instanced": false,
	"args": [
		"handle",
		"delta_which"
	],
	"text": "--- Parses the WorldEditAdditions schematic file from the given handle.\n-- This requires a file handle, as significant optimisations can be made in the case of invalid files.\n-- @param\thandle\t\tFile\tA Lua file handle to read from.\n-- @param\t[delta_which=both]\tstring\tIf the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).\n-- @returns\tbool,string,table|string\t1. Success bool (`true` == success)\n-- 2. Error code. \"SUCCESS\" is passed if the operation was successful.\n-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.\nfunction weaschem.parse(handle, delta_which)",
	"params": [
		{
			"directive": "param",
			"text": "handle\t\tFile\tA Lua file handle to read from.",
			"name": "handle",
			"type": "File",
			"description": "A Lua file handle to read from."
		},
		{
			"directive": "param",
			"text": "[delta_which=both]\tstring\tIf the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).",
			"name": "[delta_which",
			"type": "string",
			"description": "If the schematic file is of type delta (i.e. as opposed to full), then this indicates which state is desired. Useful to significantly optimise both CPU and memory usage by avoiding parsing more than necessary if only one state is desired. Possible values: both (default; read both the previous and current states), prev (read only the previous state), current (read only the current state).",
			"default_value": "both]"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
		"type": "bool,string,table|string",
		"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
	},
	"name_full": "worldeditadditions_core.parse.file.weaschem.parse",
	"filename": "worldeditadditions_core/utils/parse/file/weaschem.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/file/weaschem.lua#L223-L230"
}

parse_data_table 🔗

Parses a data table string into a Lua table.

Arguments

NameTypeDefault valueDescription
sourcestringnil

The source string to parse.

is_deltaboolnil

Whether the provided data table is of type delta or not. Used for validation.

Returns

bool,string,table|string :

  1. Success bool (true == success)
  2. Error code. "SUCCESS" is passed if the operation was successful.
  3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.

Source
--- Parses a data table string into a Lua table.
-- @internal
-- @param	source		string	The source string to parse.
-- @param	is_delta	bool	Whether the provided data table is of type delta or not. Used for validation.
-- @returns	bool,string,table|string	1. Success bool (`true` == success)
-- 2. Error code. "SUCCESS" is passed if the operation was successful.
-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.
function weaschem.parse_data_table(source, is_delta)
{
	"type": "function",
	"internal": true,
	"description": "Parses a data table string into a Lua table.",
	"directives": [
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "source\t\tstring\tThe source string to parse.",
			"name": "source",
			"type": "string",
			"description": "The source string to parse."
		},
		{
			"directive": "param",
			"text": "is_delta\tbool\tWhether the provided data table is of type delta or not. Used for validation.",
			"name": "is_delta",
			"type": "bool",
			"description": "Whether the provided data table is of type delta or not. Used for validation."
		},
		{
			"directive": "returns",
			"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
			"type": "bool,string,table|string",
			"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
		}
	],
	"line": 159,
	"namespace": "worldeditadditions_core.parse.file.weaschem",
	"line_last": 166,
	"name": "parse_data_table",
	"instanced": false,
	"args": [
		"source",
		"is_delta"
	],
	"text": "--- Parses a data table string into a Lua table.\n-- @internal\n-- @param\tsource\t\tstring\tThe source string to parse.\n-- @param\tis_delta\tbool\tWhether the provided data table is of type delta or not. Used for validation.\n-- @returns\tbool,string,table|string\t1. Success bool (`true` == success)\n-- 2. Error code. \"SUCCESS\" is passed if the operation was successful.\n-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.\nfunction weaschem.parse_data_table(source, is_delta)",
	"params": [
		{
			"directive": "param",
			"text": "source\t\tstring\tThe source string to parse.",
			"name": "source",
			"type": "string",
			"description": "The source string to parse."
		},
		{
			"directive": "param",
			"text": "is_delta\tbool\tWhether the provided data table is of type delta or not. Used for validation.",
			"name": "is_delta",
			"type": "bool",
			"description": "Whether the provided data table is of type delta or not. Used for validation."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
		"type": "bool,string,table|string",
		"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
	},
	"name_full": "worldeditadditions_core.parse.file.weaschem.parse_data_table",
	"filename": "worldeditadditions_core/utils/parse/file/weaschem.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/file/weaschem.lua#L160-L167"
}

parse_header 🔗

Parses the header out of the given source string.

Arguments

NameTypeDefault valueDescription
sourcestringnil

The source string to parse.

Returns

bool,string,table|string :

  1. Success bool (true == success)
  2. Error code. "SUCCESS" is passed if the operation was successful.
  3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.

Source
--- Parses the header out of the given source string.
-- @param	source		string	The source string to parse.
-- @returns	bool,string,table|string	1. Success bool (`true` == success)
-- 2. Error code. "SUCCESS" is passed if the operation was successful.
-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.
function weaschem.parse_header(source)
{
	"type": "function",
	"internal": false,
	"description": "Parses the header out of the given source string.",
	"directives": [
		{
			"directive": "param",
			"text": "source\t\tstring\tThe source string to parse.",
			"name": "source",
			"type": "string",
			"description": "The source string to parse."
		},
		{
			"directive": "returns",
			"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
			"type": "bool,string,table|string",
			"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
		}
	],
	"line": 48,
	"namespace": "worldeditadditions_core.parse.file.weaschem",
	"line_last": 53,
	"name": "parse_header",
	"instanced": false,
	"args": [
		"source"
	],
	"text": "--- Parses the header out of the given source string.\n-- @param\tsource\t\tstring\tThe source string to parse.\n-- @returns\tbool,string,table|string\t1. Success bool (`true` == success)\n-- 2. Error code. \"SUCCESS\" is passed if the operation was successful.\n-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.\nfunction weaschem.parse_header(source)",
	"params": [
		{
			"directive": "param",
			"text": "source\t\tstring\tThe source string to parse.",
			"name": "source",
			"type": "string",
			"description": "The source string to parse."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
		"type": "bool,string,table|string",
		"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
	},
	"name_full": "worldeditadditions_core.parse.file.weaschem.parse_header",
	"filename": "worldeditadditions_core/utils/parse/file/weaschem.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/file/weaschem.lua#L49-L54"
}

parse_id_map 🔗

Parses the ID map out of the given source string.

Arguments

NameTypeDefault valueDescription
sourcestringnil

The source string to parse.

Returns

bool,string,table|string :

  1. Success bool (true == success)
  2. Error code. "SUCCESS" is passed if the operation was successful.
  3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.

Source
--- Parses the ID map out of the given source string.
-- @param	source		string	The source string to parse.
-- @returns	bool,string,table|string	1. Success bool (`true` == success)
-- 2. Error code. "SUCCESS" is passed if the operation was successful.
-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.
function weaschem.parse_id_map(source)
{
	"type": "function",
	"internal": false,
	"description": "Parses the ID map out of the given source string.",
	"directives": [
		{
			"directive": "param",
			"text": "source\t\tstring\tThe source string to parse.",
			"name": "source",
			"type": "string",
			"description": "The source string to parse."
		},
		{
			"directive": "returns",
			"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
			"type": "bool,string,table|string",
			"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
		}
	],
	"line": 124,
	"namespace": "worldeditadditions_core.parse.file.weaschem",
	"line_last": 129,
	"name": "parse_id_map",
	"instanced": false,
	"args": [
		"source"
	],
	"text": "--- Parses the ID map out of the given source string.\n-- @param\tsource\t\tstring\tThe source string to parse.\n-- @returns\tbool,string,table|string\t1. Success bool (`true` == success)\n-- 2. Error code. \"SUCCESS\" is passed if the operation was successful.\n-- 3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.\nfunction weaschem.parse_id_map(source)",
	"params": [
		{
			"directive": "param",
			"text": "source\t\tstring\tThe source string to parse.",
			"name": "source",
			"type": "string",
			"description": "The source string to parse."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string,table|string\t1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not.",
		"type": "bool,string,table|string",
		"description": "1. Success bool (`true` == success)\n2. Error code. \"SUCCESS\" is passed if the operation was successful.\n3. Either the resulting Lua table if parsing was successful, or an error message as a string if not."
	},
	"name_full": "worldeditadditions_core.parse.file.weaschem.parse_id_map",
	"filename": "worldeditadditions_core/utils/parse/file/weaschem.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/file/weaschem.lua#L125-L130"
}

parse_vector3 🔗

Validates and converts a raw table into a Vector3 instance.

Arguments

NameTypeDefault valueDescription
source_objtablenil

The table to convert.

Returns

bool,string,Vector3|string :

A success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string.

Source
--- Validates and converts a raw table into a Vector3 instance.
-- @param	source_obj	table	The table to convert.
-- @returns	bool,string,Vector3|string	A success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string.
function weaschem.parse_vector3(source_obj)
{
	"type": "function",
	"internal": false,
	"description": "Validates and converts a raw table into a Vector3 instance.",
	"directives": [
		{
			"directive": "param",
			"text": "source_obj\ttable\tThe table to convert.",
			"name": "source_obj",
			"type": "table",
			"description": "The table to convert."
		},
		{
			"directive": "returns",
			"text": "bool,string,Vector3|string\tA success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string.",
			"type": "bool,string,Vector3|string",
			"description": "A success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string."
		}
	],
	"line": 24,
	"namespace": "worldeditadditions_core.parse.file.weaschem",
	"line_last": 27,
	"name": "parse_vector3",
	"instanced": false,
	"args": [
		"source_obj"
	],
	"text": "--- Validates and converts a raw table into a Vector3 instance.\n-- @param\tsource_obj\ttable\tThe table to convert.\n-- @returns\tbool,string,Vector3|string\tA success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string.\nfunction weaschem.parse_vector3(source_obj)",
	"params": [
		{
			"directive": "param",
			"text": "source_obj\ttable\tThe table to convert.",
			"name": "source_obj",
			"type": "table",
			"description": "The table to convert."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,string,Vector3|string\tA success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string.",
		"type": "bool,string,Vector3|string",
		"description": "A success bool, then an error code, then finally EITHER the resulting Vector3 instance (if bool=true) OR an error message as a string."
	},
	"name_full": "worldeditadditions_core.parse.file.weaschem.parse_vector3",
	"filename": "worldeditadditions_core/utils/parse/file/weaschem.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/file/weaschem.lua#L25-L28"
}

key_instance 🔗

A container for transmitting (axis table, sign) or (dir, sign) pairs and other data within parsing functions.

Functions

parse_chance 🔗

Parses a chance value, and returns the 1-in-N value thereof.

Arguments

NameTypeDefault valueDescription
strstringnil

The string to parse.

modestringnil

The operation mode. Valid modes: "1-in-n" (default), "weight". "1-in-n" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). "weight", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood).

Returns

number|nil :

The 1-in-N chance if parsing was successful, otherwise nil.

Source
--- Parses a chance value, and returns the 1-in-N value thereof.
-- @param	str		string	The string to parse.
-- @param	mode	string	The operation mode. Valid modes: "1-in-n" (default), "weight". "1-in-n" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). "weight", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood).
-- @returns	number|nil	The 1-in-N chance if parsing was successful, otherwise nil.
local function parse_chance(str, mode)
{
	"type": "function",
	"internal": false,
	"description": "Parses a chance value, and returns the 1-in-N value thereof.",
	"directives": [
		{
			"directive": "param",
			"text": "str\t\tstring\tThe string to parse.",
			"name": "str",
			"type": "string",
			"description": "The string to parse."
		},
		{
			"directive": "param",
			"text": "mode\tstring\tThe operation mode. Valid modes: \"1-in-n\" (default), \"weight\". \"1-in-n\" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). \"weight\", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood).",
			"name": "mode",
			"type": "string",
			"description": "The operation mode. Valid modes: \"1-in-n\" (default), \"weight\". \"1-in-n\" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). \"weight\", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood)."
		},
		{
			"directive": "returns",
			"text": "number|nil\tThe 1-in-N chance if parsing was successful, otherwise nil.",
			"type": "number|nil",
			"description": "The 1-in-N chance if parsing was successful, otherwise nil."
		}
	],
	"line": 5,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 9,
	"name": "parse_chance",
	"instanced": false,
	"args": [
		"str",
		"mode"
	],
	"text": "--- Parses a chance value, and returns the 1-in-N value thereof.\n-- @param\tstr\t\tstring\tThe string to parse.\n-- @param\tmode\tstring\tThe operation mode. Valid modes: \"1-in-n\" (default), \"weight\". \"1-in-n\" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). \"weight\", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood).\n-- @returns\tnumber|nil\tThe 1-in-N chance if parsing was successful, otherwise nil.\nlocal function parse_chance(str, mode)",
	"params": [
		{
			"directive": "param",
			"text": "str\t\tstring\tThe string to parse.",
			"name": "str",
			"type": "string",
			"description": "The string to parse."
		},
		{
			"directive": "param",
			"text": "mode\tstring\tThe operation mode. Valid modes: \"1-in-n\" (default), \"weight\". \"1-in-n\" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). \"weight\", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood).",
			"name": "mode",
			"type": "string",
			"description": "The operation mode. Valid modes: \"1-in-n\" (default), \"weight\". \"1-in-n\" refers to a 1-in-N chance of something happening (lower numbers mean greater likelihood). \"weight\", on the other hand, is instead a weighting that something will happen (higher numbers mean a greater likelihood)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number|nil\tThe 1-in-N chance if parsing was successful, otherwise nil.",
		"type": "number|nil",
		"description": "The 1-in-N chance if parsing was successful, otherwise nil."
	},
	"name_full": "worldeditadditions_core.parse.parse_chance",
	"filename": "worldeditadditions_core/utils/parse/chance.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/chance.lua#L6-L10"
}

parse_map 🔗

Parses a map of key-value pairs into a table. For example, "count 25000 speed 0.8 rate_erosion 0.006 doawesome true" would be parsed into the following table: { count = 25000, speed = 0.8, rate_erosion = 0.006, doawesome = true }.

Arguments

NameTypeDefault valueDescription
params_textstringnil

The string to parse.

keywordsstring[]?nil

Optional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true.

Returns

table :

A table of key-value pairs parsed out from the given string.

Source
--- Parses a map of key-value pairs into a table.
-- For example, "count 25000 speed 0.8 rate_erosion 0.006 doawesome true" would be parsed into
-- the following table: { count = 25000, speed = 0.8, rate_erosion = 0.006, doawesome = true }.
-- @param	params_text	string		The string to parse.
-- @param	keywords	string[]?	Optional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true.
-- @returns	table		A table of key-value pairs parsed out from the given string.
local function parse_map(params_text, keywords)
{
	"type": "function",
	"internal": false,
	"description": "Parses a map of key-value pairs into a table.\nFor example, \"count 25000 speed 0.8 rate_erosion 0.006 doawesome true\" would be parsed into\nthe following table: { count = 25000, speed = 0.8, rate_erosion = 0.006, doawesome = true }.",
	"directives": [
		{
			"directive": "param",
			"text": "params_text\tstring\t\tThe string to parse.",
			"name": "params_text",
			"type": "string",
			"description": "The string to parse."
		},
		{
			"directive": "param",
			"text": "keywords\tstring[]?\tOptional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true.",
			"name": "keywords",
			"type": "string[]?",
			"description": "Optional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true."
		},
		{
			"directive": "returns",
			"text": "table\t\tA table of key-value pairs parsed out from the given string.",
			"type": "table",
			"description": "A table of key-value pairs parsed out from the given string."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 12,
	"name": "parse_map",
	"instanced": false,
	"args": [
		"params_text",
		"keywords"
	],
	"text": "--- Parses a map of key-value pairs into a table.\n-- For example, \"count 25000 speed 0.8 rate_erosion 0.006 doawesome true\" would be parsed into\n-- the following table: { count = 25000, speed = 0.8, rate_erosion = 0.006, doawesome = true }.\n-- @param\tparams_text\tstring\t\tThe string to parse.\n-- @param\tkeywords\tstring[]?\tOptional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true.\n-- @returns\ttable\t\tA table of key-value pairs parsed out from the given string.\nlocal function parse_map(params_text, keywords)",
	"params": [
		{
			"directive": "param",
			"text": "params_text\tstring\t\tThe string to parse.",
			"name": "params_text",
			"type": "string",
			"description": "The string to parse."
		},
		{
			"directive": "param",
			"text": "keywords\tstring[]?\tOptional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true.",
			"name": "keywords",
			"type": "string[]?",
			"description": "Optional. A list of keywords. Keywords can be present on their own without a value. If found, their value will be automatically set to bool true."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table\t\tA table of key-value pairs parsed out from the given string.",
		"type": "table",
		"description": "A table of key-value pairs parsed out from the given string."
	},
	"name_full": "worldeditadditions_core.parse.parse_map",
	"filename": "worldeditadditions_core/utils/parse/map.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/map.lua#L7-L13"
}

parse_seed 🔗

Makes a seed from a string. If the input is a number, it is returned as-is. If the input is a string and can be converted to a number with tonumber(), the output of tonumber() is returned. Otherwise, the string is converted to a number via a simple hashing algorithm (caution: certainlly NOT crypto-secure!).

Arguments

NameTypeDefault valueDescription
{string} str The string to convert.nil

Returns

nil

Source
--- Makes a seed from a string.
-- If the input is a number, it is returned as-is.
-- If the input is a string and can be converted to a number with tonumber(),
-- the output of tonumber() is returned.
-- Otherwise, the string is converted to a number via a simple hashing algorithm
-- (caution: certainlly NOT crypto-secure!).
-- @param   {string}    str     The string to convert.
-- @source https://stackoverflow.com/a/2624210/1460422 The idea came from here
local function parse_seed(str)
{
	"type": "function",
	"internal": false,
	"description": "Makes a seed from a string.\nIf the input is a number, it is returned as-is.\nIf the input is a string and can be converted to a number with tonumber(),\nthe output of tonumber() is returned.\nOtherwise, the string is converted to a number via a simple hashing algorithm\n(caution: certainlly NOT crypto-secure!).",
	"directives": [
		{
			"directive": "param",
			"text": "{string}    str     The string to convert.",
			"name": "{string}    str     The string to convert."
		},
		{
			"directive": "source",
			"text": "https://stackoverflow.com/a/2624210/1460422 The idea came from here"
		}
	],
	"line": 3,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 11,
	"name": "parse_seed",
	"instanced": false,
	"args": [
		"str"
	],
	"text": "--- Makes a seed from a string.\n-- If the input is a number, it is returned as-is.\n-- If the input is a string and can be converted to a number with tonumber(),\n-- the output of tonumber() is returned.\n-- Otherwise, the string is converted to a number via a simple hashing algorithm\n-- (caution: certainlly NOT crypto-secure!).\n-- @param   {string}    str     The string to convert.\n-- @source https://stackoverflow.com/a/2624210/1460422 The idea came from here\nlocal function parse_seed(str)",
	"params": [
		{
			"directive": "param",
			"text": "{string}    str     The string to convert.",
			"name": "{string}    str     The string to convert."
		}
	],
	"name_full": "worldeditadditions_core.parse.parse_seed",
	"filename": "worldeditadditions_core/utils/parse/seed.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/seed.lua#L4-L12"
}

parse_weighted_nodes 🔗

Parses a list of strings as a list of weighted nodes - e.g. like in the //mix command. Example: "dirt 5 stone sand 2".

Arguments

NameTypeDefault valueDescription
partsstring[]nil

The list of strings to parse (try worldeditadditions_core.split)

as_listboolnil

If true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array.

func_normalisecallablenil

If specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name.

Returns

table :

A table in the form node_name => weight.

Source
--- Parses a list of strings as a list of weighted nodes - e.g. like in
-- the //mix command. Example: "dirt 5 stone sand 2".
-- @param	parts	string[]	The list of strings to parse (try worldeditadditions_core.split)
-- @param	as_list	bool		If true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array.
-- @param	func_normalise	callable	If specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name.
-- @returns	table	A table in the form node_name => weight.
local function parse_weighted_nodes(parts, as_list, func_normalise)
{
	"type": "function",
	"internal": false,
	"description": "Parses a list of strings as a list of weighted nodes - e.g. like in\nthe //mix command. Example: \"dirt 5 stone sand 2\".",
	"directives": [
		{
			"directive": "param",
			"text": "parts\tstring[]\tThe list of strings to parse (try worldeditadditions_core.split)",
			"name": "parts",
			"type": "string[]",
			"description": "The list of strings to parse (try worldeditadditions_core.split)"
		},
		{
			"directive": "param",
			"text": "as_list\tbool\t\tIf true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array.",
			"name": "as_list",
			"type": "bool",
			"description": "If true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array."
		},
		{
			"directive": "param",
			"text": "func_normalise\tcallable\tIf specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name.",
			"name": "func_normalise",
			"type": "callable",
			"description": "If specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name."
		},
		{
			"directive": "returns",
			"text": "table\tA table in the form node_name => weight.",
			"type": "table",
			"description": "A table in the form node_name => weight."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 12,
	"name": "parse_weighted_nodes",
	"instanced": false,
	"args": [
		"parts",
		"as_list",
		"func_normalise"
	],
	"text": "--- Parses a list of strings as a list of weighted nodes - e.g. like in\n-- the //mix command. Example: \"dirt 5 stone sand 2\".\n-- @param\tparts\tstring[]\tThe list of strings to parse (try worldeditadditions_core.split)\n-- @param\tas_list\tbool\t\tIf true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array.\n-- @param\tfunc_normalise\tcallable\tIf specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name.\n-- @returns\ttable\tA table in the form node_name => weight.\nlocal function parse_weighted_nodes(parts, as_list, func_normalise)",
	"params": [
		{
			"directive": "param",
			"text": "parts\tstring[]\tThe list of strings to parse (try worldeditadditions_core.split)",
			"name": "parts",
			"type": "string[]",
			"description": "The list of strings to parse (try worldeditadditions_core.split)"
		},
		{
			"directive": "param",
			"text": "as_list\tbool\t\tIf true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array.",
			"name": "as_list",
			"type": "bool",
			"description": "If true, then table.insert() successive { node = string, weight = number } subtables when parsing instead of populating as an associative array."
		},
		{
			"directive": "param",
			"text": "func_normalise\tcallable\tIf specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name.",
			"name": "func_normalise",
			"type": "callable",
			"description": "If specified, the given function will be used to normalise node names instead of worldedit.normalize_nodename. A single argument is passed containing the un-normalised node name, and the return value is assumed to be the normalised node name."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table\tA table in the form node_name => weight.",
		"type": "table",
		"description": "A table in the form node_name => weight."
	},
	"name_full": "worldeditadditions_core.parse.parse_weighted_nodes",
	"filename": "worldeditadditions_core/utils/parse/weighted_nodes.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/weighted_nodes.lua#L7-L13"
}

parse.tokenise_commands 🔗

Tokenises a string of multiple commands into an array of individual commands. Preserves the forward slash at the beginning of each command name. Also supports arbitrarily nested and complex curly braces { } for grouping commands together that would normally be split apart.

Simple example: INPUT: //1 //2 //outset 25 //fixlight OUTPUT: { "//1", "//2", "//outset 25", "//fixlight" }

Example with curly braces: INPUT: //1 //2 //outset 50 {//many 5 //multi //fixlight //clearcut} OUTPUT: { "//1", "//2", "//outset 50", "//many 5 //multi //fixlight //clearcut"}

Arguments

NameTypeDefault valueDescription
command_strstrnil

The command string to operate on.

Returns

bool,(string[]|string) :

If the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead.

Source
--- Tokenises a string of multiple commands into an array of individual commands.
-- Preserves the forward slash at the beginning of each command name.
-- Also supports arbitrarily nested and complex curly braces { } for grouping
-- commands together that would normally be split apart.
-- 
-- Simple example:
-- INPUT: //1 //2 //outset 25 //fixlight
-- OUTPUT: { "//1", "//2", "//outset 25", "//fixlight" }
-- 
-- Example with curly braces:
-- INPUT: //1 //2 //outset 50 {//many 5 //multi //fixlight //clearcut}
-- OUTPUT: { "//1", "//2", "//outset 50", "//many 5 //multi //fixlight //clearcut"}
-- 
-- @param	command_str		str		The command string to operate on.
-- @returns	bool,(string[]|string)	If the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead.
function worldeditadditions_core.parse.tokenise_commands(command_str)
{
	"type": "function",
	"internal": false,
	"description": "Tokenises a string of multiple commands into an array of individual commands.\nPreserves the forward slash at the beginning of each command name.\nAlso supports arbitrarily nested and complex curly braces { } for grouping\ncommands together that would normally be split apart.\n\nSimple example:\nINPUT: //1 //2 //outset 25 //fixlight\nOUTPUT: { \"//1\", \"//2\", \"//outset 25\", \"//fixlight\" }\n\nExample with curly braces:\nINPUT: //1 //2 //outset 50 {//many 5 //multi //fixlight //clearcut}\nOUTPUT: { \"//1\", \"//2\", \"//outset 50\", \"//many 5 //multi //fixlight //clearcut\"}\n",
	"directives": [
		{
			"directive": "param",
			"text": "command_str\t\tstr\t\tThe command string to operate on.",
			"name": "command_str",
			"type": "str",
			"description": "The command string to operate on."
		},
		{
			"directive": "returns",
			"text": "bool,(string[]|string)\tIf the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead.",
			"type": "bool,(string[]|string)",
			"description": "If the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead."
		}
	],
	"line": 91,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 106,
	"name": "parse.tokenise_commands",
	"instanced": false,
	"args": [
		"command_str"
	],
	"text": "--- Tokenises a string of multiple commands into an array of individual commands.\n-- Preserves the forward slash at the beginning of each command name.\n-- Also supports arbitrarily nested and complex curly braces { } for grouping\n-- commands together that would normally be split apart.\n-- \n-- Simple example:\n-- INPUT: //1 //2 //outset 25 //fixlight\n-- OUTPUT: { \"//1\", \"//2\", \"//outset 25\", \"//fixlight\" }\n-- \n-- Example with curly braces:\n-- INPUT: //1 //2 //outset 50 {//many 5 //multi //fixlight //clearcut}\n-- OUTPUT: { \"//1\", \"//2\", \"//outset 50\", \"//many 5 //multi //fixlight //clearcut\"}\n-- \n-- @param\tcommand_str\t\tstr\t\tThe command string to operate on.\n-- @returns\tbool,(string[]|string)\tIf the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead.\nfunction worldeditadditions_core.parse.tokenise_commands(command_str)",
	"params": [
		{
			"directive": "param",
			"text": "command_str\t\tstr\t\tThe command string to operate on.",
			"name": "command_str",
			"type": "str",
			"description": "The command string to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool,(string[]|string)\tIf the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead.",
		"type": "bool,(string[]|string)",
		"description": "If the operation was successful, then true followed by a table of strings is returned. If the operation was not successful, then false followed by an error message (as a single string) is returned instead."
	},
	"name_full": "worldeditadditions_core.parse.parse.tokenise_commands",
	"filename": "worldeditadditions_core/utils/parse/tokenise_commands.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/tokenise_commands.lua#L92-L107"
}

recombine 🔗

Recombines a list of tokens into a list of commands.

Arguments

NameTypeDefault valueDescription
parts string[] The tokens from tokenise(str).nil

Returns

string[] :

The tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)

Source
--- Recombines a list of tokens into a list of commands.
-- @param   parts   string[]    The tokens from tokenise(str).
-- @returns         string[]	The tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)
local function recombine(parts)
{
	"type": "function",
	"internal": false,
	"description": "Recombines a list of tokens into a list of commands.",
	"directives": [
		{
			"directive": "param",
			"text": "parts   string[]    The tokens from tokenise(str).",
			"name": "parts   string[]    The tokens from tokenise(str)."
		},
		{
			"directive": "returns",
			"text": "string[]\tThe tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)",
			"type": "string[]",
			"description": "The tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)"
		}
	],
	"line": 72,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 75,
	"name": "recombine",
	"instanced": false,
	"args": [
		"parts"
	],
	"text": "--- Recombines a list of tokens into a list of commands.\n-- @param   parts   string[]    The tokens from tokenise(str).\n-- @returns         string[]\tThe tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)\nlocal function recombine(parts)",
	"params": [
		{
			"directive": "param",
			"text": "parts   string[]    The tokens from tokenise(str).",
			"name": "parts   string[]    The tokens from tokenise(str)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string[]\tThe tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)",
		"type": "string[]",
		"description": "The tokens, but run through trim() & grouped into commands (1 element in the list = 1 command)"
	},
	"name_full": "worldeditadditions_core.parse.recombine",
	"filename": "worldeditadditions_core/utils/parse/tokenise_commands.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/tokenise_commands.lua#L73-L76"
}

tokenise 🔗

The main tokeniser. Splits the input string up into space separated tokens, except when said spaces are inside { curly braces }. Note that the outermost set of curly braces are stripped.

Arguments

NameTypeDefault valueDescription
str string The input string to tokenise.nil

Returns

string[] A list of tokens

Source
--- The main tokeniser. Splits the input string up into space separated tokens, except when said spaces are inside { curly braces }.
-- Note that the outermost set of curly braces are stripped.
-- @param   str     string  The input string to tokenise.
-- @returns string[]        A list of tokens
local function tokenise(str)
{
	"type": "function",
	"internal": false,
	"description": "The main tokeniser. Splits the input string up into space separated tokens, except when said spaces are inside { curly braces }.\nNote that the outermost set of curly braces are stripped.",
	"directives": [
		{
			"directive": "param",
			"text": "str     string  The input string to tokenise.",
			"name": "str     string  The input string to tokenise."
		},
		{
			"directive": "returns",
			"text": "string[]        A list of tokens",
			"type": "string[]        A list of tokens"
		}
	],
	"line": 9,
	"namespace": "worldeditadditions_core.parse",
	"line_last": 13,
	"name": "tokenise",
	"instanced": false,
	"args": [
		"str"
	],
	"text": "--- The main tokeniser. Splits the input string up into space separated tokens, except when said spaces are inside { curly braces }.\n-- Note that the outermost set of curly braces are stripped.\n-- @param   str     string  The input string to tokenise.\n-- @returns string[]        A list of tokens\nlocal function tokenise(str)",
	"params": [
		{
			"directive": "param",
			"text": "str     string  The input string to tokenise.",
			"name": "str     string  The input string to tokenise."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string[]        A list of tokens",
		"type": "string[]        A list of tokens"
	},
	"name_full": "worldeditadditions_core.parse.tokenise",
	"filename": "worldeditadditions_core/utils/parse/tokenise_commands.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/parse/tokenise_commands.lua#L10-L14"
}

pos 🔗

Position manager.

Functions

clear 🔗

Clears all the positions for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to clear the positions for.

Returns

void

Source
--- Clears all the positions for the given player.
-- @param	player_name		string	The name of the player to clear the positions for.
-- @returns	void
local function clear(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Clears all the positions for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to clear the positions for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to clear the positions for."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 235,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 238,
	"name": "clear",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Clears all the positions for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to clear the positions for.\n-- @returns\tvoid\nlocal function clear(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to clear the positions for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to clear the positions for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions_core.pos.clear",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L236-L239"
}

compat_worldedit_get 🔗

Fetches pos1/pos2 from WorldEdit (if available) and sets them in WorldEditAdditions' postional subsystem

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to sync the positions for.

Returns

nil

Source
--- Fetches pos1/pos2 from WorldEdit (if available) and sets them in WorldEditAdditions' postional subsystem
-- @param	player_name		string	The name of the player to sync the positions for.
local function compat_worldedit_get(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Fetches pos1/pos2 from WorldEdit (if available) and sets them in WorldEditAdditions' postional subsystem",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to sync the positions for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to sync the positions for."
		}
	],
	"line": 107,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 109,
	"name": "compat_worldedit_get",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Fetches pos1/pos2 from WorldEdit (if available) and sets them in WorldEditAdditions' postional subsystem\n-- @param\tplayer_name\t\tstring\tThe name of the player to sync the positions for.\nlocal function compat_worldedit_get(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to sync the positions for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to sync the positions for."
		}
	],
	"name_full": "worldeditadditions_core.pos.compat_worldedit_get",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L108-L110"
}

compat_worldedit_pos1_get 🔗

Transparently fetches from worldedit pos1 for compatibility. Called whenever pos1 is accessed in this API.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

Returns

void

Source
--- Transparently fetches from worldedit pos1 for compatibility.
-- Called whenever pos1 is accessed in this API.
-- @internal
-- @param	player_name		string	The name of the player to fetch the position for.
-- @returns	void
local function compat_worldedit_pos1_get(player_name)
{
	"type": "function",
	"internal": true,
	"description": "Transparently fetches from worldedit pos1 for compatibility.\nCalled whenever pos1 is accessed in this API.",
	"directives": [
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 52,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 57,
	"name": "compat_worldedit_pos1_get",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Transparently fetches from worldedit pos1 for compatibility.\n-- Called whenever pos1 is accessed in this API.\n-- @internal\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @returns\tvoid\nlocal function compat_worldedit_pos1_get(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions_core.pos.compat_worldedit_pos1_get",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L53-L58"
}

compat_worldedit_pos2_get 🔗

Transparently fetches from worldedit pos2 for compatibility. Called whenever pos2 is accessed in this API.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

Returns

void

Source
--- Transparently fetches from worldedit pos2 for compatibility.
-- Called whenever pos2 is accessed in this API.
-- @internal
-- @param	player_name		string	The name of the player to fetch the position for.
-- @returns	void
local function compat_worldedit_pos2_get(player_name)
{
	"type": "function",
	"internal": true,
	"description": "Transparently fetches from worldedit pos2 for compatibility.\nCalled whenever pos2 is accessed in this API.",
	"directives": [
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 68,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 73,
	"name": "compat_worldedit_pos2_get",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Transparently fetches from worldedit pos2 for compatibility.\n-- Called whenever pos2 is accessed in this API.\n-- @internal\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @returns\tvoid\nlocal function compat_worldedit_pos2_get(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions_core.pos.compat_worldedit_pos2_get",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L69-L74"
}

compat_worldedit_set 🔗

Sets pos1/pos2 in worldedit for compatibility.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to set the position for.

inumbernil

The index of the position to set.

posVector3nil

The position to set.

do_updatebooltrue

Whether to call worldedit.marker_update() or not.

Returns

nil

Source
--- Sets pos1/pos2 in worldedit for compatibility.
-- @param	player_name		string	The name of the player to set the position for.
-- @param	i				number	The index of the position to set.
-- @param	pos				Vector3	The position to set.
-- @param	do_update=true	bool	Whether to call worldedit.marker_update() or not.
-- @returns	nil
local function compat_worldedit_set(player_name, i, pos, do_update)
{
	"type": "function",
	"internal": false,
	"description": "Sets pos1/pos2 in worldedit for compatibility.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to set the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set the position for."
		},
		{
			"directive": "param",
			"text": "i\t\t\t\tnumber\tThe index of the position to set.",
			"name": "i",
			"type": "number",
			"description": "The index of the position to set."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\tThe position to set.",
			"name": "pos",
			"type": "Vector3",
			"description": "The position to set."
		},
		{
			"directive": "param",
			"text": "do_update=true\tbool\tWhether to call worldedit.marker_update() or not.",
			"name": "do_update",
			"type": "bool",
			"description": "Whether to call worldedit.marker_update() or not.",
			"default_value": "true"
		},
		{
			"directive": "returns",
			"text": "nil",
			"type": "nil"
		}
	],
	"line": 85,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 91,
	"name": "compat_worldedit_set",
	"instanced": false,
	"args": [
		"player_name",
		"i",
		"pos",
		"do_update"
	],
	"text": "--- Sets pos1/pos2 in worldedit for compatibility.\n-- @param\tplayer_name\t\tstring\tThe name of the player to set the position for.\n-- @param\ti\t\t\t\tnumber\tThe index of the position to set.\n-- @param\tpos\t\t\t\tVector3\tThe position to set.\n-- @param\tdo_update=true\tbool\tWhether to call worldedit.marker_update() or not.\n-- @returns\tnil\nlocal function compat_worldedit_set(player_name, i, pos, do_update)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to set the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set the position for."
		},
		{
			"directive": "param",
			"text": "i\t\t\t\tnumber\tThe index of the position to set.",
			"name": "i",
			"type": "number",
			"description": "The index of the position to set."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\tThe position to set.",
			"name": "pos",
			"type": "Vector3",
			"description": "The position to set."
		},
		{
			"directive": "param",
			"text": "do_update=true\tbool\tWhether to call worldedit.marker_update() or not.",
			"name": "do_update",
			"type": "bool",
			"description": "Whether to call worldedit.marker_update() or not.",
			"default_value": "true"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "nil",
		"type": "nil"
	},
	"name_full": "worldeditadditions_core.pos.compat_worldedit_set",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L86-L92"
}

count 🔗

Counts the number of positioons registered to a given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

Returns

number :

The number of positions registered for the given player.

Source
--- Counts the number of positioons registered to a given player.
-- @param	player_name		string	The name of the player to fetch the position for.
-- @returns	number			The number of positions registered for the given player.
local function count(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Counts the number of positioons registered to a given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "returns",
			"text": "number\t\t\tThe number of positions registered for the given player.",
			"type": "number",
			"description": "The number of positions registered for the given player."
		}
	],
	"line": 177,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 180,
	"name": "count",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Counts the number of positioons registered to a given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @returns\tnumber\t\t\tThe number of positions registered for the given player.\nlocal function count(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\t\tThe number of positions registered for the given player.",
		"type": "number",
		"description": "The number of positions registered for the given player."
	},
	"name_full": "worldeditadditions_core.pos.count",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L178-L181"
}

ensure_player 🔗

Ensures that a table exists for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to check.

Returns

nil

Source
--- Ensures that a table exists for the given player.
-- @param	player_name		string	The name of the player to check.
local function ensure_player(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Ensures that a table exists for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to check.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to check."
		}
	],
	"line": 41,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 43,
	"name": "ensure_player",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Ensures that a table exists for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to check.\nlocal function ensure_player(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to check.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to check."
		}
	],
	"name_full": "worldeditadditions_core.pos.ensure_player",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L42-L44"
}

get 🔗

Gets the position with the given index for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

inumbernil

The index of the position to fetch.

Returns

Vector3? :

The position requested, or nil if it doesn't exist.

Source
--- Gets the position with the given index for the given player.
-- @param	player_name		string	The name of the player to fetch the position for.
-- @param	i				number	The index of the position to fetch.
-- @returns	Vector3?		The position requested, or nil if it doesn't exist.
local function get(player_name, i)
{
	"type": "function",
	"internal": false,
	"description": "Gets the position with the given index for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "param",
			"text": "i\t\t\t\tnumber\tThe index of the position to fetch.",
			"name": "i",
			"type": "number",
			"description": "The index of the position to fetch."
		},
		{
			"directive": "returns",
			"text": "Vector3?\t\tThe position requested, or nil if it doesn't exist.",
			"type": "Vector3?",
			"description": "The position requested, or nil if it doesn't exist."
		}
	],
	"line": 114,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 118,
	"name": "get",
	"instanced": false,
	"args": [
		"player_name",
		"i"
	],
	"text": "--- Gets the position with the given index for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @param\ti\t\t\t\tnumber\tThe index of the position to fetch.\n-- @returns\tVector3?\t\tThe position requested, or nil if it doesn't exist.\nlocal function get(player_name, i)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "param",
			"text": "i\t\t\t\tnumber\tThe index of the position to fetch.",
			"name": "i",
			"type": "number",
			"description": "The index of the position to fetch."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3?\t\tThe position requested, or nil if it doesn't exist.",
		"type": "Vector3?",
		"description": "The position requested, or nil if it doesn't exist."
	},
	"name_full": "worldeditadditions_core.pos.get",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L115-L119"
}

get_all 🔗

Gets a list of all the positions for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

Returns

Vector3[] :

A list of positions for the given player.

Source
--- Gets a list of all the positions for the given player.
-- @param	player_name		string	The name of the player to fetch the position for.
-- @returns	Vector3[]		A list of positions for the given player.
local function get_all(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Gets a list of all the positions for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "returns",
			"text": "Vector3[]\t\tA list of positions for the given player.",
			"type": "Vector3[]",
			"description": "A list of positions for the given player."
		}
	],
	"line": 148,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 151,
	"name": "get_all",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Gets a list of all the positions for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @returns\tVector3[]\t\tA list of positions for the given player.\nlocal function get_all(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3[]\t\tA list of positions for the given player.",
		"type": "Vector3[]",
		"description": "A list of positions for the given player."
	},
	"name_full": "worldeditadditions_core.pos.get_all",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L149-L152"
}

get_bounds 🔗

Get a bounding box that encloses all the positions currently defined by a given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the boudnign box for.

Returns

nil|(Vector3,Vector3) :

2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined.

Source
--- Get a bounding box that encloses all the positions currently defined by a given player.
-- @param	player_name		string	The name of the player to fetch the boudnign box for.
-- @returns nil|(Vector3,Vector3)	2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined.
local function get_bounds(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Get a bounding box that encloses all the positions currently defined by a given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the boudnign box for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the boudnign box for."
		},
		{
			"directive": "returns",
			"text": "nil|(Vector3,Vector3)\t2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined.",
			"type": "nil|(Vector3,Vector3)",
			"description": "2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined."
		}
	],
	"line": 159,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 162,
	"name": "get_bounds",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Get a bounding box that encloses all the positions currently defined by a given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the boudnign box for.\n-- @returns nil|(Vector3,Vector3)\t2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined.\nlocal function get_bounds(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the boudnign box for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the boudnign box for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "nil|(Vector3,Vector3)\t2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined.",
		"type": "nil|(Vector3,Vector3)",
		"description": "2 positions that define opposite corners of a region that fully encloses all the defined points for the given player, or nil ir the specified player has no points currently defined."
	},
	"name_full": "worldeditadditions_core.pos.get_bounds",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L160-L163"
}

get1 🔗

Convenience function that returns position 1 for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

Returns

Vector3? :

The position requested, or nil if it doesn't exist.

Source
--- Convenience function that returns position 1 for the given player.
-- @param	player_name		string	The name of the player to fetch the position for.
-- @returns	Vector3?		The position requested, or nil if it doesn't exist.
local function get1(player_name) return get(player_name, 1) end
{
	"type": "function",
	"internal": false,
	"description": "Convenience function that returns position 1 for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "returns",
			"text": "Vector3?\t\tThe position requested, or nil if it doesn't exist.",
			"type": "Vector3?",
			"description": "The position requested, or nil if it doesn't exist."
		}
	],
	"line": 126,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 129,
	"name": "get1",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Convenience function that returns position 1 for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @returns\tVector3?\t\tThe position requested, or nil if it doesn't exist.\nlocal function get1(player_name) return get(player_name, 1) end",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3?\t\tThe position requested, or nil if it doesn't exist.",
		"type": "Vector3?",
		"description": "The position requested, or nil if it doesn't exist."
	},
	"name_full": "worldeditadditions_core.pos.get1",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L127-L130"
}

get12 🔗

Convenience function that returns pos1 and pos2 with the coordinates sorted for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

sortboolfalse

If true, the pos1 and pos2 are run through Vector3.sort() automatically.

Returns

Vector3?,Vector3 :

The positions requested, or nil if either of them don't exist.

Source
--- Convenience function that returns pos1 and pos2 with the coordinates sorted for the given player.
-- @param	player_name		string	The name of the player to fetch the position for.
-- @param	sort=false			bool	If true, the pos1 and pos2 are run through Vector3.sort() automatically.
-- @returns	Vector3?,Vector3		The positions requested, or nil if either of them don't exist.
local function get12(player_name, sort)
{
	"type": "function",
	"internal": false,
	"description": "Convenience function that returns pos1 and pos2 with the coordinates sorted for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "param",
			"text": "sort=false\t\t\tbool\tIf true, the pos1 and pos2 are run through Vector3.sort() automatically.",
			"name": "sort",
			"type": "bool",
			"description": "If true, the pos1 and pos2 are run through Vector3.sort() automatically.",
			"default_value": "false"
		},
		{
			"directive": "returns",
			"text": "Vector3?,Vector3\t\tThe positions requested, or nil if either of them don't exist.",
			"type": "Vector3?,Vector3",
			"description": "The positions requested, or nil if either of them don't exist."
		}
	],
	"line": 135,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 139,
	"name": "get12",
	"instanced": false,
	"args": [
		"player_name",
		"sort"
	],
	"text": "--- Convenience function that returns pos1 and pos2 with the coordinates sorted for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @param\tsort=false\t\t\tbool\tIf true, the pos1 and pos2 are run through Vector3.sort() automatically.\n-- @returns\tVector3?,Vector3\t\tThe positions requested, or nil if either of them don't exist.\nlocal function get12(player_name, sort)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "param",
			"text": "sort=false\t\t\tbool\tIf true, the pos1 and pos2 are run through Vector3.sort() automatically.",
			"name": "sort",
			"type": "bool",
			"description": "If true, the pos1 and pos2 are run through Vector3.sort() automatically.",
			"default_value": "false"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3?,Vector3\t\tThe positions requested, or nil if either of them don't exist.",
		"type": "Vector3?,Vector3",
		"description": "The positions requested, or nil if either of them don't exist."
	},
	"name_full": "worldeditadditions_core.pos.get12",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L136-L140"
}

get2 🔗

Convenience function that returns position 1 for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to fetch the position for.

Returns

Vector3? :

The position requested, or nil if it doesn't exist.

Source
--- Convenience function that returns position 1 for the given player.
-- @param	player_name		string	The name of the player to fetch the position for.
-- @returns	Vector3?		The position requested, or nil if it doesn't exist.
local function get2(player_name) return get(player_name, 2) end
{
	"type": "function",
	"internal": false,
	"description": "Convenience function that returns position 1 for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		},
		{
			"directive": "returns",
			"text": "Vector3?\t\tThe position requested, or nil if it doesn't exist.",
			"type": "Vector3?",
			"description": "The position requested, or nil if it doesn't exist."
		}
	],
	"line": 130,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 133,
	"name": "get2",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Convenience function that returns position 1 for the given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to fetch the position for.\n-- @returns\tVector3?\t\tThe position requested, or nil if it doesn't exist.\nlocal function get2(player_name) return get(player_name, 2) end",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to fetch the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to fetch the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3?\t\tThe position requested, or nil if it doesn't exist.",
		"type": "Vector3?",
		"description": "The position requested, or nil if it doesn't exist."
	},
	"name_full": "worldeditadditions_core.pos.get2",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L131-L134"
}

mark 🔗

Shows the visual markers for the given player's positions and defined region once more. Often used some time after calling worldeditadditions_core.pos.unmark().

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to operate on.

Returns

void

Source
--- Shows the visual markers for the given player's positions and defined region once more.
-- Often used some time after calling worldeditadditions_core.pos.unmark().
-- @param	player_name		string	The name of the player to operate on.
-- @returns	void
local function mark(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Shows the visual markers for the given player's positions and defined region once more.\nOften used some time after calling worldeditadditions_core.pos.unmark().",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to operate on.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to operate on."
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 297,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 301,
	"name": "mark",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Shows the visual markers for the given player's positions and defined region once more.\n-- Often used some time after calling worldeditadditions_core.pos.unmark().\n-- @param\tplayer_name\t\tstring\tThe name of the player to operate on.\n-- @returns\tvoid\nlocal function mark(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to operate on.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions_core.pos.mark",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L298-L302"
}

pop 🔗

Removes the last position from the for a given player and returns it.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to pop the position for.

Returns

Vector3? :

The position removed, or nil if it doesn't exist.

Source
--- Removes the last position from the for a given player and returns it.
-- @param	player_name		string	The name of the player to pop the position for.
-- @returns	Vector3?		The position removed, or nil if it doesn't exist.
local function pop(player_name)
{
	"type": "function",
	"internal": false,
	"description": "Removes the last position from the for a given player and returns it.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to pop the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to pop the position for."
		},
		{
			"directive": "returns",
			"text": "Vector3?\t\tThe position removed, or nil if it doesn't exist.",
			"type": "Vector3?",
			"description": "The position removed, or nil if it doesn't exist."
		}
	],
	"line": 249,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 252,
	"name": "pop",
	"instanced": false,
	"args": [
		"player_name"
	],
	"text": "--- Removes the last position from the for a given player and returns it.\n-- @param\tplayer_name\t\tstring\tThe name of the player to pop the position for.\n-- @returns\tVector3?\t\tThe position removed, or nil if it doesn't exist.\nlocal function pop(player_name)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to pop the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to pop the position for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3?\t\tThe position removed, or nil if it doesn't exist.",
		"type": "Vector3?",
		"description": "The position removed, or nil if it doesn't exist."
	},
	"name_full": "worldeditadditions_core.pos.pop",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L250-L253"
}

push 🔗

Adds a position to the list for a given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to add the position for.

posVector3nil

The position to add.

Returns

number :

The new number of positions for that player.

Source
--- Adds a position to the list for a given player.
-- @param	player_name		string	The name of the player to add the position for.
-- @param	pos				Vector3	The position to add.
-- @returns	number			The new number of positions for that player.
local function push(player_name, pos)
{
	"type": "function",
	"internal": false,
	"description": "Adds a position to the list for a given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to add the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to add the position for."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\tThe position to add.",
			"name": "pos",
			"type": "Vector3",
			"description": "The position to add."
		},
		{
			"directive": "returns",
			"text": "number\t\t\tThe new number of positions for that player.",
			"type": "number",
			"description": "The new number of positions for that player."
		}
	],
	"line": 268,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 272,
	"name": "push",
	"instanced": false,
	"args": [
		"player_name",
		"pos"
	],
	"text": "--- Adds a position to the list for a given player.\n-- @param\tplayer_name\t\tstring\tThe name of the player to add the position for.\n-- @param\tpos\t\t\t\tVector3\tThe position to add.\n-- @returns\tnumber\t\t\tThe new number of positions for that player.\nlocal function push(player_name, pos)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to add the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to add the position for."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\tThe position to add.",
			"name": "pos",
			"type": "Vector3",
			"description": "The position to add."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\t\tThe new number of positions for that player.",
		"type": "number",
		"description": "The new number of positions for that player."
	},
	"name_full": "worldeditadditions_core.pos.push",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L269-L273"
}

set 🔗

Sets the position at the given index for the given player. You probably want push_pos, not this function.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to set the position for.

inumbernil

The index to set the position at.

posVector3nil

The position to set.

Returns

bool :

Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).

Source
--- Sets the position at the given index for the given player.
-- You probably want push_pos, not this function.
-- @param	player_name		string	The name of the player to set the position for.
-- @param	i				number	The index to set the position at.
-- @param	pos				Vector3	The position to set.
-- @returns	bool			Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).
local function set(player_name, i, pos)
{
	"type": "function",
	"internal": false,
	"description": "Sets the position at the given index for the given player.\nYou probably want push_pos, not this function.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to set the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set the position for."
		},
		{
			"directive": "param",
			"text": "i\t\t\t\tnumber\tThe index to set the position at.",
			"name": "i",
			"type": "number",
			"description": "The index to set the position at."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\tThe position to set.",
			"name": "pos",
			"type": "Vector3",
			"description": "The position to set."
		},
		{
			"directive": "returns",
			"text": "bool\t\t\tWhether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).",
			"type": "bool",
			"description": "Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time)."
		}
	],
	"line": 187,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 193,
	"name": "set",
	"instanced": false,
	"args": [
		"player_name",
		"i",
		"pos"
	],
	"text": "--- Sets the position at the given index for the given player.\n-- You probably want push_pos, not this function.\n-- @param\tplayer_name\t\tstring\tThe name of the player to set the position for.\n-- @param\ti\t\t\t\tnumber\tThe index to set the position at.\n-- @param\tpos\t\t\t\tVector3\tThe position to set.\n-- @returns\tbool\t\t\tWhether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).\nlocal function set(player_name, i, pos)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to set the position for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set the position for."
		},
		{
			"directive": "param",
			"text": "i\t\t\t\tnumber\tThe index to set the position at.",
			"name": "i",
			"type": "number",
			"description": "The index to set the position at."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3\tThe position to set.",
			"name": "pos",
			"type": "Vector3",
			"description": "The position to set."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\t\tWhether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).",
		"type": "bool",
		"description": "Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time)."
	},
	"name_full": "worldeditadditions_core.pos.set",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L188-L194"
}

set_all 🔗

Sets the all the positions for the given player. You probably want push_pos, not this function.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to set the positions for.

pos_listVector3nil

The table of positions to set.

Returns

bool :

Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).

Source
--- Sets the all the positions for the given player.
-- You probably want push_pos, not this function.
-- @param	player_name		string	The name of the player to set the positions for.
-- @param	pos_list		Vector3	The table of positions to set.
-- @returns	bool			Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).
local function set_all(player_name, pos_list)
{
	"type": "function",
	"internal": false,
	"description": "Sets the all the positions for the given player.\nYou probably want push_pos, not this function.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to set the positions for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set the positions for."
		},
		{
			"directive": "param",
			"text": "pos_list\t\tVector3\tThe table of positions to set.",
			"name": "pos_list",
			"type": "Vector3",
			"description": "The table of positions to set."
		},
		{
			"directive": "returns",
			"text": "bool\t\t\tWhether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).",
			"type": "bool",
			"description": "Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time)."
		}
	],
	"line": 221,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 226,
	"name": "set_all",
	"instanced": false,
	"args": [
		"player_name",
		"pos_list"
	],
	"text": "--- Sets the all the positions for the given player.\n-- You probably want push_pos, not this function.\n-- @param\tplayer_name\t\tstring\tThe name of the player to set the positions for.\n-- @param\tpos_list\t\tVector3\tThe table of positions to set.\n-- @returns\tbool\t\t\tWhether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).\nlocal function set_all(player_name, pos_list)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to set the positions for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set the positions for."
		},
		{
			"directive": "param",
			"text": "pos_list\t\tVector3\tThe table of positions to set.",
			"name": "pos_list",
			"type": "Vector3",
			"description": "The table of positions to set."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\t\tWhether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time).",
		"type": "bool",
		"description": "Whether the operation was successful or not (players aren't allowed more than positions_count_limit number of positions at a time)."
	},
	"name_full": "worldeditadditions_core.pos.set_all",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L222-L227"
}

set1 🔗

Convenience function that set position 1 for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to set pos1 for.

posVector3?nil

The new Vector3 for pos1 to set.

Returns

bool :

Whether the operation was successful or not, but in this case will always return true so can be ignored.

Source
--- Convenience function that set position 1 for the given player.
-- @param	player_name		string		The name of the player to set pos1 for.
-- @param	pos				Vector3?	The new Vector3 for pos1 to set.
-- @returns	bool			Whether the operation was successful or not, but in this case will always return true so can be ignored.
local function set1(player_name, pos)
{
	"type": "function",
	"internal": false,
	"description": "Convenience function that set position 1 for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\t\tThe name of the player to set pos1 for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set pos1 for."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3?\tThe new Vector3 for pos1 to set.",
			"name": "pos",
			"type": "Vector3?",
			"description": "The new Vector3 for pos1 to set."
		},
		{
			"directive": "returns",
			"text": "bool\t\t\tWhether the operation was successful or not, but in this case will always return true so can be ignored.",
			"type": "bool",
			"description": "Whether the operation was successful or not, but in this case will always return true so can be ignored."
		}
	],
	"line": 205,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 209,
	"name": "set1",
	"instanced": false,
	"args": [
		"player_name",
		"pos"
	],
	"text": "--- Convenience function that set position 1 for the given player.\n-- @param\tplayer_name\t\tstring\t\tThe name of the player to set pos1 for.\n-- @param\tpos\t\t\t\tVector3?\tThe new Vector3 for pos1 to set.\n-- @returns\tbool\t\t\tWhether the operation was successful or not, but in this case will always return true so can be ignored.\nlocal function set1(player_name, pos)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\t\tThe name of the player to set pos1 for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set pos1 for."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3?\tThe new Vector3 for pos1 to set.",
			"name": "pos",
			"type": "Vector3?",
			"description": "The new Vector3 for pos1 to set."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\t\tWhether the operation was successful or not, but in this case will always return true so can be ignored.",
		"type": "bool",
		"description": "Whether the operation was successful or not, but in this case will always return true so can be ignored."
	},
	"name_full": "worldeditadditions_core.pos.set1",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L206-L210"
}

set2 🔗

Convenience function that set position 2 for the given player.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to set pos1 for.

posVector3?nil

The new Vector3 for pos2 to set.

Returns

bool :

Whether the operation was successful or not, but in this case will always return true so can be ignored.

Source
--- Convenience function that set position 2 for the given player.
-- @param	player_name		string		The name of the player to set pos1 for.
-- @param	pos				Vector3?	The new Vector3 for pos2 to set.
-- @returns	bool			Whether the operation was successful or not, but in this case will always return true so can be ignored.
local function set2(player_name, pos)
{
	"type": "function",
	"internal": false,
	"description": "Convenience function that set position 2 for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\t\tThe name of the player to set pos1 for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set pos1 for."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3?\tThe new Vector3 for pos2 to set.",
			"name": "pos",
			"type": "Vector3?",
			"description": "The new Vector3 for pos2 to set."
		},
		{
			"directive": "returns",
			"text": "bool\t\t\tWhether the operation was successful or not, but in this case will always return true so can be ignored.",
			"type": "bool",
			"description": "Whether the operation was successful or not, but in this case will always return true so can be ignored."
		}
	],
	"line": 212,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 216,
	"name": "set2",
	"instanced": false,
	"args": [
		"player_name",
		"pos"
	],
	"text": "--- Convenience function that set position 2 for the given player.\n-- @param\tplayer_name\t\tstring\t\tThe name of the player to set pos1 for.\n-- @param\tpos\t\t\t\tVector3?\tThe new Vector3 for pos2 to set.\n-- @returns\tbool\t\t\tWhether the operation was successful or not, but in this case will always return true so can be ignored.\nlocal function set2(player_name, pos)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\t\tThe name of the player to set pos1 for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to set pos1 for."
		},
		{
			"directive": "param",
			"text": "pos\t\t\t\tVector3?\tThe new Vector3 for pos2 to set.",
			"name": "pos",
			"type": "Vector3?",
			"description": "The new Vector3 for pos2 to set."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\t\tWhether the operation was successful or not, but in this case will always return true so can be ignored.",
		"type": "bool",
		"description": "Whether the operation was successful or not, but in this case will always return true so can be ignored."
	},
	"name_full": "worldeditadditions_core.pos.set2",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L213-L217"
}

unmark 🔗

Hides the visual markers for the given player's positions and defined region, but does not clear the points.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player to operate on.

markersbooltrue

Whether to hide positional markers.

wallsbooltrue

Whether to hide the marker walls.

Returns

void

Source
--- Hides the visual markers for the given player's positions and defined region, but does not clear the points.
-- @param	player_name		string	The name of the player to operate on.
-- @param	markers=true	bool	Whether to hide positional markers.
-- @param	walls=true		bool	Whether to hide the marker walls.
-- @returns	void
local function unmark(player_name, markers, walls)
{
	"type": "function",
	"internal": false,
	"description": "Hides the visual markers for the given player's positions and defined region, but does not clear the points.",
	"directives": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to operate on.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to operate on."
		},
		{
			"directive": "param",
			"text": "markers=true\tbool\tWhether to hide positional markers.",
			"name": "markers",
			"type": "bool",
			"description": "Whether to hide positional markers.",
			"default_value": "true"
		},
		{
			"directive": "param",
			"text": "walls=true\t\tbool\tWhether to hide the marker walls.",
			"name": "walls",
			"type": "bool",
			"description": "Whether to hide the marker walls.",
			"default_value": "true"
		},
		{
			"directive": "returns",
			"text": "void",
			"type": "void"
		}
	],
	"line": 281,
	"namespace": "worldeditadditions_core.pos",
	"line_last": 286,
	"name": "unmark",
	"instanced": false,
	"args": [
		"player_name",
		"markers",
		"walls"
	],
	"text": "--- Hides the visual markers for the given player's positions and defined region, but does not clear the points.\n-- @param\tplayer_name\t\tstring\tThe name of the player to operate on.\n-- @param\tmarkers=true\tbool\tWhether to hide positional markers.\n-- @param\twalls=true\t\tbool\tWhether to hide the marker walls.\n-- @returns\tvoid\nlocal function unmark(player_name, markers, walls)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\tThe name of the player to operate on.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to operate on."
		},
		{
			"directive": "param",
			"text": "markers=true\tbool\tWhether to hide positional markers.",
			"name": "markers",
			"type": "bool",
			"description": "Whether to hide positional markers.",
			"default_value": "true"
		},
		{
			"directive": "param",
			"text": "walls=true\t\tbool\tWhether to hide the marker walls.",
			"name": "walls",
			"type": "bool",
			"description": "Whether to hide the marker walls.",
			"default_value": "true"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "void",
		"type": "void"
	},
	"name_full": "worldeditadditions_core.pos.unmark",
	"filename": "worldeditadditions_core/core/pos.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/pos.lua#L282-L287"
}

Events

clear 🔗

The positions for a player have been cleared.

Format

{ player_name: string }
Source
--- The positions for a player have been cleared.
-- @event	clear
-- @format	{ player_name: string }
{
	"type": "event",
	"internal": false,
	"description": "The positions for a player have been cleared.",
	"directives": [
		{
			"directive": "event",
			"text": "clear"
		},
		{
			"directive": "format",
			"text": "{ player_name: string }"
		}
	],
	"line": 29,
	"namespace": "worldeditadditions_core.pos",
	"event": "clear",
	"line_last": 32,
	"text": "--- The positions for a player have been cleared.\n-- @event\tclear\n-- @format\t{ player_name: string }",
	"params": [],
	"filename": "worldeditadditions_core/core/pos.lua"
}

mark 🔗

It is requested that all position/region marker UI elements be shown once more for the given player.

Format

{ player_name: string }
Source
--- It is requested that all position/region marker UI elements be shown once more for the given player.
-- @event	mark
-- @format	{ player_name: string }
{
	"type": "event",
	"internal": false,
	"description": "It is requested that all position/region marker UI elements be shown once more for the given player.",
	"directives": [
		{
			"directive": "event",
			"text": "mark"
		},
		{
			"directive": "format",
			"text": "{ player_name: string }"
		}
	],
	"line": 37,
	"namespace": "worldeditadditions_core.pos",
	"event": "mark",
	"line_last": 40,
	"text": "--- It is requested that all position/region marker UI elements be shown once more for the given player.\n-- @event\tmark\n-- @format\t{ player_name: string }",
	"params": [],
	"filename": "worldeditadditions_core/core/pos.lua"
}

pop 🔗

A new position has been pushed onto a player's stack.

Format

{ player_name: string, i: number, pos: Vector3 }
Source
--- A new position has been pushed onto a player's stack.
-- @event	pop
-- @format	{ player_name: string, i: number, pos: Vector3 }
{
	"type": "event",
	"internal": false,
	"description": "A new position has been pushed onto a player's stack.",
	"directives": [
		{
			"directive": "event",
			"text": "pop"
		},
		{
			"directive": "format",
			"text": "{ player_name: string, i: number, pos: Vector3 }"
		}
	],
	"line": 25,
	"namespace": "worldeditadditions_core.pos",
	"event": "pop",
	"line_last": 28,
	"text": "--- A new position has been pushed onto a player's stack.\n-- @event\tpop\n-- @format\t{ player_name: string, i: number, pos: Vector3 }",
	"params": [],
	"filename": "worldeditadditions_core/core/pos.lua"
}

push 🔗

A new position has been pushed onto a player's stack.

Format

{ player_name: string, i: number, pos: Vector3 }
Source
--- A new position has been pushed onto a player's stack.
-- @event	push
-- @format	{ player_name: string, i: number, pos: Vector3 }
{
	"type": "event",
	"internal": false,
	"description": "A new position has been pushed onto a player's stack.",
	"directives": [
		{
			"directive": "event",
			"text": "push"
		},
		{
			"directive": "format",
			"text": "{ player_name: string, i: number, pos: Vector3 }"
		}
	],
	"line": 21,
	"namespace": "worldeditadditions_core.pos",
	"event": "push",
	"line_last": 24,
	"text": "--- A new position has been pushed onto a player's stack.\n-- @event\tpush\n-- @format\t{ player_name: string, i: number, pos: Vector3 }",
	"params": [],
	"filename": "worldeditadditions_core/core/pos.lua"
}

set 🔗

A new position has been set in a player's list at a specific position.

Format

{ player_name: string, i: number, pos: Vector3 }
Source
--- A new position has been set in a player's list at a specific position.
-- @event	set
-- @format	{ player_name: string, i: number, pos: Vector3 }
-- @example
-- {
-- 	player_name = "some_player_name",
-- 	i = 3,
-- 	pos = <Vector3> { x = 456, y = 64, z = 9045 }
-- }
{
	"type": "event",
	"internal": false,
	"description": "A new position has been set in a player's list at a specific position.",
	"directives": [
		{
			"directive": "event",
			"text": "set"
		},
		{
			"directive": "format",
			"text": "{ player_name: string, i: number, pos: Vector3 }"
		},
		{
			"directive": "example",
			"text": "{\nplayer_name = \"some_player_name\",\ni = 3,\npos = <Vector3> { x = 456, y = 64, z = 9045 }\n}"
		}
	],
	"line": 11,
	"namespace": "worldeditadditions_core.pos",
	"event": "set",
	"line_last": 20,
	"text": "--- A new position has been set in a player's list at a specific position.\n-- @event\tset\n-- @format\t{ player_name: string, i: number, pos: Vector3 }\n-- @example\n-- {\n-- \tplayer_name = \"some_player_name\",\n-- \ti = 3,\n-- \tpos = <Vector3> { x = 456, y = 64, z = 9045 }\n-- }",
	"params": [],
	"filename": "worldeditadditions_core/core/pos.lua"
}

unmark 🔗

It is requested that all position/region marker UI elements be hidden for the given player.

Format

{ player_name: string, markers: bool, walls: bool }
Source
--- It is requested that all position/region marker UI elements be hidden for the given player.
-- @event	unmark
-- @format	{ player_name: string, markers: bool, walls: bool }
{
	"type": "event",
	"internal": false,
	"description": "It is requested that all position/region marker UI elements be hidden for the given player.",
	"directives": [
		{
			"directive": "event",
			"text": "unmark"
		},
		{
			"directive": "format",
			"text": "{ player_name: string, markers: bool, walls: bool }"
		}
	],
	"line": 33,
	"namespace": "worldeditadditions_core.pos",
	"event": "unmark",
	"line_last": 36,
	"text": "--- It is requested that all position/region marker UI elements be hidden for the given player.\n-- @event\tunmark\n-- @format\t{ player_name: string, markers: bool, walls: bool }",
	"params": [],
	"filename": "worldeditadditions_core/core/pos.lua"
}

Promise 🔗

Javascript Promises, implemented in Lua In other words, a wrapper to manage asynchronous operations. Due to limitations of Lua, while this Promise API is similar it isn't exactly the same as in JS. Most notably is that there is a .run() function you must call AFTER you call .then_() as many times as you need.

Also, .then_() does not return a thenable value but the SAME ORIGINAL promise, as we stack up all functions and then execute them in order once you call .run(). This has the subtle implication that Promise.state is not set to "fulfilled" until ALL functions in the chain have been called.

Additionally, every .then_(function(...) end) MAY return a promise themselves if they wish. These promises WILL be automatically executed when you call .run() on the PARENT promise, as they are considered required for the parent Promise function chain to run to completion.

Functions

new 🔗

Creates a new Promise instance.

Arguments

NameTypeDefault valueDescription
fnfunctionnil

The function to wrap into a promise.

Returns

nil

Source
--- Creates a new Promise instance.
-- @param fn 	function	The function to wrap into a promise.
function Promise.new(fn)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new Promise instance.",
	"directives": [
		{
			"directive": "param",
			"text": "fn \tfunction\tThe function to wrap into a promise.",
			"name": "fn ",
			"type": "function",
			"description": "The function to wrap into a promise."
		}
	],
	"line": 14,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 16,
	"name": "new",
	"instanced": false,
	"args": [
		"fn"
	],
	"text": "--- Creates a new Promise instance.\n-- @param fn \tfunction\tThe function to wrap into a promise.\nfunction Promise.new(fn)",
	"params": [
		{
			"directive": "param",
			"text": "fn \tfunction\tThe function to wrap into a promise.",
			"name": "fn ",
			"type": "function",
			"description": "The function to wrap into a promise."
		}
	],
	"name_full": "worldeditadditions_core.Promise.new",
	"filename": "promise.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise.lua#L15-L17"
}

run 🔗

Executes the function this Promise is wrapping all associated chained functions in sequence. This is a separate method for portability, since Lua does not implement setTimeout which is required to ensure that if an non-async function is wrapped the parent function still has time to call .then_() before it finishes and the associated .then_()ed functions are attached correctly.

WARNING: If you call .then_() AFTER calling .run(), your .then_()ed function may not be called correctly!

Arguments

NameTypeDefault valueDescription

Returns

Promise :

The current promise, for daisy chaining purposes.

Source
--- Executes the function this Promise is wrapping all associated chained functions in sequence.
-- This is a separate method for portability, since Lua does not implement setTimeout which is required to ensure that if an non-async function is wrapped the parent function still has time to call .then_() before it finishes and the associated .then_()ed functions are attached correctly.
-- 
-- WARNING: If you call .then_() AFTER calling .run(), your .then_()ed function may not be called correctly!
-- @returns	Promise	The current promise, for daisy chaining purposes.
function Promise.run(self)
{
	"type": "function",
	"internal": false,
	"description": "Executes the function this Promise is wrapping all associated chained functions in sequence.\nThis is a separate method for portability, since Lua does not implement setTimeout which is required to ensure that if an non-async function is wrapped the parent function still has time to call .then_() before it finishes and the associated .then_()ed functions are attached correctly.\n\nWARNING: If you call .then_() AFTER calling .run(), your .then_()ed function may not be called correctly!",
	"directives": [
		{
			"directive": "returns",
			"text": "Promise\tThe current promise, for daisy chaining purposes.",
			"type": "Promise",
			"description": "The current promise, for daisy chaining purposes."
		}
	],
	"line": 126,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 131,
	"name": "run",
	"instanced": false,
	"args": [
		"self"
	],
	"text": "--- Executes the function this Promise is wrapping all associated chained functions in sequence.\n-- This is a separate method for portability, since Lua does not implement setTimeout which is required to ensure that if an non-async function is wrapped the parent function still has time to call .then_() before it finishes and the associated .then_()ed functions are attached correctly.\n-- \n-- WARNING: If you call .then_() AFTER calling .run(), your .then_()ed function may not be called correctly!\n-- @returns\tPromise\tThe current promise, for daisy chaining purposes.\nfunction Promise.run(self)",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "Promise\tThe current promise, for daisy chaining purposes.",
		"type": "Promise",
		"description": "The current promise, for daisy chaining purposes."
	},
	"name_full": "worldeditadditions_core.Promise.run",
	"filename": "promise.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise.lua#L127-L132"
}

🔗

Creates a new Promise instance.

Arguments

NameTypeDefault valueDescription
fn <function>: The function to wrap into a promise.nil

Returns

nil

Source
--- Creates a new Promise instance.
-- @param fn <function>: The function to wrap into a promise.
Promise.new = function(fn)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new Promise instance.",
	"directives": [
		{
			"directive": "param",
			"text": "fn <function>: The function to wrap into a promise.",
			"name": "fn <function>: The function to wrap into a promise."
		}
	],
	"line": 12,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 14,
	"text": "--- Creates a new Promise instance.\n-- @param fn <function>: The function to wrap into a promise.\nPromise.new = function(fn)",
	"params": [
		{
			"directive": "param",
			"text": "fn <function>: The function to wrap into a promise.",
			"name": "fn <function>: The function to wrap into a promise."
		}
	],
	"name_full": "worldeditadditions_core.Promise.undefined",
	"filename": "promise_tech.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise_tech.lua#L13-L15"
}

🔗

Then function for promises

Arguments

NameTypeDefault valueDescription
onFulfilled <function>: The function to call if the promise is fulfillednil
onRejected <function>: The function to call if the promise is rejectednil

Returns

A promise object containing a table of results

Source
--- Then function for promises
-- @param onFulfilled <function>: The function to call if the promise is fulfilled
-- @param onRejected <function>: The function to call if the promise is rejected
-- @return A promise object containing a table of results
Promise.then_ = function(self, onFulfilled, onRejected)
{
	"type": "function",
	"internal": false,
	"description": "Then function for promises",
	"directives": [
		{
			"directive": "param",
			"text": "onFulfilled <function>: The function to call if the promise is fulfilled",
			"name": "onFulfilled <function>: The function to call if the promise is fulfilled"
		},
		{
			"directive": "param",
			"text": "onRejected <function>: The function to call if the promise is rejected",
			"name": "onRejected <function>: The function to call if the promise is rejected"
		},
		{
			"directive": "returns",
			"text": "A promise object containing a table of results",
			"type": "A promise object containing a table of results"
		}
	],
	"line": 40,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 44,
	"text": "--- Then function for promises\n-- @param onFulfilled <function>: The function to call if the promise is fulfilled\n-- @param onRejected <function>: The function to call if the promise is rejected\n-- @return A promise object containing a table of results\nPromise.then_ = function(self, onFulfilled, onRejected)",
	"params": [
		{
			"directive": "param",
			"text": "onFulfilled <function>: The function to call if the promise is fulfilled",
			"name": "onFulfilled <function>: The function to call if the promise is fulfilled"
		},
		{
			"directive": "param",
			"text": "onRejected <function>: The function to call if the promise is rejected",
			"name": "onRejected <function>: The function to call if the promise is rejected"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "A promise object containing a table of results",
		"type": "A promise object containing a table of results"
	},
	"name_full": "worldeditadditions_core.Promise.undefined",
	"filename": "promise_tech.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise_tech.lua#L41-L45"
}

🔗

Catch function for promises

Arguments

NameTypeDefault valueDescription
onRejected <function>: The function to call if the promise is rejectednil

Returns

A promise object

Source
--- Catch function for promises
-- @param onRejected <function>: The function to call if the promise is rejected
-- @return A promise object
Promise.catch = function(self, onRejected)
{
	"type": "function",
	"internal": false,
	"description": "Catch function for promises",
	"directives": [
		{
			"directive": "param",
			"text": "onRejected <function>: The function to call if the promise is rejected",
			"name": "onRejected <function>: The function to call if the promise is rejected"
		},
		{
			"directive": "returns",
			"text": "A promise object",
			"type": "A promise object"
		}
	],
	"line": 85,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 88,
	"text": "--- Catch function for promises\n-- @param onRejected <function>: The function to call if the promise is rejected\n-- @return A promise object\nPromise.catch = function(self, onRejected)",
	"params": [
		{
			"directive": "param",
			"text": "onRejected <function>: The function to call if the promise is rejected",
			"name": "onRejected <function>: The function to call if the promise is rejected"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "A promise object",
		"type": "A promise object"
	},
	"name_full": "worldeditadditions_core.Promise.undefined",
	"filename": "promise_tech.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise_tech.lua#L86-L89"
}

🔗

Finally function for promises

Arguments

NameTypeDefault valueDescription
onFinally <function>: The function to call if the promise becomes settlednil

Returns

A promise object

Source
--- Finally function for promises
-- @param onFinally <function>: The function to call if the promise becomes settled
-- @return A promise object
Promise.finally = function(self, onFinally)
{
	"type": "function",
	"internal": false,
	"description": "Finally function for promises",
	"directives": [
		{
			"directive": "param",
			"text": "onFinally <function>: The function to call if the promise becomes settled",
			"name": "onFinally <function>: The function to call if the promise becomes settled"
		},
		{
			"directive": "returns",
			"text": "A promise object",
			"type": "A promise object"
		}
	],
	"line": 97,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 100,
	"text": "--- Finally function for promises\n-- @param onFinally <function>: The function to call if the promise becomes settled\n-- @return A promise object\nPromise.finally = function(self, onFinally)",
	"params": [
		{
			"directive": "param",
			"text": "onFinally <function>: The function to call if the promise becomes settled",
			"name": "onFinally <function>: The function to call if the promise becomes settled"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "A promise object",
		"type": "A promise object"
	},
	"name_full": "worldeditadditions_core.Promise.undefined",
	"filename": "promise_tech.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise_tech.lua#L98-L101"
}

🔗

Resolve function for promises

Arguments

NameTypeDefault valueDescription
value <any>: The value to resolve the promise withnil

Returns

A promise object

Source
--- Resolve function for promises
-- @param value <any>: The value to resolve the promise with
-- @return A promise object
Promise.resolve = function(value)
{
	"type": "function",
	"internal": false,
	"description": "Resolve function for promises",
	"directives": [
		{
			"directive": "param",
			"text": "value <any>: The value to resolve the promise with",
			"name": "value <any>: The value to resolve the promise with"
		},
		{
			"directive": "returns",
			"text": "A promise object",
			"type": "A promise object"
		}
	],
	"line": 111,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 114,
	"text": "--- Resolve function for promises\n-- @param value <any>: The value to resolve the promise with\n-- @return A promise object\nPromise.resolve = function(value)",
	"params": [
		{
			"directive": "param",
			"text": "value <any>: The value to resolve the promise with",
			"name": "value <any>: The value to resolve the promise with"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "A promise object",
		"type": "A promise object"
	},
	"name_full": "worldeditadditions_core.Promise.undefined",
	"filename": "promise_tech.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise_tech.lua#L112-L115"
}

🔗

Reject function for promises

Arguments

NameTypeDefault valueDescription
value <any>: The value to reject the promise withnil

Returns

A promise object

Source
--- Reject function for promises
-- @param value <any>: The value to reject the promise with
-- @return A promise object
Promise.reject = function(value)
{
	"type": "function",
	"internal": false,
	"description": "Reject function for promises",
	"directives": [
		{
			"directive": "param",
			"text": "value <any>: The value to reject the promise with",
			"name": "value <any>: The value to reject the promise with"
		},
		{
			"directive": "returns",
			"text": "A promise object",
			"type": "A promise object"
		}
	],
	"line": 120,
	"namespace": "worldeditadditions_core.Promise",
	"line_last": 123,
	"text": "--- Reject function for promises\n-- @param value <any>: The value to reject the promise with\n-- @return A promise object\nPromise.reject = function(value)",
	"params": [
		{
			"directive": "param",
			"text": "value <any>: The value to reject the promise with",
			"name": "value <any>: The value to reject the promise with"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "A promise object",
		"type": "A promise object"
	},
	"name_full": "worldeditadditions_core.Promise.undefined",
	"filename": "promise_tech.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/promise_tech.lua#L121-L124"
}

Queue 🔗

A Queue implementation Taken & adapted from https://www.lua.org/pil/11.4.html

Functions

contains 🔗

Determines whether a given value is present in this queue or not.

Arguments

NameTypeDefault valueDescription
valueanynil

The value to check.

Returns

bool :

Whether the given value exists in the queue or not.

Source
--- Determines whether a  given value is present in this queue or not.
-- @param	value	any		The value to check.
-- @returns	bool	Whether the given value exists in the queue or not.
function Queue:contains(value)
{
	"type": "function",
	"internal": false,
	"description": "Determines whether a  given value is present in this queue or not.",
	"directives": [
		{
			"directive": "param",
			"text": "value\tany\t\tThe value to check.",
			"name": "value",
			"type": "any",
			"description": "The value to check."
		},
		{
			"directive": "returns",
			"text": "bool\tWhether the given value exists in the queue or not.",
			"type": "bool",
			"description": "Whether the given value exists in the queue or not."
		}
	],
	"line": 25,
	"namespace": "worldeditadditions_core.Queue",
	"line_last": 28,
	"name": "contains",
	"instanced": true,
	"args": [
		"value"
	],
	"text": "--- Determines whether a  given value is present in this queue or not.\n-- @param\tvalue\tany\t\tThe value to check.\n-- @returns\tbool\tWhether the given value exists in the queue or not.\nfunction Queue:contains(value)",
	"params": [
		{
			"directive": "param",
			"text": "value\tany\t\tThe value to check.",
			"name": "value",
			"type": "any",
			"description": "The value to check."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the given value exists in the queue or not.",
		"type": "bool",
		"description": "Whether the given value exists in the queue or not."
	},
	"name_full": "worldeditadditions_core.Queue.contains",
	"filename": "worldeditadditions_core/utils/queue.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/queue.lua#L26-L29"
}

dequeue 🔗

Dequeues an item from the front of the queue.

Arguments

NameTypeDefault valueDescription

Returns

any|nil :

Returns the item at the front of the queue, or nil if no items are currently enqueued.

Source
--- Dequeues an item from the front of the queue.
-- @returns		any|nil		Returns the item at the front of the queue, or nil if no items are currently enqueued. 
function Queue:dequeue()
{
	"type": "function",
	"internal": false,
	"description": "Dequeues an item from the front of the queue.",
	"directives": [
		{
			"directive": "returns",
			"text": "any|nil\t\tReturns the item at the front of the queue, or nil if no items are currently enqueued.",
			"type": "any|nil",
			"description": "Returns the item at the front of the queue, or nil if no items are currently enqueued."
		}
	],
	"line": 51,
	"namespace": "worldeditadditions_core.Queue",
	"line_last": 53,
	"name": "dequeue",
	"instanced": true,
	"args": [
		""
	],
	"text": "--- Dequeues an item from the front of the queue.\n-- @returns\t\tany|nil\t\tReturns the item at the front of the queue, or nil if no items are currently enqueued. \nfunction Queue:dequeue()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "any|nil\t\tReturns the item at the front of the queue, or nil if no items are currently enqueued.",
		"type": "any|nil",
		"description": "Returns the item at the front of the queue, or nil if no items are currently enqueued."
	},
	"name_full": "worldeditadditions_core.Queue.dequeue",
	"filename": "worldeditadditions_core/utils/queue.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/queue.lua#L52-L54"
}

enqueue 🔗

Adds a new value to the end of the queue.

Arguments

NameTypeDefault valueDescription
valueanynil

The new value to add to the end of the queue.

Returns

number :

The index of the value that was added to the queue.

Source
--- Adds a new value to the end of the queue.
-- @param	value	any		The new value to add to the end of the queue.
-- @returns	number	The index of the value that was added to the queue.
function Queue:enqueue(value)
{
	"type": "function",
	"internal": false,
	"description": "Adds a new value to the end of the queue.",
	"directives": [
		{
			"directive": "param",
			"text": "value\tany\t\tThe new value to add to the end of the queue.",
			"name": "value",
			"type": "any",
			"description": "The new value to add to the end of the queue."
		},
		{
			"directive": "returns",
			"text": "number\tThe index of the value that was added to the queue.",
			"type": "number",
			"description": "The index of the value that was added to the queue."
		}
	],
	"line": 15,
	"namespace": "worldeditadditions_core.Queue",
	"line_last": 18,
	"name": "enqueue",
	"instanced": true,
	"args": [
		"value"
	],
	"text": "--- Adds a new value to the end of the queue.\n-- @param\tvalue\tany\t\tThe new value to add to the end of the queue.\n-- @returns\tnumber\tThe index of the value that was added to the queue.\nfunction Queue:enqueue(value)",
	"params": [
		{
			"directive": "param",
			"text": "value\tany\t\tThe new value to add to the end of the queue.",
			"name": "value",
			"type": "any",
			"description": "The new value to add to the end of the queue."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe index of the value that was added to the queue.",
		"type": "number",
		"description": "The index of the value that was added to the queue."
	},
	"name_full": "worldeditadditions_core.Queue.enqueue",
	"filename": "worldeditadditions_core/utils/queue.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/queue.lua#L16-L19"
}

is_empty 🔗

Returns whether the queue is empty or not.

Arguments

NameTypeDefault valueDescription

Returns

bool :

Whether the queue is empty or not.

Source
--- Returns whether the queue is empty or not.
-- @returns	bool	Whether the queue is empty or not.
function Queue:is_empty()
{
	"type": "function",
	"internal": false,
	"description": "Returns whether the queue is empty or not.",
	"directives": [
		{
			"directive": "returns",
			"text": "bool\tWhether the queue is empty or not.",
			"type": "bool",
			"description": "Whether the queue is empty or not."
		}
	],
	"line": 37,
	"namespace": "worldeditadditions_core.Queue",
	"line_last": 39,
	"name": "is_empty",
	"instanced": true,
	"args": [
		""
	],
	"text": "--- Returns whether the queue is empty or not.\n-- @returns\tbool\tWhether the queue is empty or not.\nfunction Queue:is_empty()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the queue is empty or not.",
		"type": "bool",
		"description": "Whether the queue is empty or not."
	},
	"name_full": "worldeditadditions_core.Queue.is_empty",
	"filename": "worldeditadditions_core/utils/queue.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/queue.lua#L38-L40"
}

new 🔗

Creates a new queue instance.

Arguments

NameTypeDefault valueDescription

Returns

Queue

Source
--- Creates a new queue instance.
-- @returns	Queue
function Queue.new()
{
	"type": "function",
	"internal": false,
	"description": "Creates a new queue instance.",
	"directives": [
		{
			"directive": "returns",
			"text": "Queue",
			"type": "Queue"
		}
	],
	"line": 7,
	"namespace": "worldeditadditions_core.Queue",
	"line_last": 9,
	"name": "new",
	"instanced": false,
	"args": [
		""
	],
	"text": "--- Creates a new queue instance.\n-- @returns\tQueue\nfunction Queue.new()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "Queue",
		"type": "Queue"
	},
	"name_full": "worldeditadditions_core.Queue.new",
	"filename": "worldeditadditions_core/utils/queue.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/queue.lua#L8-L10"
}

remove_index 🔗

Removes the item with the given index from the queue. Item indexes do not change as the items in a queue are added and removed.

Arguments

NameTypeDefault valueDescription
numberThe index of the item to remove from the queue.nil

Returns

nil

Source
--- Removes the item with the given index from the queue.
-- Item indexes do not change as the items in a queue are added and removed.
-- @param		number		The index of the item to remove from the queue.
-- @returns		nil
function Queue:remove_index(index)
{
	"type": "function",
	"internal": false,
	"description": "Removes the item with the given index from the queue.\nItem indexes do not change as the items in a queue are added and removed.",
	"directives": [
		{
			"directive": "param",
			"text": "number\t\tThe index of the item to remove from the queue.",
			"name": "number",
			"type": "The index of the item to remove from the queue."
		},
		{
			"directive": "returns",
			"text": "nil",
			"type": "nil"
		}
	],
	"line": 43,
	"namespace": "worldeditadditions_core.Queue",
	"line_last": 47,
	"name": "remove_index",
	"instanced": true,
	"args": [
		"index"
	],
	"text": "--- Removes the item with the given index from the queue.\n-- Item indexes do not change as the items in a queue are added and removed.\n-- @param\t\tnumber\t\tThe index of the item to remove from the queue.\n-- @returns\t\tnil\nfunction Queue:remove_index(index)",
	"params": [
		{
			"directive": "param",
			"text": "number\t\tThe index of the item to remove from the queue.",
			"name": "number",
			"type": "The index of the item to remove from the queue."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "nil",
		"type": "nil"
	},
	"name_full": "worldeditadditions_core.Queue.remove_index",
	"filename": "worldeditadditions_core/utils/queue.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/queue.lua#L44-L48"
}

rotation 🔗

Functions

find_rotated_vm 🔗

Applies a given list of rotatiosn rotlist to rotate pos1 and pos2 around a given origin, and returns a pos1/pos2 pair of a region that bounds the rotated area. The returned pos1/pos2 are guaranteed to be integer values that fully enclose the rotated region. This function is designed to be used to e.g. find the bounds of a region to pass to a VoxelManip to ensure we grab everything.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

Position 1 to rotate.

pos2Vector3nil

Position 2 to rotate.

originVector3nil

The position to rotate pos1 and pos2 around. May be a decimal value.

rotlisttable<{axis: string, rad: number}>nil

The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information.

Returns

Vector3,Vector3 :

A pos1 & pos2 that fully enclose the rotated region as described above.

Source
--- Applies a given list of rotatiosn rotlist to rotate pos1 and pos2 around a given origin, and returns a pos1/pos2 pair of a region that bounds the rotated area.
-- The returned pos1/pos2 are guaranteed to be integer values that fully enclose the rotated region. This function is designed to be used to e.g. find the bounds of a region to pass to a VoxelManip to ensure we grab everything.
-- @param	pos1	Vector3		Position 1 to rotate.
-- @param	pos2	Vector3		Position 2 to rotate.
-- @param	origin	Vector3		The position to rotate pos1 and pos2 around. May be a decimal value.
-- @param	rotlist	table<{axis: string, rad: number}>	The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information.
-- @returns	Vector3,Vector3	A pos1 & pos2 that fully enclose the rotated region as described above.
local function find_rotated_vm(pos1, pos2, origin, rotlist)
{
	"type": "function",
	"internal": false,
	"description": "Applies a given list of rotatiosn rotlist to rotate pos1 and pos2 around a given origin, and returns a pos1/pos2 pair of a region that bounds the rotated area.\nThe returned pos1/pos2 are guaranteed to be integer values that fully enclose the rotated region. This function is designed to be used to e.g. find the bounds of a region to pass to a VoxelManip to ensure we grab everything.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 to rotate.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 to rotate."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 to rotate.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 to rotate."
		},
		{
			"directive": "param",
			"text": "origin\tVector3\t\tThe position to rotate pos1 and pos2 around. May be a decimal value.",
			"name": "origin",
			"type": "Vector3",
			"description": "The position to rotate pos1 and pos2 around. May be a decimal value."
		},
		{
			"directive": "param",
			"text": "rotlist\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information.",
			"name": "rotlist",
			"type": "table<{axis: string, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information."
		},
		{
			"directive": "returns",
			"text": "Vector3,Vector3\tA pos1 & pos2 that fully enclose the rotated region as described above.",
			"type": "Vector3,Vector3",
			"description": "A pos1 & pos2 that fully enclose the rotated region as described above."
		}
	],
	"line": 42,
	"namespace": "worldeditadditions_core.rotation",
	"line_last": 49,
	"name": "find_rotated_vm",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"origin",
		"rotlist"
	],
	"text": "--- Applies a given list of rotatiosn rotlist to rotate pos1 and pos2 around a given origin, and returns a pos1/pos2 pair of a region that bounds the rotated area.\n-- The returned pos1/pos2 are guaranteed to be integer values that fully enclose the rotated region. This function is designed to be used to e.g. find the bounds of a region to pass to a VoxelManip to ensure we grab everything.\n-- @param\tpos1\tVector3\t\tPosition 1 to rotate.\n-- @param\tpos2\tVector3\t\tPosition 2 to rotate.\n-- @param\torigin\tVector3\t\tThe position to rotate pos1 and pos2 around. May be a decimal value.\n-- @param\trotlist\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information.\n-- @returns\tVector3,Vector3\tA pos1 & pos2 that fully enclose the rotated region as described above.\nlocal function find_rotated_vm(pos1, pos2, origin, rotlist)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tPosition 1 to rotate.",
			"name": "pos1",
			"type": "Vector3",
			"description": "Position 1 to rotate."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tPosition 2 to rotate.",
			"name": "pos2",
			"type": "Vector3",
			"description": "Position 2 to rotate."
		},
		{
			"directive": "param",
			"text": "origin\tVector3\t\tThe position to rotate pos1 and pos2 around. May be a decimal value.",
			"name": "origin",
			"type": "Vector3",
			"description": "The position to rotate pos1 and pos2 around. May be a decimal value."
		},
		{
			"directive": "param",
			"text": "rotlist\ttable<{axis: string, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information.",
			"name": "rotlist",
			"type": "table<{axis: string, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter), and an amount in radians to rotate by (the rad parameter). See worldeditadditions.rotate() for more information."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3,Vector3\tA pos1 & pos2 that fully enclose the rotated region as described above.",
		"type": "Vector3,Vector3",
		"description": "A pos1 & pos2 that fully enclose the rotated region as described above."
	},
	"name_full": "worldeditadditions_core.rotation.find_rotated_vm",
	"filename": "worldeditadditions_core/utils/rotation.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/rotation.lua#L43-L50"
}

rotlist_compile 🔗

Compiles a list of rotations into something we can iteratively pass to Vector3.rotate3d. This function is called internally. You are unlikely to need to call this function unless you are implementing something like worldeditadditions.rotate() or similar.

TODO Learn Quaternions.

Arguments

NameTypeDefault valueDescription
rotlisttable<{axis: string|Vector3, rad: number}>nil

The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter.

Returns

Vector3[] :

The list of the compiled rotations, in a form that Vector3.rotate3d understands.

Source
--- Compiles a list of rotations into something we can iteratively pass to Vector3.rotate3d.
-- This function is called internally. You are unlikely to need to call this function unless you are implementing something like worldeditadditions.rotate() or similar.
--
-- TODO Learn Quaternions.
-- @internal
-- @param	rotlist		table<{axis: string|Vector3, rad: number}>	The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter.
-- @returns	Vector3[]	The list of the compiled rotations, in a form that Vector3.rotate3d understands.
local function rotlist_compile(rotlist)
{
	"type": "function",
	"internal": true,
	"description": "Compiles a list of rotations into something we can iteratively pass to Vector3.rotate3d.\nThis function is called internally. You are unlikely to need to call this function unless you are implementing something like worldeditadditions.rotate() or similar.\n\nTODO Learn Quaternions.",
	"directives": [
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "rotlist\t\ttable<{axis: string|Vector3, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter.",
			"name": "rotlist",
			"type": "table<{axis: string|Vector3, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter."
		},
		{
			"directive": "returns",
			"text": "Vector3[]\tThe list of the compiled rotations, in a form that Vector3.rotate3d understands.",
			"type": "Vector3[]",
			"description": "The list of the compiled rotations, in a form that Vector3.rotate3d understands."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions_core.rotation",
	"line_last": 14,
	"name": "rotlist_compile",
	"instanced": false,
	"args": [
		"rotlist"
	],
	"text": "--- Compiles a list of rotations into something we can iteratively pass to Vector3.rotate3d.\n-- This function is called internally. You are unlikely to need to call this function unless you are implementing something like worldeditadditions.rotate() or similar.\n--\n-- TODO Learn Quaternions.\n-- @internal\n-- @param\trotlist\t\ttable<{axis: string|Vector3, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter.\n-- @returns\tVector3[]\tThe list of the compiled rotations, in a form that Vector3.rotate3d understands.\nlocal function rotlist_compile(rotlist)",
	"params": [
		{
			"directive": "param",
			"text": "rotlist\t\ttable<{axis: string|Vector3, rad: number}>\tThe list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter.",
			"name": "rotlist",
			"type": "table<{axis: string|Vector3, rad: number}>",
			"description": "The list of rotations. Rotations will be processed in order. Each rotation is a table with a SINGLE axis as a string (x, y, z, -x, -y, or -z; the axis parameter) or a Vector3 (only a SINGLE AXIS set to anything other than 0, and ONLY with a value of 1 or -1), and an amount in radians to rotate by (the rad parameter."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3[]\tThe list of the compiled rotations, in a form that Vector3.rotate3d understands.",
		"type": "Vector3[]",
		"description": "The list of the compiled rotations, in a form that Vector3.rotate3d understands."
	},
	"name_full": "worldeditadditions_core.rotation.rotlist_compile",
	"filename": "worldeditadditions_core/utils/rotation.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/rotation.lua#L8-L15"
}

Set 🔗

Set implementation for Lua.

Functions

add 🔗

Adds item(s) to set.

Arguments

NameTypeDefault valueDescription
asetnil

Set to manipulate.

inot nilnil

Values(s) to add.

Returns

bool :

Success of operation.

Source
--- Adds item(s) to set.
-- @param	a	set	Set to manipulate.
-- @param	i	not nil	Values(s) to add.
-- @returns	bool	Success of operation.
function Set.add(a,i)
{
	"type": "function",
	"internal": false,
	"description": "Adds item(s) to set.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tset\tSet to manipulate.",
			"name": "a",
			"type": "set",
			"description": "Set to manipulate."
		},
		{
			"directive": "param",
			"text": "i\tnot nil\tValues(s) to add.",
			"name": "i",
			"type": "not nil",
			"description": "Values(s) to add."
		},
		{
			"directive": "returns",
			"text": "bool\tSuccess of operation.",
			"type": "bool",
			"description": "Success of operation."
		}
	],
	"line": 44,
	"namespace": "worldeditadditions_core.Set",
	"line_last": 48,
	"name": "add",
	"instanced": false,
	"args": [
		"a",
		"i"
	],
	"text": "--- Adds item(s) to set.\n-- @param\ta\tset\tSet to manipulate.\n-- @param\ti\tnot nil\tValues(s) to add.\n-- @returns\tbool\tSuccess of operation.\nfunction Set.add(a,i)",
	"params": [
		{
			"directive": "param",
			"text": "a\tset\tSet to manipulate.",
			"name": "a",
			"type": "set",
			"description": "Set to manipulate."
		},
		{
			"directive": "param",
			"text": "i\tnot nil\tValues(s) to add.",
			"name": "i",
			"type": "not nil",
			"description": "Values(s) to add."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tSuccess of operation.",
		"type": "bool",
		"description": "Success of operation."
	},
	"name_full": "worldeditadditions_core.Set.add",
	"filename": "worldeditadditions_core/utils/set.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/set.lua#L45-L49"
}

delete 🔗

Deletes item(s) from set.

Arguments

NameTypeDefault valueDescription
asetnil

Set to manipulate.

inot nilnil

Values(s) to delete.

Returns

bool :

Success of operation.

Source
--- Deletes item(s) from set.
-- @param	a	set	Set to manipulate.
-- @param	i	not nil	Values(s) to delete.
-- @returns	bool	Success of operation.
function Set.delete(a,i)
{
	"type": "function",
	"internal": false,
	"description": "Deletes item(s) from set.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tset\tSet to manipulate.",
			"name": "a",
			"type": "set",
			"description": "Set to manipulate."
		},
		{
			"directive": "param",
			"text": "i\tnot nil\tValues(s) to delete.",
			"name": "i",
			"type": "not nil",
			"description": "Values(s) to delete."
		},
		{
			"directive": "returns",
			"text": "bool\tSuccess of operation.",
			"type": "bool",
			"description": "Success of operation."
		}
	],
	"line": 57,
	"namespace": "worldeditadditions_core.Set",
	"line_last": 61,
	"name": "delete",
	"instanced": false,
	"args": [
		"a",
		"i"
	],
	"text": "--- Deletes item(s) from set.\n-- @param\ta\tset\tSet to manipulate.\n-- @param\ti\tnot nil\tValues(s) to delete.\n-- @returns\tbool\tSuccess of operation.\nfunction Set.delete(a,i)",
	"params": [
		{
			"directive": "param",
			"text": "a\tset\tSet to manipulate.",
			"name": "a",
			"type": "set",
			"description": "Set to manipulate."
		},
		{
			"directive": "param",
			"text": "i\tnot nil\tValues(s) to delete.",
			"name": "i",
			"type": "not nil",
			"description": "Values(s) to delete."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tSuccess of operation.",
		"type": "bool",
		"description": "Success of operation."
	},
	"name_full": "worldeditadditions_core.Set.delete",
	"filename": "worldeditadditions_core/utils/set.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/set.lua#L58-L62"
}

has 🔗

Checks if value(s) are present in set.

Arguments

NameTypeDefault valueDescription
asetnil

Set to inspect.

inot nilnil

Values(s) to check.

Returns

bool :

Value(s) are present?

Source
--- Checks if value(s) are present in set.
-- @param	a	set	Set to inspect.
-- @param	i	not nil	Values(s) to check.
-- @returns	bool	Value(s) are present?
function Set.has(a,i)
{
	"type": "function",
	"internal": false,
	"description": "Checks if value(s) are present in set.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tset\tSet to inspect.",
			"name": "a",
			"type": "set",
			"description": "Set to inspect."
		},
		{
			"directive": "param",
			"text": "i\tnot nil\tValues(s) to check.",
			"name": "i",
			"type": "not nil",
			"description": "Values(s) to check."
		},
		{
			"directive": "returns",
			"text": "bool\tValue(s) are present?",
			"type": "bool",
			"description": "Value(s) are present?"
		}
	],
	"line": 70,
	"namespace": "worldeditadditions_core.Set",
	"line_last": 74,
	"name": "has",
	"instanced": false,
	"args": [
		"a",
		"i"
	],
	"text": "--- Checks if value(s) are present in set.\n-- @param\ta\tset\tSet to inspect.\n-- @param\ti\tnot nil\tValues(s) to check.\n-- @returns\tbool\tValue(s) are present?\nfunction Set.has(a,i)",
	"params": [
		{
			"directive": "param",
			"text": "a\tset\tSet to inspect.",
			"name": "a",
			"type": "set",
			"description": "Set to inspect."
		},
		{
			"directive": "param",
			"text": "i\tnot nil\tValues(s) to check.",
			"name": "i",
			"type": "not nil",
			"description": "Values(s) to check."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tValue(s) are present?",
		"type": "bool",
		"description": "Value(s) are present?"
	},
	"name_full": "worldeditadditions_core.Set.has",
	"filename": "worldeditadditions_core/utils/set.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/set.lua#L71-L75"
}

new 🔗

Creates a new set.

Arguments

NameTypeDefault valueDescription
ianynil

Initial values(s) of the set.

Returns

Set :

A table of keys equal to true.

Source
--- Creates a new set.
-- @param	i	any	Initial values(s) of the set.
-- @returns	Set	A table of keys equal to true.
function Set.new(i)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new set.",
	"directives": [
		{
			"directive": "param",
			"text": "i\tany\tInitial values(s) of the set.",
			"name": "i",
			"type": "any",
			"description": "Initial values(s) of the set."
		},
		{
			"directive": "returns",
			"text": "Set\tA table of keys equal to true.",
			"type": "Set",
			"description": "A table of keys equal to true."
		}
	],
	"line": 29,
	"namespace": "worldeditadditions_core.Set",
	"line_last": 32,
	"name": "new",
	"instanced": false,
	"args": [
		"i"
	],
	"text": "--- Creates a new set.\n-- @param\ti\tany\tInitial values(s) of the set.\n-- @returns\tSet\tA table of keys equal to true.\nfunction Set.new(i)",
	"params": [
		{
			"directive": "param",
			"text": "i\tany\tInitial values(s) of the set.",
			"name": "i",
			"type": "any",
			"description": "Initial values(s) of the set."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Set\tA table of keys equal to true.",
		"type": "Set",
		"description": "A table of keys equal to true."
	},
	"name_full": "worldeditadditions_core.Set.new",
	"filename": "worldeditadditions_core/utils/set.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/set.lua#L30-L33"
}

setting_handler 🔗

A wrapper to simultaniously handle global and world settings.


terrain 🔗

Functions for working with 2D terrain maps.

Functions

apply_heightmap_changes 🔗

Applies changes to a heightmap to a Voxel Manipulator data block.

Arguments

NameTypeDefault valueDescription
pos1vectornil

Position 1 of the defined region

pos2vectornil

Position 2 of the defined region

areaVoxelAreanil

The VoxelArea object (see worldedit.manip_helpers.init)

datanumber[]nil

The node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator.

heightmap_oldnumber[]nil

The original heightmap from worldeditadditions.make_heightmap.

heightmap_newnumber[]nil

The new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work.

heightmap_sizevectornil

The x / z size of the heightmap. Any y value set in the vector is ignored.

Returns

bool, string|{ added: number, removed: number } :

A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).

Source
--- Applies changes to a heightmap to a Voxel Manipulator data block.
-- @param	pos1	vector		Position 1 of the defined region
-- @param	pos2	vector		Position 2 of the defined region
-- @param	area	VoxelArea	The VoxelArea object (see worldedit.manip_helpers.init)
-- @param	data	number[]	The node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator.
-- @param	heightmap_old	number[]	The original heightmap from worldeditadditions.make_heightmap.
-- @param	heightmap_new	number[]	The new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work.
-- @param	heightmap_size	vector	The x / z size of the heightmap. Any y value set in the vector is ignored.
-- @returns	bool, string|{ added: number, removed: number }	A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).
local function apply_heightmap_changes(pos1, pos2, area, data, heightmap_old, heightmap_new, heightmap_size)
{
	"type": "function",
	"internal": false,
	"description": "Applies changes to a heightmap to a Voxel Manipulator data block.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tvector\t\tPosition 1 of the defined region",
			"name": "pos1",
			"type": "vector",
			"description": "Position 1 of the defined region"
		},
		{
			"directive": "param",
			"text": "pos2\tvector\t\tPosition 2 of the defined region",
			"name": "pos2",
			"type": "vector",
			"description": "Position 2 of the defined region"
		},
		{
			"directive": "param",
			"text": "area\tVoxelArea\tThe VoxelArea object (see worldedit.manip_helpers.init)",
			"name": "area",
			"type": "VoxelArea",
			"description": "The VoxelArea object (see worldedit.manip_helpers.init)"
		},
		{
			"directive": "param",
			"text": "data\tnumber[]\tThe node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator.",
			"name": "data",
			"type": "number[]",
			"description": "The node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator."
		},
		{
			"directive": "param",
			"text": "heightmap_old\tnumber[]\tThe original heightmap from worldeditadditions.make_heightmap.",
			"name": "heightmap_old",
			"type": "number[]",
			"description": "The original heightmap from worldeditadditions.make_heightmap."
		},
		{
			"directive": "param",
			"text": "heightmap_new\tnumber[]\tThe new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work.",
			"name": "heightmap_new",
			"type": "number[]",
			"description": "The new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tvector\tThe x / z size of the heightmap. Any y value set in the vector is ignored.",
			"name": "heightmap_size",
			"type": "vector",
			"description": "The x / z size of the heightmap. Any y value set in the vector is ignored."
		},
		{
			"directive": "returns",
			"text": "bool, string|{ added: number, removed: number }\tA bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).",
			"type": "bool, string|{ added: number, removed: number }",
			"description": "A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful)."
		}
	],
	"line": 7,
	"namespace": "worldeditadditions_core.terrain",
	"line_last": 16,
	"name": "apply_heightmap_changes",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"area",
		"data",
		"heightmap_old",
		"heightmap_new",
		"heightmap_size"
	],
	"text": "--- Applies changes to a heightmap to a Voxel Manipulator data block.\n-- @param\tpos1\tvector\t\tPosition 1 of the defined region\n-- @param\tpos2\tvector\t\tPosition 2 of the defined region\n-- @param\tarea\tVoxelArea\tThe VoxelArea object (see worldedit.manip_helpers.init)\n-- @param\tdata\tnumber[]\tThe node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator.\n-- @param\theightmap_old\tnumber[]\tThe original heightmap from worldeditadditions.make_heightmap.\n-- @param\theightmap_new\tnumber[]\tThe new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work.\n-- @param\theightmap_size\tvector\tThe x / z size of the heightmap. Any y value set in the vector is ignored.\n-- @returns\tbool, string|{ added: number, removed: number }\tA bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).\nlocal function apply_heightmap_changes(pos1, pos2, area, data, heightmap_old, heightmap_new, heightmap_size)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tvector\t\tPosition 1 of the defined region",
			"name": "pos1",
			"type": "vector",
			"description": "Position 1 of the defined region"
		},
		{
			"directive": "param",
			"text": "pos2\tvector\t\tPosition 2 of the defined region",
			"name": "pos2",
			"type": "vector",
			"description": "Position 2 of the defined region"
		},
		{
			"directive": "param",
			"text": "area\tVoxelArea\tThe VoxelArea object (see worldedit.manip_helpers.init)",
			"name": "area",
			"type": "VoxelArea",
			"description": "The VoxelArea object (see worldedit.manip_helpers.init)"
		},
		{
			"directive": "param",
			"text": "data\tnumber[]\tThe node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator.",
			"name": "data",
			"type": "number[]",
			"description": "The node ids data array containing the slice of the Minetest world extracted using the Voxel Manipulator."
		},
		{
			"directive": "param",
			"text": "heightmap_old\tnumber[]\tThe original heightmap from worldeditadditions.make_heightmap.",
			"name": "heightmap_old",
			"type": "number[]",
			"description": "The original heightmap from worldeditadditions.make_heightmap."
		},
		{
			"directive": "param",
			"text": "heightmap_new\tnumber[]\tThe new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work.",
			"name": "heightmap_new",
			"type": "number[]",
			"description": "The new heightmap containing the altered updated values. It is expected that worldeditadditions.table.shallowcopy be used to make a COPY of the data worldeditadditions.make_heightmap for this purpose. Both heightmap_old AND heightmap_new are REQUIRED in order for this function to work."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tvector\tThe x / z size of the heightmap. Any y value set in the vector is ignored.",
			"name": "heightmap_size",
			"type": "vector",
			"description": "The x / z size of the heightmap. Any y value set in the vector is ignored."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool, string|{ added: number, removed: number }\tA bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful).",
		"type": "bool, string|{ added: number, removed: number }",
		"description": "A bool indicating whether the operation was successful or not, followed by either an error message as a string (if it was not successful) or a table of statistics (if it was successful)."
	},
	"name_full": "worldeditadditions_core.terrain.apply_heightmap_changes",
	"filename": "worldeditadditions_core/utils/terrain/apply_heightmap_changes.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/terrain/apply_heightmap_changes.lua#L8-L17"
}

calculate_normals 🔗

Calculates a normal map for the given heightmap. Caution: This method (like worldeditadditions.make_heightmap) works on X AND Z, and NOT x and y. This means that the resulting 3d normal vectors will have the z and y values swapped.

Arguments

NameTypeDefault valueDescription
heightmaptablenil

A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().

heightmap_sizeint[]nil

The size of the heightmap in the form [ z, x ]

Returns

Vector[] :

The calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal.

Source
--- Calculates a normal map for the given heightmap.
-- Caution: This method (like worldeditadditions.make_heightmap) works on
-- X AND Z, and NOT x and y. This means that the resulting 3d normal vectors
-- will have the z and y values swapped.
-- @param	heightmap		table	A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().
-- @param	heightmap_size	int[]	The size of the heightmap in the form [ z, x ]
-- @return	Vector[]		The calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal.
local function calculate_normals(heightmap, heightmap_size)
{
	"type": "function",
	"internal": false,
	"description": "Calculates a normal map for the given heightmap.\nCaution: This method (like worldeditadditions.make_heightmap) works on\nX AND Z, and NOT x and y. This means that the resulting 3d normal vectors\nwill have the z and y values swapped.",
	"directives": [
		{
			"directive": "param",
			"text": "heightmap\t\ttable\tA ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().",
			"name": "heightmap",
			"type": "table",
			"description": "A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap()."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tint[]\tThe size of the heightmap in the form [ z, x ]",
			"name": "heightmap_size",
			"type": "int[]",
			"description": "The size of the heightmap in the form [ z, x ]"
		},
		{
			"directive": "returns",
			"text": "Vector[]\t\tThe calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal.",
			"type": "Vector[]",
			"description": "The calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core.terrain",
	"line_last": 13,
	"name": "calculate_normals",
	"instanced": false,
	"args": [
		"heightmap",
		"heightmap_size"
	],
	"text": "--- Calculates a normal map for the given heightmap.\n-- Caution: This method (like worldeditadditions.make_heightmap) works on\n-- X AND Z, and NOT x and y. This means that the resulting 3d normal vectors\n-- will have the z and y values swapped.\n-- @param\theightmap\t\ttable\tA ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().\n-- @param\theightmap_size\tint[]\tThe size of the heightmap in the form [ z, x ]\n-- @return\tVector[]\t\tThe calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal.\nlocal function calculate_normals(heightmap, heightmap_size)",
	"params": [
		{
			"directive": "param",
			"text": "heightmap\t\ttable\tA ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().",
			"name": "heightmap",
			"type": "table",
			"description": "A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap()."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tint[]\tThe size of the heightmap in the form [ z, x ]",
			"name": "heightmap_size",
			"type": "int[]",
			"description": "The size of the heightmap in the form [ z, x ]"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector[]\t\tThe calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal.",
		"type": "Vector[]",
		"description": "The calculated normal map, in the same form as the input heightmap. Each element of the array is a Vector3 instance representing a normal."
	},
	"name_full": "worldeditadditions_core.terrain.calculate_normals",
	"filename": "worldeditadditions_core/utils/terrain/calculate_normals.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/terrain/calculate_normals.lua#L7-L14"
}

calculate_slopes 🔗

Converts a 2d heightmap into slope values in radians. Convert a radians to degrees by doing (radians*math.pi) / 180 for display, but it is STRONGLY recommended to keep all internal calculations in radians.

Arguments

NameTypeDefault valueDescription
heightmaptablenil

A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().

heightmap_sizeint[]nil

The size of the heightmap in the form [ z, x ]

Returns

Vector[] :

The calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians.

Source
--- Converts a 2d heightmap into slope values in radians.
-- Convert a radians to degrees by doing (radians*math.pi) / 180 for display,
-- but it is STRONGLY recommended to keep all internal calculations in radians.
-- @param	heightmap		table	A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().
-- @param	heightmap_size	int[]	The size of the heightmap in the form [ z, x ]
-- @return	Vector[]		The calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians.
local function calculate_slopes(heightmap, heightmap_size)
{
	"type": "function",
	"internal": false,
	"description": "Converts a 2d heightmap into slope values in radians.\nConvert a radians to degrees by doing (radians*math.pi) / 180 for display,\nbut it is STRONGLY recommended to keep all internal calculations in radians.",
	"directives": [
		{
			"directive": "param",
			"text": "heightmap\t\ttable\tA ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().",
			"name": "heightmap",
			"type": "table",
			"description": "A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap()."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tint[]\tThe size of the heightmap in the form [ z, x ]",
			"name": "heightmap_size",
			"type": "int[]",
			"description": "The size of the heightmap in the form [ z, x ]"
		},
		{
			"directive": "returns",
			"text": "Vector[]\t\tThe calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians.",
			"type": "Vector[]",
			"description": "The calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core.terrain",
	"line_last": 12,
	"name": "calculate_slopes",
	"instanced": false,
	"args": [
		"heightmap",
		"heightmap_size"
	],
	"text": "--- Converts a 2d heightmap into slope values in radians.\n-- Convert a radians to degrees by doing (radians*math.pi) / 180 for display,\n-- but it is STRONGLY recommended to keep all internal calculations in radians.\n-- @param\theightmap\t\ttable\tA ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().\n-- @param\theightmap_size\tint[]\tThe size of the heightmap in the form [ z, x ]\n-- @return\tVector[]\t\tThe calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians.\nlocal function calculate_slopes(heightmap, heightmap_size)",
	"params": [
		{
			"directive": "param",
			"text": "heightmap\t\ttable\tA ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap().",
			"name": "heightmap",
			"type": "table",
			"description": "A ZERO indexed flat heightmap. See worldeditadditions.terrain.make_heightmap()."
		},
		{
			"directive": "param",
			"text": "heightmap_size\tint[]\tThe size of the heightmap in the form [ z, x ]",
			"name": "heightmap_size",
			"type": "int[]",
			"description": "The size of the heightmap in the form [ z, x ]"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector[]\t\tThe calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians.",
		"type": "Vector[]",
		"description": "The calculated slope map, in the same form as the input heightmap. Each element of the array is a (floating-point) number representing the slope in that cell in radians."
	},
	"name_full": "worldeditadditions_core.terrain.calculate_slopes",
	"filename": "worldeditadditions_core/utils/terrain/calculate_slopes.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/terrain/calculate_slopes.lua#L7-L13"
}

make_heightmap 🔗

Given a manip object and associates, generates a 2D x/z heightmap. Note that pos1 and pos2 should have already been pushed through worldedit.sort_pos(pos1, pos2) before passing them to this function.

Arguments

NameTypeDefault valueDescription
pos1Vectornil

Position 1 of the region to operate on

pos2Vectornil

Position 2 of the region to operate on

manipVoxelManipnil

The VoxelManip object.

areaareanil

The associated area object.

datatablenil

The associated data object.

Returns

table,table :

The ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }.

Source
--- Given a manip object and associates, generates a 2D x/z heightmap.
-- Note that pos1 and pos2 should have already been pushed through
-- worldedit.sort_pos(pos1, pos2) before passing them to this function.
-- @param	pos1	Vector		Position 1 of the region to operate on
-- @param	pos2	Vector		Position 2 of the region to operate on
-- @param	manip	VoxelManip	The VoxelManip object.
-- @param	area	area		The associated area object.
-- @param	data	table		The associated data object.
-- @return	table,table			The ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }.
local function make_heightmap(pos1, pos2, manip, area, data)
{
	"type": "function",
	"internal": false,
	"description": "Given a manip object and associates, generates a 2D x/z heightmap.\nNote that pos1 and pos2 should have already been pushed through\nworldedit.sort_pos(pos1, pos2) before passing them to this function.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector\t\tPosition 1 of the region to operate on",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "pos2\tVector\t\tPosition 2 of the region to operate on",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "manip\tVoxelManip\tThe VoxelManip object.",
			"name": "manip",
			"type": "VoxelManip",
			"description": "The VoxelManip object."
		},
		{
			"directive": "param",
			"text": "area\tarea\t\tThe associated area object.",
			"name": "area",
			"type": "area",
			"description": "The associated area object."
		},
		{
			"directive": "param",
			"text": "data\ttable\t\tThe associated data object.",
			"name": "data",
			"type": "table",
			"description": "The associated data object."
		},
		{
			"directive": "returns",
			"text": "table,table\t\t\tThe ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }.",
			"type": "table,table",
			"description": "The ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core.terrain",
	"line_last": 15,
	"name": "make_heightmap",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"manip",
		"area",
		"data"
	],
	"text": "--- Given a manip object and associates, generates a 2D x/z heightmap.\n-- Note that pos1 and pos2 should have already been pushed through\n-- worldedit.sort_pos(pos1, pos2) before passing them to this function.\n-- @param\tpos1\tVector\t\tPosition 1 of the region to operate on\n-- @param\tpos2\tVector\t\tPosition 2 of the region to operate on\n-- @param\tmanip\tVoxelManip\tThe VoxelManip object.\n-- @param\tarea\tarea\t\tThe associated area object.\n-- @param\tdata\ttable\t\tThe associated data object.\n-- @return\ttable,table\t\t\tThe ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }.\nlocal function make_heightmap(pos1, pos2, manip, area, data)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector\t\tPosition 1 of the region to operate on",
			"name": "pos1",
			"type": "Vector",
			"description": "Position 1 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "pos2\tVector\t\tPosition 2 of the region to operate on",
			"name": "pos2",
			"type": "Vector",
			"description": "Position 2 of the region to operate on"
		},
		{
			"directive": "param",
			"text": "manip\tVoxelManip\tThe VoxelManip object.",
			"name": "manip",
			"type": "VoxelManip",
			"description": "The VoxelManip object."
		},
		{
			"directive": "param",
			"text": "area\tarea\t\tThe associated area object.",
			"name": "area",
			"type": "area",
			"description": "The associated area object."
		},
		{
			"directive": "param",
			"text": "data\ttable\t\tThe associated data object.",
			"name": "data",
			"type": "table",
			"description": "The associated data object."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table,table\t\t\tThe ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }.",
		"type": "table,table",
		"description": "The ZERO-indexed heightmap data (as 1 single flat array), followed by the size of the heightmap in the form { z = size_z, x = size_x }."
	},
	"name_full": "worldeditadditions_core.terrain.make_heightmap",
	"filename": "worldeditadditions_core/utils/terrain/make_heightmap.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/terrain/make_heightmap.lua#L7-L16"
}

Vector3 🔗

A 3-dimensional vector.

Functions

abs 🔗

Returns the absolute form of this vector. In other words, it removes the minus sign from all components of the vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

The absolute form of the given vector.

Source
--- Returns the absolute form of this vector.
-- In other words, it removes the minus sign from all components of the vector.
-- @param	a		Vector3		The vector to operate on.
-- @returns	Vector3	The absolute form of the given vector.
function Vector3.abs(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns the absolute form of this vector.\nIn other words, it removes the minus sign from all components of the vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tThe absolute form of the given vector.",
			"type": "Vector3",
			"description": "The absolute form of the given vector."
		}
	],
	"line": 268,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 272,
	"name": "abs",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns the absolute form of this vector.\n-- In other words, it removes the minus sign from all components of the vector.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tThe absolute form of the given vector.\nfunction Vector3.abs(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tThe absolute form of the given vector.",
		"type": "Vector3",
		"description": "The absolute form of the given vector."
	},
	"name_full": "worldeditadditions_core.Vector3.abs",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L269-L273"
}

add 🔗

Adds the specified vectors or numbers together. Returns the result as a new vector. If 1 of the inputs is a number and the other a vector, then the number will be added to each of the components of the vector.

Arguments

NameTypeDefault valueDescription
aVector3|numbernil

The first item to add.

aVector3|numbernil

The second item to add.

Returns

Vector3 :

The result as a new Vector3 object.

Source
--- Adds the specified vectors or numbers together.
-- Returns the result as a new vector.
-- If 1 of the inputs is a number and the other a vector, then the number will
-- be added to each of the components of the vector.
-- @param	a	Vector3|number	The first item to add.
-- @param	a	Vector3|number	The second item to add.
-- @returns	Vector3				The result as a new Vector3 object.
function Vector3.add(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Adds the specified vectors or numbers together.\nReturns the result as a new vector.\nIf 1 of the inputs is a number and the other a vector, then the number will\nbe added to each of the components of the vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to add.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to add."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to add.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to add."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
			"type": "Vector3",
			"description": "The result as a new Vector3 object."
		}
	],
	"line": 31,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 38,
	"name": "add",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Adds the specified vectors or numbers together.\n-- Returns the result as a new vector.\n-- If 1 of the inputs is a number and the other a vector, then the number will\n-- be added to each of the components of the vector.\n-- @param\ta\tVector3|number\tThe first item to add.\n-- @param\ta\tVector3|number\tThe second item to add.\n-- @returns\tVector3\t\t\t\tThe result as a new Vector3 object.\nfunction Vector3.add(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to add.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to add."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to add.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to add."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
		"type": "Vector3",
		"description": "The result as a new Vector3 object."
	},
	"name_full": "worldeditadditions_core.Vector3.add",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L32-L39"
}

area 🔗

Returns the area of this vector. In other words, multiplies all the components together and returns a scalar value.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to return the area of.

Returns

number :

The area of this vector.

Source
--- Returns the area of this vector.
-- In other words, multiplies all the components together and returns a scalar value.
-- @param	a		Vector3		The vector to return the area of.
-- @returns	number	The area of this vector.
function Vector3.area(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns the area of this vector.\nIn other words, multiplies all the components together and returns a scalar value.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to return the area of.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to return the area of."
		},
		{
			"directive": "returns",
			"text": "number\tThe area of this vector.",
			"type": "number",
			"description": "The area of this vector."
		}
	],
	"line": 146,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 150,
	"name": "area",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns the area of this vector.\n-- In other words, multiplies all the components together and returns a scalar value.\n-- @param\ta\t\tVector3\t\tThe vector to return the area of.\n-- @returns\tnumber\tThe area of this vector.\nfunction Vector3.area(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to return the area of.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to return the area of."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe area of this vector.",
		"type": "number",
		"description": "The area of this vector."
	},
	"name_full": "worldeditadditions_core.Vector3.area",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L147-L151"
}

ceil 🔗

Rounds the components of this vector up.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

A new instance with the x/y/z components rounded up.

Source
--- Rounds the components of this vector up.
-- @param 	a		Vector3		The vector to operate on.
-- @returns	Vector3	A new instance with the x/y/z components rounded up.
function Vector3.ceil(a)
{
	"type": "function",
	"internal": false,
	"description": "Rounds the components of this vector up.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new instance with the x/y/z components rounded up.",
			"type": "Vector3",
			"description": "A new instance with the x/y/z components rounded up."
		}
	],
	"line": 114,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 117,
	"name": "ceil",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Rounds the components of this vector up.\n-- @param \ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tA new instance with the x/y/z components rounded up.\nfunction Vector3.ceil(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new instance with the x/y/z components rounded up.",
		"type": "Vector3",
		"description": "A new instance with the x/y/z components rounded up."
	},
	"name_full": "worldeditadditions_core.Vector3.ceil",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L115-L118"
}

clamp 🔗

Clamps the given point to fall within the region defined by 2 points.

Arguments

NameTypeDefault valueDescription
aVector3nil

The target vector to clamp.

pos1Vector3nil

pos1 of the defined region.

pos2Vector3nil

pos2 of the defined region.

Returns

Vector3 :

The target vector, clamped to fall within the defined region.

Source
--- Clamps the given point to fall within the region defined by 2 points.
-- @param	a		Vector3		The target vector to clamp.
-- @param	pos1	Vector3	pos1 of the defined region.
-- @param	pos2	Vector3	pos2 of the defined region.
-- @returns	Vector3	The target vector, clamped to fall within the defined region.
function Vector3.clamp(a, pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Clamps the given point to fall within the region defined by 2 points.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe target vector to clamp.",
			"name": "a",
			"type": "Vector3",
			"description": "The target vector to clamp."
		},
		{
			"directive": "param",
			"text": "pos1\tVector3\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "returns",
			"text": "Vector3\tThe target vector, clamped to fall within the defined region.",
			"type": "Vector3",
			"description": "The target vector, clamped to fall within the defined region."
		}
	],
	"line": 319,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 324,
	"name": "clamp",
	"instanced": false,
	"args": [
		"a",
		"pos1",
		"pos2"
	],
	"text": "--- Clamps the given point to fall within the region defined by 2 points.\n-- @param\ta\t\tVector3\t\tThe target vector to clamp.\n-- @param\tpos1\tVector3\tpos1 of the defined region.\n-- @param\tpos2\tVector3\tpos2 of the defined region.\n-- @returns\tVector3\tThe target vector, clamped to fall within the defined region.\nfunction Vector3.clamp(a, pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe target vector to clamp.",
			"name": "a",
			"type": "Vector3",
			"description": "The target vector to clamp."
		},
		{
			"directive": "param",
			"text": "pos1\tVector3\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tThe target vector, clamped to fall within the defined region.",
		"type": "Vector3",
		"description": "The target vector, clamped to fall within the defined region."
	},
	"name_full": "worldeditadditions_core.Vector3.clamp",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L320-L325"
}

clone 🔗

Returns a new instance of this vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to clone.

Returns

Vector3 :

A new vector whose values are identical to those of the original vector.

Source
--- Returns a new instance of this vector.
-- @param	a			Vector3		The vector to clone.
-- @returns	Vector3		A new vector whose values are identical to those of the original vector.
function Vector3.clone(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns a new instance of this vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\t\tVector3\t\tThe vector to clone.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to clone."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\tA new vector whose values are identical to those of the original vector.",
			"type": "Vector3",
			"description": "A new vector whose values are identical to those of the original vector."
		}
	],
	"line": 24,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 27,
	"name": "clone",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns a new instance of this vector.\n-- @param\ta\t\t\tVector3\t\tThe vector to clone.\n-- @returns\tVector3\t\tA new vector whose values are identical to those of the original vector.\nfunction Vector3.clone(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\t\tVector3\t\tThe vector to clone.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to clone."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\tA new vector whose values are identical to those of the original vector.",
		"type": "Vector3",
		"description": "A new vector whose values are identical to those of the original vector."
	},
	"name_full": "worldeditadditions_core.Vector3.clone",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L25-L28"
}

divide 🔗

Divides the specified vectors or numbers together. Returns the result as a new vector. If 1 of the inputs is a number and the other a vector, then the number will be divided to each of the components of the vector.

Arguments

NameTypeDefault valueDescription
aVector3|numbernil

The first item to divide.

aVector3|numbernil

The second item to divide.

Returns

Vector3 :

The result as a new Vector3 object.

Source
--- Divides the specified vectors or numbers together.
-- Returns the result as a new vector.
-- If 1 of the inputs is a number and the other a vector, then the number will
-- be divided to each of the components of the vector.
-- @param	a	Vector3|number	The first item to divide.
-- @param	a	Vector3|number	The second item to divide.
-- @returns	Vector3				The result as a new Vector3 object.
function Vector3.divide(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Divides the specified vectors or numbers together.\nReturns the result as a new vector.\nIf 1 of the inputs is a number and the other a vector, then the number will\nbe divided to each of the components of the vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to divide.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to divide."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to divide.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to divide."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
			"type": "Vector3",
			"description": "The result as a new Vector3 object."
		}
	],
	"line": 88,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 95,
	"name": "divide",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Divides the specified vectors or numbers together.\n-- Returns the result as a new vector.\n-- If 1 of the inputs is a number and the other a vector, then the number will\n-- be divided to each of the components of the vector.\n-- @param\ta\tVector3|number\tThe first item to divide.\n-- @param\ta\tVector3|number\tThe second item to divide.\n-- @returns\tVector3\t\t\t\tThe result as a new Vector3 object.\nfunction Vector3.divide(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to divide.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to divide."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to divide.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to divide."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
		"type": "Vector3",
		"description": "The result as a new Vector3 object."
	},
	"name_full": "worldeditadditions_core.Vector3.divide",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L89-L96"
}

dot 🔗

Calculates the dot product of this vector and another vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The first vector to operate on.

aVector3nil

The second vector to operate on.

Returns

number :

The dot product of this vector as a scalar value.

Source
--- Calculates the dot product of this vector and another vector.
-- @param	a		Vector3		The first vector to operate on.
-- @param	a		Vector3		The second vector to operate on.
-- @returns	number	The dot product of this vector as a scalar value.
function Vector3.dot(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Calculates the dot product of this vector and another vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe first vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe second vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The second vector to operate on."
		},
		{
			"directive": "returns",
			"text": "number\tThe dot product of this vector as a scalar value.",
			"type": "number",
			"description": "The dot product of this vector as a scalar value."
		}
	],
	"line": 185,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 189,
	"name": "dot",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Calculates the dot product of this vector and another vector.\n-- @param\ta\t\tVector3\t\tThe first vector to operate on.\n-- @param\ta\t\tVector3\t\tThe second vector to operate on.\n-- @returns\tnumber\tThe dot product of this vector as a scalar value.\nfunction Vector3.dot(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe first vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe second vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The second vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe dot product of this vector as a scalar value.",
		"type": "number",
		"description": "The dot product of this vector as a scalar value."
	},
	"name_full": "worldeditadditions_core.Vector3.dot",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L186-L190"
}

equals 🔗

Determines if 2 vectors are equal to each other. 2 vectors are equal if their values are identical.

Arguments

NameTypeDefault valueDescription
aVector3nil

The first vector to test.

aVector3nil

The second vector to test.

Returns

bool :

Whether the 2 vectors are equal or not.

Source
--- Determines if 2 vectors are equal to each other.
-- 2 vectors are equal if their values are identical.
-- @param	a		Vector3		The first vector to test.
-- @param	a		Vector3		The second vector to test.
-- @returns	bool	Whether the 2 vectors are equal or not.
function Vector3.equals(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Determines if 2 vectors are equal to each other.\n2 vectors are equal if their values are identical.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe first vector to test.",
			"name": "a",
			"type": "Vector3",
			"description": "The first vector to test."
		},
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe second vector to test.",
			"name": "a",
			"type": "Vector3",
			"description": "The second vector to test."
		},
		{
			"directive": "returns",
			"text": "bool\tWhether the 2 vectors are equal or not.",
			"type": "bool",
			"description": "Whether the 2 vectors are equal or not."
		}
	],
	"line": 197,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 202,
	"name": "equals",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Determines if 2 vectors are equal to each other.\n-- 2 vectors are equal if their values are identical.\n-- @param\ta\t\tVector3\t\tThe first vector to test.\n-- @param\ta\t\tVector3\t\tThe second vector to test.\n-- @returns\tbool\tWhether the 2 vectors are equal or not.\nfunction Vector3.equals(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe first vector to test.",
			"name": "a",
			"type": "Vector3",
			"description": "The first vector to test."
		},
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe second vector to test.",
			"name": "a",
			"type": "Vector3",
			"description": "The second vector to test."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the 2 vectors are equal or not.",
		"type": "bool",
		"description": "Whether the 2 vectors are equal or not."
	},
	"name_full": "worldeditadditions_core.Vector3.equals",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L198-L203"
}

expand_region 🔗

Expands the defined region to include the given point.

Arguments

NameTypeDefault valueDescription
targetVector3nil

The target vector to include.

pos1Vector3nil

pos1 of the defined region.

pos2Vector3nil

pos2 of the defined region.

Returns

Vector3,Vector3 :

2 vectors that represent the expand_region.

Source
--- Expands the defined region to include the given point.
-- @param	target	Vector3	The target vector to include.
-- @param	pos1	Vector3	pos1 of the defined region.
-- @param	pos2	Vector3	pos2 of the defined region.
-- @returns	Vector3,Vector3		2 vectors that represent the expand_region.
function Vector3.expand_region(target, pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Expands the defined region to include the given point.",
	"directives": [
		{
			"directive": "param",
			"text": "target\tVector3\tThe target vector to include.",
			"name": "target",
			"type": "Vector3",
			"description": "The target vector to include."
		},
		{
			"directive": "param",
			"text": "pos1\tVector3\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "returns",
			"text": "Vector3,Vector3\t\t2 vectors that represent the expand_region.",
			"type": "Vector3,Vector3",
			"description": "2 vectors that represent the expand_region."
		}
	],
	"line": 331,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 336,
	"name": "expand_region",
	"instanced": false,
	"args": [
		"target",
		"pos1",
		"pos2"
	],
	"text": "--- Expands the defined region to include the given point.\n-- @param\ttarget\tVector3\tThe target vector to include.\n-- @param\tpos1\tVector3\tpos1 of the defined region.\n-- @param\tpos2\tVector3\tpos2 of the defined region.\n-- @returns\tVector3,Vector3\t\t2 vectors that represent the expand_region.\nfunction Vector3.expand_region(target, pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "target\tVector3\tThe target vector to include.",
			"name": "target",
			"type": "Vector3",
			"description": "The target vector to include."
		},
		{
			"directive": "param",
			"text": "pos1\tVector3\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3,Vector3\t\t2 vectors that represent the expand_region.",
		"type": "Vector3,Vector3",
		"description": "2 vectors that represent the expand_region."
	},
	"name_full": "worldeditadditions_core.Vector3.expand_region",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L332-L337"
}

floor 🔗

Rounds the components of this vector down.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

A new instance with the x/y/z components rounded down.

Source
--- Rounds the components of this vector down.
-- @param 	a		Vector3		The vector to operate on.
-- @returns	Vector3	A new instance with the x/y/z components rounded down.
function Vector3.floor(a)
{
	"type": "function",
	"internal": false,
	"description": "Rounds the components of this vector down.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new instance with the x/y/z components rounded down.",
			"type": "Vector3",
			"description": "A new instance with the x/y/z components rounded down."
		}
	],
	"line": 108,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 111,
	"name": "floor",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Rounds the components of this vector down.\n-- @param \ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tA new instance with the x/y/z components rounded down.\nfunction Vector3.floor(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new instance with the x/y/z components rounded down.",
		"type": "Vector3",
		"description": "A new instance with the x/y/z components rounded down."
	},
	"name_full": "worldeditadditions_core.Vector3.floor",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L109-L112"
}

fromBearing 🔗

Given 2 angles and a length, return a Vector3 pointing in that direction. Consider a sphere, with the 2 angles defining a point on the sphere's surface. This function returns that point as a Vector3.

Arguments

NameTypeDefault valueDescription
angle_xnumbernil

The X angle.

angle_ynumbernil

The Y angle.

lengthnumbernil

The radius of the sphere in question.

Returns

Vector3 :

The point on the sphere defined by the aforementioned parameters.

Source
--- Given 2 angles and a length, return a Vector3 pointing in that direction.
-- Consider a sphere, with the 2 angles defining a point on the sphere's surface.
-- This function returns that point as a Vector3.
-- @source	https://math.stackexchange.com/a/1881767/221181
-- @param	angle_x		number	The X angle.
-- @param	angle_y		number	The Y angle.
-- @param	length		number	The radius of the sphere in question.
-- @returns	Vector3		The point on the sphere defined by the aforementioned parameters.
function Vector3.fromBearing(angle_x, angle_y, length)
{
	"type": "function",
	"internal": false,
	"description": "Given 2 angles and a length, return a Vector3 pointing in that direction.\nConsider a sphere, with the 2 angles defining a point on the sphere's surface.\nThis function returns that point as a Vector3.",
	"directives": [
		{
			"directive": "source",
			"text": "https://math.stackexchange.com/a/1881767/221181"
		},
		{
			"directive": "param",
			"text": "angle_x\t\tnumber\tThe X angle.",
			"name": "angle_x",
			"type": "number",
			"description": "The X angle."
		},
		{
			"directive": "param",
			"text": "angle_y\t\tnumber\tThe Y angle.",
			"name": "angle_y",
			"type": "number",
			"description": "The Y angle."
		},
		{
			"directive": "param",
			"text": "length\t\tnumber\tThe radius of the sphere in question.",
			"name": "length",
			"type": "number",
			"description": "The radius of the sphere in question."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\tThe point on the sphere defined by the aforementioned parameters.",
			"type": "Vector3",
			"description": "The point on the sphere defined by the aforementioned parameters."
		}
	],
	"line": 396,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 404,
	"name": "fromBearing",
	"instanced": false,
	"args": [
		"angle_x",
		"angle_y",
		"length"
	],
	"text": "--- Given 2 angles and a length, return a Vector3 pointing in that direction.\n-- Consider a sphere, with the 2 angles defining a point on the sphere's surface.\n-- This function returns that point as a Vector3.\n-- @source\thttps://math.stackexchange.com/a/1881767/221181\n-- @param\tangle_x\t\tnumber\tThe X angle.\n-- @param\tangle_y\t\tnumber\tThe Y angle.\n-- @param\tlength\t\tnumber\tThe radius of the sphere in question.\n-- @returns\tVector3\t\tThe point on the sphere defined by the aforementioned parameters.\nfunction Vector3.fromBearing(angle_x, angle_y, length)",
	"params": [
		{
			"directive": "param",
			"text": "angle_x\t\tnumber\tThe X angle.",
			"name": "angle_x",
			"type": "number",
			"description": "The X angle."
		},
		{
			"directive": "param",
			"text": "angle_y\t\tnumber\tThe Y angle.",
			"name": "angle_y",
			"type": "number",
			"description": "The Y angle."
		},
		{
			"directive": "param",
			"text": "length\t\tnumber\tThe radius of the sphere in question.",
			"name": "length",
			"type": "number",
			"description": "The radius of the sphere in question."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\tThe point on the sphere defined by the aforementioned parameters.",
		"type": "Vector3",
		"description": "The point on the sphere defined by the aforementioned parameters."
	},
	"name_full": "worldeditadditions_core.Vector3.fromBearing",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L397-L405"
}

is_contained 🔗

Determines if this vector is contained within the region defined by the given vectors.

Arguments

NameTypeDefault valueDescription
aVector3nil

The target vector to check.

pos1Vector3nil

pos1 of the defined region.

pos2Vector3nil

pos2 of the defined region.

Returns

boolean :

Whether the given target is contained within the defined worldedit region.

Source
--- Determines if this vector is contained within the region defined by the given vectors.
-- @param	a		Vector3		The target vector to check.
-- @param	pos1	Vector3		pos1 of the defined region.
-- @param	pos2	Vector3		pos2 of the defined region.
-- @return	boolean	Whether the given target is contained within the defined worldedit region.
function Vector3.is_contained(target, pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Determines if this vector is contained within the region defined by the given vectors.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe target vector to check.",
			"name": "a",
			"type": "Vector3",
			"description": "The target vector to check."
		},
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "returns",
			"text": "boolean\tWhether the given target is contained within the defined worldedit region.",
			"type": "boolean",
			"description": "Whether the given target is contained within the defined worldedit region."
		}
	],
	"line": 303,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 308,
	"name": "is_contained",
	"instanced": false,
	"args": [
		"target",
		"pos1",
		"pos2"
	],
	"text": "--- Determines if this vector is contained within the region defined by the given vectors.\n-- @param\ta\t\tVector3\t\tThe target vector to check.\n-- @param\tpos1\tVector3\t\tpos1 of the defined region.\n-- @param\tpos2\tVector3\t\tpos2 of the defined region.\n-- @return\tboolean\tWhether the given target is contained within the defined worldedit region.\nfunction Vector3.is_contained(target, pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe target vector to check.",
			"name": "a",
			"type": "Vector3",
			"description": "The target vector to check."
		},
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3",
			"description": "pos2 of the defined region."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "boolean\tWhether the given target is contained within the defined worldedit region.",
		"type": "boolean",
		"description": "Whether the given target is contained within the defined worldedit region."
	},
	"name_full": "worldeditadditions_core.Vector3.is_contained",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L304-L309"
}

length 🔗

Calculates the scalar length of this vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

number :

The length of this vector as a scalar value.

Source
--- Calculates the scalar length of this vector.
-- @param	a		Vector3		The vector to operate on.
-- @returns	number	The length of this vector as a scalar value.
function Vector3.length(a)
{
	"type": "function",
	"internal": false,
	"description": "Calculates the scalar length of this vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "number\tThe length of this vector as a scalar value.",
			"type": "number",
			"description": "The length of this vector as a scalar value."
		}
	],
	"line": 168,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 171,
	"name": "length",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Calculates the scalar length of this vector.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tnumber\tThe length of this vector as a scalar value.\nfunction Vector3.length(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe length of this vector as a scalar value.",
		"type": "number",
		"description": "The length of this vector as a scalar value."
	},
	"name_full": "worldeditadditions_core.Vector3.length",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L169-L172"
}

length_squared 🔗

Returns the scalar length of this vector squared.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

number :

The length squared of this vector as a scalar value.

Source
--- Returns the scalar length of this vector squared.
-- @param	a		Vector3		The vector to operate on.
-- @returns	number	The length squared of this vector as a scalar value.
function Vector3.length_squared(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns the scalar length of this vector squared.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "number\tThe length squared of this vector as a scalar value.",
			"type": "number",
			"description": "The length squared of this vector as a scalar value."
		}
	],
	"line": 154,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 157,
	"name": "length_squared",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns the scalar length of this vector squared.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tnumber\tThe length squared of this vector as a scalar value.\nfunction Vector3.length_squared(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe length squared of this vector as a scalar value.",
		"type": "number",
		"description": "The length squared of this vector as a scalar value."
	},
	"name_full": "worldeditadditions_core.Vector3.length_squared",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L155-L158"
}

limit_to 🔗

Returns a new vector whose length clamped to the given length. The direction in which the vector is pointing is not changed.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

A new Vector3 instance limited to the specified length.

Source
--- Returns a new vector whose length clamped to the given length.
-- The direction in which the vector is pointing is not changed.
-- @param	a		Vector3		The vector to operate on.
-- @returns	Vector3	A new Vector3 instance limited to the specified length.
function Vector3.limit_to(a, length)
{
	"type": "function",
	"internal": false,
	"description": "Returns a new vector whose length clamped to the given length.\nThe direction in which the vector is pointing is not changed.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new Vector3 instance limited to the specified length.",
			"type": "Vector3",
			"description": "A new Vector3 instance limited to the specified length."
		}
	],
	"line": 208,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 212,
	"name": "limit_to",
	"instanced": false,
	"args": [
		"a",
		"length"
	],
	"text": "--- Returns a new vector whose length clamped to the given length.\n-- The direction in which the vector is pointing is not changed.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tA new Vector3 instance limited to the specified length.\nfunction Vector3.limit_to(a, length)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new Vector3 instance limited to the specified length.",
		"type": "Vector3",
		"description": "A new Vector3 instance limited to the specified length."
	},
	"name_full": "worldeditadditions_core.Vector3.limit_to",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L209-L213"
}

max 🔗

Returns a vector of the max values of 2 vectors.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The first vector to operate on.

pos2Vector3nil

The second vector to operate on.

Returns

Vector3 :

The maximum values from the input vectors.

Source
--- Returns a vector of the max values of 2 vectors.
-- @param	pos1	Vector3		The first vector to operate on.
-- @param	pos2	Vector3		The second vector to operate on.
-- @return	Vector3		The maximum values from the input vectors.
function Vector3.max(pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Returns a vector of the max values of 2 vectors.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe first vector to operate on.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe second vector to operate on.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The second vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\tThe maximum values from the input vectors.",
			"type": "Vector3",
			"description": "The maximum values from the input vectors."
		}
	],
	"line": 378,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 382,
	"name": "max",
	"instanced": false,
	"args": [
		"pos1",
		"pos2"
	],
	"text": "--- Returns a vector of the max values of 2 vectors.\n-- @param\tpos1\tVector3\t\tThe first vector to operate on.\n-- @param\tpos2\tVector3\t\tThe second vector to operate on.\n-- @return\tVector3\t\tThe maximum values from the input vectors.\nfunction Vector3.max(pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe first vector to operate on.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe second vector to operate on.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The second vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\tThe maximum values from the input vectors.",
		"type": "Vector3",
		"description": "The maximum values from the input vectors."
	},
	"name_full": "worldeditadditions_core.Vector3.max",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L379-L383"
}

max_component 🔗

Returns the value of the maximum component of the vector. Returns a scalar value.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

number :

The value of the maximum component of the vector.

Source
--- Returns the value of the maximum component of the vector.
-- Returns a scalar value.
-- @param	a		Vector3		The vector to operate on.
-- @returns	number	The value of the maximum component of the vector.
function Vector3.max_component(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns the value of the maximum component of the vector.\nReturns a scalar value.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "number\tThe value of the maximum component of the vector.",
			"type": "number",
			"description": "The value of the maximum component of the vector."
		}
	],
	"line": 260,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 264,
	"name": "max_component",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns the value of the maximum component of the vector.\n-- Returns a scalar value.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tnumber\tThe value of the maximum component of the vector.\nfunction Vector3.max_component(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe value of the maximum component of the vector.",
		"type": "number",
		"description": "The value of the maximum component of the vector."
	},
	"name_full": "worldeditadditions_core.Vector3.max_component",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L261-L265"
}

mean 🔗

Returns the mean (average) of 2 positions. In other words, returns the centre of 2 points.

Arguments

NameTypeDefault valueDescription
pos1Vector3|numbernil

pos1 of the defined region.

pos2Vector3|numbernil

pos2 of the defined region.

targetVector3nil

Centre coordinates.

Returns

nil

Source
--- Returns the mean (average) of 2 positions.
-- In other words, returns the centre of 2 points.
-- @param	pos1	Vector3|number	pos1 of the defined region.
-- @param	pos2	Vector3|number	pos2 of the defined region.
-- @param	target	Vector3	Centre coordinates.
function Vector3.mean(pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Returns the mean (average) of 2 positions.\nIn other words, returns the centre of 2 points.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3|number\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3|number",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3|number\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3|number",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "param",
			"text": "target\tVector3\tCentre coordinates.",
			"name": "target",
			"type": "Vector3",
			"description": "Centre coordinates."
		}
	],
	"line": 350,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 355,
	"name": "mean",
	"instanced": false,
	"args": [
		"pos1",
		"pos2"
	],
	"text": "--- Returns the mean (average) of 2 positions.\n-- In other words, returns the centre of 2 points.\n-- @param\tpos1\tVector3|number\tpos1 of the defined region.\n-- @param\tpos2\tVector3|number\tpos2 of the defined region.\n-- @param\ttarget\tVector3\tCentre coordinates.\nfunction Vector3.mean(pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3|number\tpos1 of the defined region.",
			"name": "pos1",
			"type": "Vector3|number",
			"description": "pos1 of the defined region."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3|number\tpos2 of the defined region.",
			"name": "pos2",
			"type": "Vector3|number",
			"description": "pos2 of the defined region."
		},
		{
			"directive": "param",
			"text": "target\tVector3\tCentre coordinates.",
			"name": "target",
			"type": "Vector3",
			"description": "Centre coordinates."
		}
	],
	"name_full": "worldeditadditions_core.Vector3.mean",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L351-L356"
}

min 🔗

Returns a vector of the min components of 2 vectors.

Arguments

NameTypeDefault valueDescription
pos1Vector3|numbernil

The first vector to operate on.

pos2Vector3|numbernil

The second vector to operate on.

Returns

Vector3 :

The minimum values from the input vectors

Source
--- Returns a vector of the min components of 2 vectors.
-- @param	pos1	Vector3|number	The first vector to operate on.
-- @param	pos2	Vector3|number	The second vector to operate on.
-- @return	Vector3	The minimum values from the input vectors
function Vector3.min(pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Returns a vector of the min components of 2 vectors.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3|number\tThe first vector to operate on.",
			"name": "pos1",
			"type": "Vector3|number",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3|number\tThe second vector to operate on.",
			"name": "pos2",
			"type": "Vector3|number",
			"description": "The second vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tThe minimum values from the input vectors",
			"type": "Vector3",
			"description": "The minimum values from the input vectors"
		}
	],
	"line": 360,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 364,
	"name": "min",
	"instanced": false,
	"args": [
		"pos1",
		"pos2"
	],
	"text": "--- Returns a vector of the min components of 2 vectors.\n-- @param\tpos1\tVector3|number\tThe first vector to operate on.\n-- @param\tpos2\tVector3|number\tThe second vector to operate on.\n-- @return\tVector3\tThe minimum values from the input vectors\nfunction Vector3.min(pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3|number\tThe first vector to operate on.",
			"name": "pos1",
			"type": "Vector3|number",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3|number\tThe second vector to operate on.",
			"name": "pos2",
			"type": "Vector3|number",
			"description": "The second vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tThe minimum values from the input vectors",
		"type": "Vector3",
		"description": "The minimum values from the input vectors"
	},
	"name_full": "worldeditadditions_core.Vector3.min",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L361-L365"
}

min_component 🔗

Returns the value of the minimum component of the vector. Returns a scalar value.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

number :

The value of the minimum component of the vector.

Source
--- Returns the value of the minimum component of the vector.
-- Returns a scalar value.
-- @param	a		Vector3		The vector to operate on.
-- @returns	number	The value of the minimum component of the vector.
function Vector3.min_component(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns the value of the minimum component of the vector.\nReturns a scalar value.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "number\tThe value of the minimum component of the vector.",
			"type": "number",
			"description": "The value of the minimum component of the vector."
		}
	],
	"line": 252,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 256,
	"name": "min_component",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns the value of the minimum component of the vector.\n-- Returns a scalar value.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tnumber\tThe value of the minimum component of the vector.\nfunction Vector3.min_component(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe value of the minimum component of the vector.",
		"type": "number",
		"description": "The value of the minimum component of the vector."
	},
	"name_full": "worldeditadditions_core.Vector3.min_component",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L253-L257"
}

move_towards 🔗

Return a vector that is amount distance towards b from a.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to move from.

bVector3nil

The vector to move towards.

amountnumbernil

The amount to move.

Returns

nil

Source
--- Return a vector that is amount distance towards b from a.
-- @param	a		Vector3		The vector to move from.
-- @param	b		Vector3		The vector to move towards.
-- @param	amount	number		The amount to move.
function Vector3.move_towards(a, b, amount)
{
	"type": "function",
	"internal": false,
	"description": "Return a vector that is amount distance towards b from a.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to move from.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to move from."
		},
		{
			"directive": "param",
			"text": "b\t\tVector3\t\tThe vector to move towards.",
			"name": "b",
			"type": "Vector3",
			"description": "The vector to move towards."
		},
		{
			"directive": "param",
			"text": "amount\tnumber\t\tThe amount to move.",
			"name": "amount",
			"type": "number",
			"description": "The amount to move."
		}
	],
	"line": 244,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 248,
	"name": "move_towards",
	"instanced": false,
	"args": [
		"a",
		"b",
		"amount"
	],
	"text": "--- Return a vector that is amount distance towards b from a.\n-- @param\ta\t\tVector3\t\tThe vector to move from.\n-- @param\tb\t\tVector3\t\tThe vector to move towards.\n-- @param\tamount\tnumber\t\tThe amount to move.\nfunction Vector3.move_towards(a, b, amount)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to move from.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to move from."
		},
		{
			"directive": "param",
			"text": "b\t\tVector3\t\tThe vector to move towards.",
			"name": "b",
			"type": "Vector3",
			"description": "The vector to move towards."
		},
		{
			"directive": "param",
			"text": "amount\tnumber\t\tThe amount to move.",
			"name": "amount",
			"type": "number",
			"description": "The amount to move."
		}
	],
	"name_full": "worldeditadditions_core.Vector3.move_towards",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L245-L249"
}

multiply 🔗

Multiplies the specified vectors or numbers together. Returns the result as a new vector. If 1 of the inputs is a number and the other a vector, then the number will be multiplied to each of the components of the vector.

If both of the inputs are vectors, then the components are multiplied by each other (NOT the cross product). In other words: a.x * b.x, a.y * b.y, a.z * b.z

Arguments

NameTypeDefault valueDescription
aVector3|numbernil

The first item to multiply.

aVector3|numbernil

The second item to multiply.

Returns

Vector3 :

The result as a new Vector3 object.

Source
--- Multiplies the specified vectors or numbers together.
-- Returns the result as a new vector.
-- If 1 of the inputs is a number and the other a vector, then the number will
-- be multiplied to each of the components of the vector.
--
-- If both of the inputs are vectors, then the components are multiplied
-- by each other (NOT the cross product). In other words:
-- a.x * b.x, a.y * b.y, a.z * b.z
--
-- @param	a	Vector3|number	The first item to multiply.
-- @param	a	Vector3|number	The second item to multiply.
-- @returns	Vector3				The result as a new Vector3 object.
function Vector3.multiply(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Multiplies the specified vectors or numbers together.\nReturns the result as a new vector.\nIf 1 of the inputs is a number and the other a vector, then the number will\nbe multiplied to each of the components of the vector.\n\nIf both of the inputs are vectors, then the components are multiplied\nby each other (NOT the cross product). In other words:\na.x * b.x, a.y * b.y, a.z * b.z\n",
	"directives": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to multiply.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to multiply."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to multiply.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to multiply."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
			"type": "Vector3",
			"description": "The result as a new Vector3 object."
		}
	],
	"line": 65,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 77,
	"name": "multiply",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Multiplies the specified vectors or numbers together.\n-- Returns the result as a new vector.\n-- If 1 of the inputs is a number and the other a vector, then the number will\n-- be multiplied to each of the components of the vector.\n--\n-- If both of the inputs are vectors, then the components are multiplied\n-- by each other (NOT the cross product). In other words:\n-- a.x * b.x, a.y * b.y, a.z * b.z\n--\n-- @param\ta\tVector3|number\tThe first item to multiply.\n-- @param\ta\tVector3|number\tThe second item to multiply.\n-- @returns\tVector3\t\t\t\tThe result as a new Vector3 object.\nfunction Vector3.multiply(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to multiply.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to multiply."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to multiply.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to multiply."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
		"type": "Vector3",
		"description": "The result as a new Vector3 object."
	},
	"name_full": "worldeditadditions_core.Vector3.multiply",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L66-L78"
}

new 🔗

Creates a new Vector3 instance.

Arguments

NameTypeDefault valueDescription
xnumbernil

The x co-ordinate value.

ynumbernil

The y co-ordinate value.

znumbernil

The z co-ordinate value.

Returns

nil

Source
--- Creates a new Vector3 instance.
-- @param x		number	The x co-ordinate value.
-- @param y		number	The y co-ordinate value.
-- @param z		number	The z co-ordinate value.
function Vector3.new(x, y, z)
{
	"type": "function",
	"internal": false,
	"description": "Creates a new Vector3 instance.",
	"directives": [
		{
			"directive": "param",
			"text": "x\t\tnumber\tThe x co-ordinate value.",
			"name": "x",
			"type": "number",
			"description": "The x co-ordinate value."
		},
		{
			"directive": "param",
			"text": "y\t\tnumber\tThe y co-ordinate value.",
			"name": "y",
			"type": "number",
			"description": "The y co-ordinate value."
		},
		{
			"directive": "param",
			"text": "z\t\tnumber\tThe z co-ordinate value.",
			"name": "z",
			"type": "number",
			"description": "The z co-ordinate value."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 10,
	"name": "new",
	"instanced": false,
	"args": [
		"x",
		"y",
		"z"
	],
	"text": "--- Creates a new Vector3 instance.\n-- @param x\t\tnumber\tThe x co-ordinate value.\n-- @param y\t\tnumber\tThe y co-ordinate value.\n-- @param z\t\tnumber\tThe z co-ordinate value.\nfunction Vector3.new(x, y, z)",
	"params": [
		{
			"directive": "param",
			"text": "x\t\tnumber\tThe x co-ordinate value.",
			"name": "x",
			"type": "number",
			"description": "The x co-ordinate value."
		},
		{
			"directive": "param",
			"text": "y\t\tnumber\tThe y co-ordinate value.",
			"name": "y",
			"type": "number",
			"description": "The y co-ordinate value."
		},
		{
			"directive": "param",
			"text": "z\t\tnumber\tThe z co-ordinate value.",
			"name": "z",
			"type": "number",
			"description": "The z co-ordinate value."
		}
	],
	"name_full": "worldeditadditions_core.Vector3.new",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L7-L11"
}

rotate3d 🔗

Rotate a given point around an origin point in 3d space. Consider 3 axes (X, Y, and Z) that are centred on origin. This function rotates point around these axes in the aforementioned order.

NOTE: This function is not as intuitive as it sounds. A whiteboard and a head for mathematics is recommended before using this function. Either that, or Blender 3 (https://blender.org/) is quite useful to visualise what's going on.

Arguments

NameTypeDefault valueDescription
originVector3nil

The origin point to rotate around

pointVector3nil

The point to rotate.

rotateVector3nil

Rotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!

Returns

Vector3 :

The rotated point.

Source
--- Rotate a given point around an origin point in 3d space.
-- Consider 3 axes (X, Y, and Z) that are centred on origin. This function
-- rotates point around these axes in the aforementioned order.
-- 
-- NOTE: This function is not as intuitive as it sounds.
-- A whiteboard and a head for mathematics is recommended before using this
-- function. Either that, or Blender 3 (https://blender.org/) is quite useful to visualise what's going on.
-- @source	GitHub Copilot, generated 2023-01-17
-- @warning	Not completely tested! Pending a thorough evaluation. Seems to basically work, after some tweaks to the fluff around the edges?
-- @param	origin	Vector3	The origin point to rotate around
-- @param	point	Vector3	The point to rotate.
-- @param	rotate	Vector3	Rotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!
-- @return	Vector3	The rotated point.
function Vector3.rotate3d(origin, point, rotate)
{
	"type": "function",
	"internal": false,
	"description": "Rotate a given point around an origin point in 3d space.\nConsider 3 axes (X, Y, and Z) that are centred on origin. This function\nrotates point around these axes in the aforementioned order.\n\nNOTE: This function is not as intuitive as it sounds.\nA whiteboard and a head for mathematics is recommended before using this\nfunction. Either that, or Blender 3 (https://blender.org/) is quite useful to visualise what's going on.",
	"directives": [
		{
			"directive": "source",
			"text": "GitHub Copilot, generated 2023-01-17"
		},
		{
			"directive": "warning",
			"text": "Not completely tested! Pending a thorough evaluation. Seems to basically work, after some tweaks to the fluff around the edges?"
		},
		{
			"directive": "param",
			"text": "origin\tVector3\tThe origin point to rotate around",
			"name": "origin",
			"type": "Vector3",
			"description": "The origin point to rotate around"
		},
		{
			"directive": "param",
			"text": "point\tVector3\tThe point to rotate.",
			"name": "point",
			"type": "Vector3",
			"description": "The point to rotate."
		},
		{
			"directive": "param",
			"text": "rotate\tVector3\tRotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!",
			"name": "rotate",
			"type": "Vector3",
			"description": "Rotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!"
		},
		{
			"directive": "returns",
			"text": "Vector3\tThe rotated point.",
			"type": "Vector3",
			"description": "The rotated point."
		}
	],
	"line": 412,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 425,
	"name": "rotate3d",
	"instanced": false,
	"args": [
		"origin",
		"point",
		"rotate"
	],
	"text": "--- Rotate a given point around an origin point in 3d space.\n-- Consider 3 axes (X, Y, and Z) that are centred on origin. This function\n-- rotates point around these axes in the aforementioned order.\n-- \n-- NOTE: This function is not as intuitive as it sounds.\n-- A whiteboard and a head for mathematics is recommended before using this\n-- function. Either that, or Blender 3 (https://blender.org/) is quite useful to visualise what's going on.\n-- @source\tGitHub Copilot, generated 2023-01-17\n-- @warning\tNot completely tested! Pending a thorough evaluation. Seems to basically work, after some tweaks to the fluff around the edges?\n-- @param\torigin\tVector3\tThe origin point to rotate around\n-- @param\tpoint\tVector3\tThe point to rotate.\n-- @param\trotate\tVector3\tRotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!\n-- @return\tVector3\tThe rotated point.\nfunction Vector3.rotate3d(origin, point, rotate)",
	"params": [
		{
			"directive": "param",
			"text": "origin\tVector3\tThe origin point to rotate around",
			"name": "origin",
			"type": "Vector3",
			"description": "The origin point to rotate around"
		},
		{
			"directive": "param",
			"text": "point\tVector3\tThe point to rotate.",
			"name": "point",
			"type": "Vector3",
			"description": "The point to rotate."
		},
		{
			"directive": "param",
			"text": "rotate\tVector3\tRotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!",
			"name": "rotate",
			"type": "Vector3",
			"description": "Rotate this much around the 3 different axes, x, y, and z. Axial rotations are handled in this order: X→Y→Z. Values MUST be in radians!"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tThe rotated point.",
		"type": "Vector3",
		"description": "The rotated point."
	},
	"name_full": "worldeditadditions_core.Vector3.rotate3d",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L413-L426"
}

round 🔗

Rounds the components of this vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

A new instance with the x/y/z components rounded.

Source
--- Rounds the components of this vector.
-- @param 	a		Vector3		The vector to operate on.
-- @returns	Vector3	A new instance with the x/y/z components rounded.
function Vector3.round(a)
{
	"type": "function",
	"internal": false,
	"description": "Rounds the components of this vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new instance with the x/y/z components rounded.",
			"type": "Vector3",
			"description": "A new instance with the x/y/z components rounded."
		}
	],
	"line": 120,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 123,
	"name": "round",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Rounds the components of this vector.\n-- @param \ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tA new instance with the x/y/z components rounded.\nfunction Vector3.round(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new instance with the x/y/z components rounded.",
		"type": "Vector3",
		"description": "A new instance with the x/y/z components rounded."
	},
	"name_full": "worldeditadditions_core.Vector3.round",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L121-L124"
}

round_dp 🔗

Rounds the components of this vector to the specified number of decimal places.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to round.

dpnumbernil

The number of decimal places to round to.

Returns

Vector3 :

A new instance with the components rounded to the specified number of decimal places.

Source
--- Rounds the components of this vector to the specified number of decimal places.
-- @param	a		Vector3	The vector to round.
-- @param	dp		number	The number of decimal places to round to.
-- @returns	Vector3	A new instance with the components rounded to the specified number of decimal places.
function Vector3.round_dp(a, dp)
{
	"type": "function",
	"internal": false,
	"description": "Rounds the components of this vector to the specified number of decimal places.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\tThe vector to round.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to round."
		},
		{
			"directive": "param",
			"text": "dp\t\tnumber\tThe number of decimal places to round to.",
			"name": "dp",
			"type": "number",
			"description": "The number of decimal places to round to."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new instance with the components rounded to the specified number of decimal places.",
			"type": "Vector3",
			"description": "A new instance with the components rounded to the specified number of decimal places."
		}
	],
	"line": 127,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 131,
	"name": "round_dp",
	"instanced": false,
	"args": [
		"a",
		"dp"
	],
	"text": "--- Rounds the components of this vector to the specified number of decimal places.\n-- @param\ta\t\tVector3\tThe vector to round.\n-- @param\tdp\t\tnumber\tThe number of decimal places to round to.\n-- @returns\tVector3\tA new instance with the components rounded to the specified number of decimal places.\nfunction Vector3.round_dp(a, dp)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\tThe vector to round.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to round."
		},
		{
			"directive": "param",
			"text": "dp\t\tnumber\tThe number of decimal places to round to.",
			"name": "dp",
			"type": "number",
			"description": "The number of decimal places to round to."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new instance with the components rounded to the specified number of decimal places.",
		"type": "Vector3",
		"description": "A new instance with the components rounded to the specified number of decimal places."
	},
	"name_full": "worldeditadditions_core.Vector3.round_dp",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L128-L132"
}

set_to 🔗

Returns a new vector whose length clamped to the given length. The direction in which the vector is pointing is not changed.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

A new Vector3 instance limited to the specified length.

Source
--- Returns a new vector whose length clamped to the given length.
-- The direction in which the vector is pointing is not changed.
-- @param	a		Vector3		The vector to operate on.
-- @returns	Vector3	A new Vector3 instance limited to the specified length.
function Vector3.set_to(a, length)
{
	"type": "function",
	"internal": false,
	"description": "Returns a new vector whose length clamped to the given length.\nThe direction in which the vector is pointing is not changed.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new Vector3 instance limited to the specified length.",
			"type": "Vector3",
			"description": "A new Vector3 instance limited to the specified length."
		}
	],
	"line": 221,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 225,
	"name": "set_to",
	"instanced": false,
	"args": [
		"a",
		"length"
	],
	"text": "--- Returns a new vector whose length clamped to the given length.\n-- The direction in which the vector is pointing is not changed.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tA new Vector3 instance limited to the specified length.\nfunction Vector3.set_to(a, length)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new Vector3 instance limited to the specified length.",
		"type": "Vector3",
		"description": "A new Vector3 instance limited to the specified length."
	},
	"name_full": "worldeditadditions_core.Vector3.set_to",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L222-L226"
}

snap_to 🔗

Snaps this Vector3 to an imaginary square grid with the specified sized squares.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

numbergrid_sizenil

The size of the squares on the imaginary grid to which to snap.

Returns

Vector3 :

A new Vector3 instance snapped to an imaginary grid of the specified size.

Source
--- Snaps this Vector3 to an imaginary square grid with the specified sized
-- squares.
-- @param 	a		Vector3		The vector to operate on.
-- @param	number	grid_size	The size of the squares on the imaginary grid to which to snap.
-- @returns	Vector3	A new Vector3 instance snapped to an imaginary grid of the specified size.
function Vector3.snap_to(a, grid_size)
{
	"type": "function",
	"internal": false,
	"description": "Snaps this Vector3 to an imaginary square grid with the specified sized\nsquares.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "param",
			"text": "number\tgrid_size\tThe size of the squares on the imaginary grid to which to snap.",
			"name": "number",
			"type": "grid_size",
			"description": "The size of the squares on the imaginary grid to which to snap."
		},
		{
			"directive": "returns",
			"text": "Vector3\tA new Vector3 instance snapped to an imaginary grid of the specified size.",
			"type": "Vector3",
			"description": "A new Vector3 instance snapped to an imaginary grid of the specified size."
		}
	],
	"line": 137,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 142,
	"name": "snap_to",
	"instanced": false,
	"args": [
		"a",
		"grid_size"
	],
	"text": "--- Snaps this Vector3 to an imaginary square grid with the specified sized\n-- squares.\n-- @param \ta\t\tVector3\t\tThe vector to operate on.\n-- @param\tnumber\tgrid_size\tThe size of the squares on the imaginary grid to which to snap.\n-- @returns\tVector3\tA new Vector3 instance snapped to an imaginary grid of the specified size.\nfunction Vector3.snap_to(a, grid_size)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "param",
			"text": "number\tgrid_size\tThe size of the squares on the imaginary grid to which to snap.",
			"name": "number",
			"type": "grid_size",
			"description": "The size of the squares on the imaginary grid to which to snap."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tA new Vector3 instance snapped to an imaginary grid of the specified size.",
		"type": "Vector3",
		"description": "A new Vector3 instance snapped to an imaginary grid of the specified size."
	},
	"name_full": "worldeditadditions_core.Vector3.snap_to",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L138-L143"
}

sort 🔗

Sorts the components of the given vectors. pos1 will contain the minimum values, and pos2 the maximum values. Returns 2 new vectors. Note that for this specific function the vectors provided do not have to be instances of Vector3. It is only required that they have the keys x, y, and z. Vector3 instances are always returned. This enables convenient ingesting of positions from outside.

Arguments

NameTypeDefault valueDescription
pos1Vector3nil

The first vector to operate on.

pos2Vector3nil

The second vector to operate on.

Returns

Vector3,Vector3 :

The 2 sorted vectors (min, max).

Source
--- Sorts the components of the given vectors.
-- pos1 will contain the minimum values, and pos2 the maximum values.
-- Returns 2 new vectors.
-- Note that for this specific function
-- the vectors provided do not *have* to be instances of Vector3.
-- It is only required that they have the keys x, y, and z.
-- Vector3 instances are always returned.
-- This enables convenient ingesting of positions from outside.
-- @param	pos1	Vector3		The first vector to operate on.
-- @param	pos2	Vector3		The second vector to operate on.
-- @returns	Vector3,Vector3		The 2 sorted vectors (min, max).
function Vector3.sort(pos1, pos2)
{
	"type": "function",
	"internal": false,
	"description": "Sorts the components of the given vectors.\npos1 will contain the minimum values, and pos2 the maximum values.\nReturns 2 new vectors.\nNote that for this specific function\nthe vectors provided do not *have* to be instances of Vector3.\nIt is only required that they have the keys x, y, and z.\nVector3 instances are always returned.\nThis enables convenient ingesting of positions from outside.",
	"directives": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe first vector to operate on.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe second vector to operate on.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The second vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3,Vector3\t\tThe 2 sorted vectors (min, max).",
			"type": "Vector3,Vector3",
			"description": "The 2 sorted vectors (min, max)."
		}
	],
	"line": 276,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 287,
	"name": "sort",
	"instanced": false,
	"args": [
		"pos1",
		"pos2"
	],
	"text": "--- Sorts the components of the given vectors.\n-- pos1 will contain the minimum values, and pos2 the maximum values.\n-- Returns 2 new vectors.\n-- Note that for this specific function\n-- the vectors provided do not *have* to be instances of Vector3.\n-- It is only required that they have the keys x, y, and z.\n-- Vector3 instances are always returned.\n-- This enables convenient ingesting of positions from outside.\n-- @param\tpos1\tVector3\t\tThe first vector to operate on.\n-- @param\tpos2\tVector3\t\tThe second vector to operate on.\n-- @returns\tVector3,Vector3\t\tThe 2 sorted vectors (min, max).\nfunction Vector3.sort(pos1, pos2)",
	"params": [
		{
			"directive": "param",
			"text": "pos1\tVector3\t\tThe first vector to operate on.",
			"name": "pos1",
			"type": "Vector3",
			"description": "The first vector to operate on."
		},
		{
			"directive": "param",
			"text": "pos2\tVector3\t\tThe second vector to operate on.",
			"name": "pos2",
			"type": "Vector3",
			"description": "The second vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3,Vector3\t\tThe 2 sorted vectors (min, max).",
		"type": "Vector3,Vector3",
		"description": "The 2 sorted vectors (min, max)."
	},
	"name_full": "worldeditadditions_core.Vector3.sort",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L277-L288"
}

sqrt 🔗

Square roots each component of this vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

number :

A new vector with each component square rooted.

Source
--- Square roots each component of this vector.
-- @param	a		Vector3		The vector to operate on.
-- @returns	number	A new vector with each component square rooted.
function Vector3.sqrt(a)
{
	"type": "function",
	"internal": false,
	"description": "Square roots each component of this vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "number\tA new vector with each component square rooted.",
			"type": "number",
			"description": "A new vector with each component square rooted."
		}
	],
	"line": 161,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 164,
	"name": "sqrt",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Square roots each component of this vector.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tnumber\tA new vector with each component square rooted.\nfunction Vector3.sqrt(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tA new vector with each component square rooted.",
		"type": "number",
		"description": "A new vector with each component square rooted."
	},
	"name_full": "worldeditadditions_core.Vector3.sqrt",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L162-L165"
}

subtract 🔗

Subtracts the specified vectors or numbers together. Returns the result as a new vector. If 1 of the inputs is a number and the other a vector, then the number will be subtracted to each of the components of the vector.

Arguments

NameTypeDefault valueDescription
aVector3|numbernil

The first item to subtract.

aVector3|numbernil

The second item to subtract.

Returns

Vector3 :

The result as a new Vector3 object.

Source
--- Subtracts the specified vectors or numbers together.
-- Returns the result as a new vector.
-- If 1 of the inputs is a number and the other a vector, then the number will
-- be subtracted to each of the components of the vector.
-- @param	a	Vector3|number	The first item to subtract.
-- @param	a	Vector3|number	The second item to subtract.
-- @returns	Vector3				The result as a new Vector3 object.
function Vector3.subtract(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Subtracts the specified vectors or numbers together.\nReturns the result as a new vector.\nIf 1 of the inputs is a number and the other a vector, then the number will\nbe subtracted to each of the components of the vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to subtract.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to subtract."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to subtract.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to subtract."
		},
		{
			"directive": "returns",
			"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
			"type": "Vector3",
			"description": "The result as a new Vector3 object."
		}
	],
	"line": 47,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 54,
	"name": "subtract",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Subtracts the specified vectors or numbers together.\n-- Returns the result as a new vector.\n-- If 1 of the inputs is a number and the other a vector, then the number will\n-- be subtracted to each of the components of the vector.\n-- @param\ta\tVector3|number\tThe first item to subtract.\n-- @param\ta\tVector3|number\tThe second item to subtract.\n-- @returns\tVector3\t\t\t\tThe result as a new Vector3 object.\nfunction Vector3.subtract(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe first item to subtract.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The first item to subtract."
		},
		{
			"directive": "param",
			"text": "a\tVector3|number\tThe second item to subtract.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The second item to subtract."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\t\t\t\tThe result as a new Vector3 object.",
		"type": "Vector3",
		"description": "The result as a new Vector3 object."
	},
	"name_full": "worldeditadditions_core.Vector3.subtract",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L48-L55"
}

unit 🔗

Returns the unit vector of this vector. The unit vector is a vector with a length of 1. Returns a new vector. Does not change the direction of the vector.

Arguments

NameTypeDefault valueDescription
aVector3nil

The vector to operate on.

Returns

Vector3 :

The unit vector of this vector.

Source
--- Returns the unit vector of this vector.
-- The unit vector is a vector with a length of 1.
-- Returns a new vector.
-- Does not change the direction of the vector.
-- @param	a		Vector3		The vector to operate on.
-- @returns	Vector3	The unit vector of this vector.
function Vector3.unit(a)
{
	"type": "function",
	"internal": false,
	"description": "Returns the unit vector of this vector.\nThe unit vector is a vector with a length of 1.\nReturns a new vector.\nDoes not change the direction of the vector.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		},
		{
			"directive": "returns",
			"text": "Vector3\tThe unit vector of this vector.",
			"type": "Vector3",
			"description": "The unit vector of this vector."
		}
	],
	"line": 231,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 237,
	"name": "unit",
	"instanced": false,
	"args": [
		"a"
	],
	"text": "--- Returns the unit vector of this vector.\n-- The unit vector is a vector with a length of 1.\n-- Returns a new vector.\n-- Does not change the direction of the vector.\n-- @param\ta\t\tVector3\t\tThe vector to operate on.\n-- @returns\tVector3\tThe unit vector of this vector.\nfunction Vector3.unit(a)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe vector to operate on.",
			"name": "a",
			"type": "Vector3",
			"description": "The vector to operate on."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3\tThe unit vector of this vector.",
		"type": "Vector3",
		"description": "The unit vector of this vector."
	},
	"name_full": "worldeditadditions_core.Vector3.unit",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L232-L238"
}

volume 🔗

Calculates the volume of the region bounded by 2 points.

Arguments

NameTypeDefault valueDescription
aVector3nil

The first point bounding the target region.

bVector3nil

The second point bounding the target region.

Returns

number :

The volume of the defined region.

Source
--- Calculates the volume of the region bounded by 2 points.
-- @param	a		Vector3		The first point bounding the target region.
-- @param	b		Vector3		The second point bounding the target region.
-- @returns	number	The volume of the defined region.
function Vector3.volume(a, b)
{
	"type": "function",
	"internal": false,
	"description": "Calculates the volume of the region bounded by 2 points.",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe first point bounding the target region.",
			"name": "a",
			"type": "Vector3",
			"description": "The first point bounding the target region."
		},
		{
			"directive": "param",
			"text": "b\t\tVector3\t\tThe second point bounding the target region.",
			"name": "b",
			"type": "Vector3",
			"description": "The second point bounding the target region."
		},
		{
			"directive": "returns",
			"text": "number\tThe volume of the defined region.",
			"type": "number",
			"description": "The volume of the defined region."
		}
	],
	"line": 175,
	"namespace": "worldeditadditions_core.Vector3",
	"line_last": 179,
	"name": "volume",
	"instanced": false,
	"args": [
		"a",
		"b"
	],
	"text": "--- Calculates the volume of the region bounded by 2 points.\n-- @param\ta\t\tVector3\t\tThe first point bounding the target region.\n-- @param\tb\t\tVector3\t\tThe second point bounding the target region.\n-- @returns\tnumber\tThe volume of the defined region.\nfunction Vector3.volume(a, b)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3\t\tThe first point bounding the target region.",
			"name": "a",
			"type": "Vector3",
			"description": "The first point bounding the target region."
		},
		{
			"directive": "param",
			"text": "b\t\tVector3\t\tThe second point bounding the target region.",
			"name": "b",
			"type": "Vector3",
			"description": "The second point bounding the target region."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe volume of the defined region.",
		"type": "number",
		"description": "The volume of the defined region."
	},
	"name_full": "worldeditadditions_core.Vector3.volume",
	"filename": "worldeditadditions_core/utils/vector3.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/vector3.lua#L176-L180"
}

Functions

average 🔗

Calculates the mean of all the numbers in the given list.

Arguments

NameTypeDefault valueDescription
listnumber[]nil

The list (table) of numbers to calculate the mean for.

Returns

The mean of the numbers in the given table.

Source
--- Calculates the mean of all the numbers in the given list.
-- @param	list	number[]	The list (table) of numbers to calculate the mean for.
-- @returns	The mean of the numbers in the given table.
function wea_c.average(list)
{
	"type": "function",
	"internal": false,
	"description": "Calculates the mean of all the numbers in the given list.",
	"directives": [
		{
			"directive": "param",
			"text": "list\tnumber[]\tThe list (table) of numbers to calculate the mean for.",
			"name": "list",
			"type": "number[]",
			"description": "The list (table) of numbers to calculate the mean for."
		},
		{
			"directive": "returns",
			"text": "The mean of the numbers in the given table.",
			"type": "The mean of the numbers in the given table."
		}
	],
	"line": 33,
	"namespace": "worldeditadditions_core",
	"line_last": 36,
	"name": "average",
	"instanced": false,
	"args": [
		"list"
	],
	"text": "--- Calculates the mean of all the numbers in the given list.\n-- @param\tlist\tnumber[]\tThe list (table) of numbers to calculate the mean for.\n-- @returns\tThe mean of the numbers in the given table.\nfunction wea_c.average(list)",
	"params": [
		{
			"directive": "param",
			"text": "list\tnumber[]\tThe list (table) of numbers to calculate the mean for.",
			"name": "list",
			"type": "number[]",
			"description": "The list (table) of numbers to calculate the mean for."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "The mean of the numbers in the given table.",
		"type": "The mean of the numbers in the given table."
	},
	"name_full": "worldeditadditions_core.average",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L34-L37"
}

axis_left 🔗

Returns the axis and sign of the axis to the left of the input axis.

Arguments

NameTypeDefault valueDescription
axisstringnil

x or z.

signintnil

Sign multiplier.

Returns

string,int :

Returns axis name and sign multiplier.

Source
--- Returns the axis and sign of the axis to the left of the input axis.
-- @deprecated		Use wea_c.player_dir instead.
-- @param	axis	string	x or z.
-- @param sign	int	Sign multiplier.
-- @return	string,int	Returns axis name and sign multiplier.
function wea_c.axis_left(axis,sign)
{
	"type": "function",
	"internal": false,
	"description": "Returns the axis and sign of the axis to the left of the input axis.",
	"directives": [
		{
			"directive": "deprecated",
			"text": "Use wea_c.player_dir instead."
		},
		{
			"directive": "param",
			"text": "axis\tstring\tx or z.",
			"name": "axis",
			"type": "string",
			"description": "x or z."
		},
		{
			"directive": "param",
			"text": "sign\tint\tSign multiplier.",
			"name": "sign",
			"type": "int",
			"description": "Sign multiplier."
		},
		{
			"directive": "returns",
			"text": "string,int\tReturns axis name and sign multiplier.",
			"type": "string,int",
			"description": "Returns axis name and sign multiplier."
		}
	],
	"line": 94,
	"namespace": "worldeditadditions_core",
	"line_last": 99,
	"name": "axis_left",
	"instanced": false,
	"args": [
		"axis",
		"sign"
	],
	"text": "--- Returns the axis and sign of the axis to the left of the input axis.\n-- @deprecated\t\tUse wea_c.player_dir instead.\n-- @param\taxis\tstring\tx or z.\n-- @param sign\tint\tSign multiplier.\n-- @return\tstring,int\tReturns axis name and sign multiplier.\nfunction wea_c.axis_left(axis,sign)",
	"params": [
		{
			"directive": "param",
			"text": "axis\tstring\tx or z.",
			"name": "axis",
			"type": "string",
			"description": "x or z."
		},
		{
			"directive": "param",
			"text": "sign\tint\tSign multiplier.",
			"name": "sign",
			"type": "int",
			"description": "Sign multiplier."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string,int\tReturns axis name and sign multiplier.",
		"type": "string,int",
		"description": "Returns axis name and sign multiplier."
	},
	"name_full": "worldeditadditions_core.axis_left",
	"filename": "worldeditadditions_core/utils/player.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/player.lua#L95-L100"
}

chaikin 🔗

Chaikin curve smoothing implementation. This algorithm works by taking a list of points that define a segmented line, and then interpolating between them to smooth the line.

Arguments

NameTypeDefault valueDescription
arr_posVector3[]nil

A list of points to interpolate.

stepsnumbernil

The number of interpolatioon passes to do.

Returns

Vector3[] :

A (longer) list of interpolated points.

Source
--- Chaikin curve smoothing implementation.
-- This algorithm works by taking a list of points that define a segmented line,
-- and then interpolating between them to smooth the line.
-- @source Ported from https://git.starbeamrainbowlabs.com/sbrl-GitLab/Chaikin-Generator/src/branch/master/ChaikinGenerator/ChaikinCurve.cs
-- @param	arr_pos		Vector3[]	A list of points to interpolate.
-- @param	steps		number		The number of interpolatioon passes to do.
-- @returns	Vector3[]	A (longer) list of interpolated points.
local function chaikin(arr_pos, steps)
{
	"type": "function",
	"internal": false,
	"description": "Chaikin curve smoothing implementation.\nThis algorithm works by taking a list of points that define a segmented line,\nand then interpolating between them to smooth the line.",
	"directives": [
		{
			"directive": "source",
			"text": "Ported from https://git.starbeamrainbowlabs.com/sbrl-GitLab/Chaikin-Generator/src/branch/master/ChaikinGenerator/ChaikinCurve.cs"
		},
		{
			"directive": "param",
			"text": "arr_pos\t\tVector3[]\tA list of points to interpolate.",
			"name": "arr_pos",
			"type": "Vector3[]",
			"description": "A list of points to interpolate."
		},
		{
			"directive": "param",
			"text": "steps\t\tnumber\t\tThe number of interpolatioon passes to do.",
			"name": "steps",
			"type": "number",
			"description": "The number of interpolatioon passes to do."
		},
		{
			"directive": "returns",
			"text": "Vector3[]\tA (longer) list of interpolated points.",
			"type": "Vector3[]",
			"description": "A (longer) list of interpolated points."
		}
	],
	"line": 17,
	"namespace": "worldeditadditions_core",
	"line_last": 24,
	"name": "chaikin",
	"instanced": false,
	"args": [
		"arr_pos",
		"steps"
	],
	"text": "--- Chaikin curve smoothing implementation.\n-- This algorithm works by taking a list of points that define a segmented line,\n-- and then interpolating between them to smooth the line.\n-- @source Ported from https://git.starbeamrainbowlabs.com/sbrl-GitLab/Chaikin-Generator/src/branch/master/ChaikinGenerator/ChaikinCurve.cs\n-- @param\tarr_pos\t\tVector3[]\tA list of points to interpolate.\n-- @param\tsteps\t\tnumber\t\tThe number of interpolatioon passes to do.\n-- @returns\tVector3[]\tA (longer) list of interpolated points.\nlocal function chaikin(arr_pos, steps)",
	"params": [
		{
			"directive": "param",
			"text": "arr_pos\t\tVector3[]\tA list of points to interpolate.",
			"name": "arr_pos",
			"type": "Vector3[]",
			"description": "A list of points to interpolate."
		},
		{
			"directive": "param",
			"text": "steps\t\tnumber\t\tThe number of interpolatioon passes to do.",
			"name": "steps",
			"type": "number",
			"description": "The number of interpolatioon passes to do."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3[]\tA (longer) list of interpolated points.",
		"type": "Vector3[]",
		"description": "A (longer) list of interpolated points."
	},
	"name_full": "worldeditadditions_core.chaikin",
	"filename": "worldeditadditions_core/utils/chaikin.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/chaikin.lua#L18-L25"
}

clamp 🔗

Clamp a number to ensure it falls within a given range.

Arguments

NameTypeDefault valueDescription
valuenumbernil

The value to clamp.

minnumbernil

The minimum allowed value.

maxnumbernil

The maximum allowed value.

Returns

number :

The clamped number.

Source
--- Clamp a number to ensure it falls within a given range.
-- @param	value	number	The value to clamp.
-- @param	min		number	The minimum allowed value.
-- @param	max		number	The maximum allowed value.
-- @returns	number	The clamped number.
function wea_c.clamp(value, min, max)
{
	"type": "function",
	"internal": false,
	"description": "Clamp a number to ensure it falls within a given range.",
	"directives": [
		{
			"directive": "param",
			"text": "value\tnumber\tThe value to clamp.",
			"name": "value",
			"type": "number",
			"description": "The value to clamp."
		},
		{
			"directive": "param",
			"text": "min\t\tnumber\tThe minimum allowed value.",
			"name": "min",
			"type": "number",
			"description": "The minimum allowed value."
		},
		{
			"directive": "param",
			"text": "max\t\tnumber\tThe maximum allowed value.",
			"name": "max",
			"type": "number",
			"description": "The maximum allowed value."
		},
		{
			"directive": "returns",
			"text": "number\tThe clamped number.",
			"type": "number",
			"description": "The clamped number."
		}
	],
	"line": 107,
	"namespace": "worldeditadditions_core",
	"line_last": 112,
	"name": "clamp",
	"instanced": false,
	"args": [
		"value",
		"min",
		"max"
	],
	"text": "--- Clamp a number to ensure it falls within a given range.\n-- @param\tvalue\tnumber\tThe value to clamp.\n-- @param\tmin\t\tnumber\tThe minimum allowed value.\n-- @param\tmax\t\tnumber\tThe maximum allowed value.\n-- @returns\tnumber\tThe clamped number.\nfunction wea_c.clamp(value, min, max)",
	"params": [
		{
			"directive": "param",
			"text": "value\tnumber\tThe value to clamp.",
			"name": "value",
			"type": "number",
			"description": "The value to clamp."
		},
		{
			"directive": "param",
			"text": "min\t\tnumber\tThe minimum allowed value.",
			"name": "min",
			"type": "number",
			"description": "The minimum allowed value."
		},
		{
			"directive": "param",
			"text": "max\t\tnumber\tThe maximum allowed value.",
			"name": "max",
			"type": "number",
			"description": "The maximum allowed value."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe clamped number.",
		"type": "number",
		"description": "The clamped number."
	},
	"name_full": "worldeditadditions_core.clamp",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L108-L113"
}

command_exists 🔗

Returns whether a WorldEditAdditions (or WorldEdit) command exists with the given name. Note that this does NOT check for general Minetest chat commands - only commands registered through WorldEditAdditions or WorldEdit, if WorldEdit is currently loaded - the eventual plan is to make it an optional dependency.

Arguments

NameTypeDefault valueDescription
cmdnamestringnil

The name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type //layers in-game, then you'd call worldeditadditions.command_exists(&quot;/layers&quot;).

only_weaboolnil

If true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit.

Returns

bool :

Whether a WorldEdit/WorldEditAdditions command exists with the given name.

Source
--- Returns whether a WorldEditAdditions (or WorldEdit) command exists with the given name.
-- Note that this does NOT check for general Minetest chat commands - only commands registered through WorldEditAdditions or WorldEdit, if WorldEdit is currently loaded - the eventual plan is to make it an optional dependency.
-- @param	cmdname		string	The name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type `//layers` in-game, then you'd call `worldeditadditions.command_exists("/layers")`.
-- @param	only_wea	bool	If true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit.
-- @returns	bool		Whether a WorldEdit/WorldEditAdditions command exists with the given name.
local function command_exists(cmdname, only_wea)
{
	"type": "function",
	"internal": false,
	"description": "Returns whether a WorldEditAdditions (or WorldEdit) command exists with the given name.\nNote that this does NOT check for general Minetest chat commands - only commands registered through WorldEditAdditions or WorldEdit, if WorldEdit is currently loaded - the eventual plan is to make it an optional dependency.",
	"directives": [
		{
			"directive": "param",
			"text": "cmdname\t\tstring\tThe name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type `//layers` in-game, then you'd call `worldeditadditions.command_exists(\"/layers\")`.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type `//layers` in-game, then you'd call `worldeditadditions.command_exists(\"/layers\")`."
		},
		{
			"directive": "param",
			"text": "only_wea\tbool\tIf true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit.",
			"name": "only_wea",
			"type": "bool",
			"description": "If true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit."
		},
		{
			"directive": "returns",
			"text": "bool\t\tWhether a WorldEdit/WorldEditAdditions command exists with the given name.",
			"type": "bool",
			"description": "Whether a WorldEdit/WorldEditAdditions command exists with the given name."
		}
	],
	"line": 5,
	"namespace": "worldeditadditions_core",
	"line_last": 10,
	"name": "command_exists",
	"instanced": false,
	"args": [
		"cmdname",
		"only_wea"
	],
	"text": "--- Returns whether a WorldEditAdditions (or WorldEdit) command exists with the given name.\n-- Note that this does NOT check for general Minetest chat commands - only commands registered through WorldEditAdditions or WorldEdit, if WorldEdit is currently loaded - the eventual plan is to make it an optional dependency.\n-- @param\tcmdname\t\tstring\tThe name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type `//layers` in-game, then you'd call `worldeditadditions.command_exists(\"/layers\")`.\n-- @param\tonly_wea\tbool\tIf true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit.\n-- @returns\tbool\t\tWhether a WorldEdit/WorldEditAdditions command exists with the given name.\nlocal function command_exists(cmdname, only_wea)",
	"params": [
		{
			"directive": "param",
			"text": "cmdname\t\tstring\tThe name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type `//layers` in-game, then you'd call `worldeditadditions.command_exists(\"/layers\")`.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command to check for. Remember to remove the first forward slash! In other words if you would normally type `//layers` in-game, then you'd call `worldeditadditions.command_exists(\"/layers\")`."
		},
		{
			"directive": "param",
			"text": "only_wea\tbool\tIf true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit.",
			"name": "only_wea",
			"type": "bool",
			"description": "If true, then only check for WorldEditAdditions commands and not commands from related compatible mods such as WorldEdit."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\tWhether a WorldEdit/WorldEditAdditions command exists with the given name.",
		"type": "bool",
		"description": "Whether a WorldEdit/WorldEditAdditions command exists with the given name."
	},
	"name_full": "worldeditadditions_core.command_exists",
	"filename": "worldeditadditions_core/core/command_exists.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/command_exists.lua#L6-L11"
}

dir_to_xyz 🔗

Dehumanize Direction: translates up, down, left, right, front, into xyz based on player orientation.

Arguments

NameTypeDefault valueDescription
namestringnil

The name of the player to return facing direction of.

dirstringnil

Relative direction to translate.

Returns

string :

Returns axis name and sign multiplier.

Source
--- Dehumanize Direction: translates up, down, left, right, front, into xyz based on player orientation.
-- @deprecated		Use wea_c.player_dir instead.
-- @param	name	string	The name of the player to return facing direction of.
-- @param	dir	string	Relative direction to translate.
-- @return	string	Returns axis name and sign multiplier.
function wea_c.dir_to_xyz(name, dir)
{
	"type": "function",
	"internal": false,
	"description": "Dehumanize Direction: translates up, down, left, right, front, into xyz based on player orientation.",
	"directives": [
		{
			"directive": "deprecated",
			"text": "Use wea_c.player_dir instead."
		},
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		},
		{
			"directive": "param",
			"text": "dir\tstring\tRelative direction to translate.",
			"name": "dir",
			"type": "string",
			"description": "Relative direction to translate."
		},
		{
			"directive": "returns",
			"text": "string\tReturns axis name and sign multiplier.",
			"type": "string",
			"description": "Returns axis name and sign multiplier."
		}
	],
	"line": 105,
	"namespace": "worldeditadditions_core",
	"line_last": 110,
	"name": "dir_to_xyz",
	"instanced": false,
	"args": [
		"name",
		"dir"
	],
	"text": "--- Dehumanize Direction: translates up, down, left, right, front, into xyz based on player orientation.\n-- @deprecated\t\tUse wea_c.player_dir instead.\n-- @param\tname\tstring\tThe name of the player to return facing direction of.\n-- @param\tdir\tstring\tRelative direction to translate.\n-- @return\tstring\tReturns axis name and sign multiplier.\nfunction wea_c.dir_to_xyz(name, dir)",
	"params": [
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		},
		{
			"directive": "param",
			"text": "dir\tstring\tRelative direction to translate.",
			"name": "dir",
			"type": "string",
			"description": "Relative direction to translate."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string\tReturns axis name and sign multiplier.",
		"type": "string",
		"description": "Returns axis name and sign multiplier."
	},
	"name_full": "worldeditadditions_core.dir_to_xyz",
	"filename": "worldeditadditions_core/utils/player.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/player.lua#L106-L111"
}

emerge_area 🔗

Loads the area defined by the specified region using minetest.emerge_area. Unlike minetest.emerge_area, this command calls the specified callback only once upon completion.

Arguments

NameTypeDefault valueDescription
{Vector}pos1nil

The first position defining the area to emerge.

{Vector}pos2nil

The second position defining the area to emerge.

{function}callbacknil

The callback to call when the emerging process is complete.

{any}callback_statenil

A state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)

Returns

nil

Source
--- Loads the area defined by the specified region using minetest.emerge_area.
-- Unlike minetest.emerge_area, this command calls the specified callback only
-- once upon completion.
-- @param	{Vector}	pos1		The first position defining the area to emerge.
-- @param	{Vector}	pos2		The second position defining the area to emerge.
-- @param	{function}	callback	The callback to call when the emerging process is complete.
-- @param	{any}		callback_state	A state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)
function wea_c.emerge_area(pos1, pos2, callback, callback_state)
{
	"type": "function",
	"internal": false,
	"description": "Loads the area defined by the specified region using minetest.emerge_area.\nUnlike minetest.emerge_area, this command calls the specified callback only\nonce upon completion.",
	"directives": [
		{
			"directive": "param",
			"text": "{Vector}\tpos1\t\tThe first position defining the area to emerge.",
			"name": "{Vector}",
			"type": "pos1",
			"description": "The first position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "{Vector}\tpos2\t\tThe second position defining the area to emerge.",
			"name": "{Vector}",
			"type": "pos2",
			"description": "The second position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "{function}\tcallback\tThe callback to call when the emerging process is complete.",
			"name": "{function}",
			"type": "callback",
			"description": "The callback to call when the emerging process is complete."
		},
		{
			"directive": "param",
			"text": "{any}\t\tcallback_state\tA state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)",
			"name": "{any}",
			"type": "callback_state",
			"description": "A state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)"
		}
	],
	"line": 81,
	"namespace": "worldeditadditions_core",
	"line_last": 88,
	"name": "emerge_area",
	"instanced": false,
	"args": [
		"pos1",
		"pos2",
		"callback",
		"callback_state"
	],
	"text": "--- Loads the area defined by the specified region using minetest.emerge_area.\n-- Unlike minetest.emerge_area, this command calls the specified callback only\n-- once upon completion.\n-- @param\t{Vector}\tpos1\t\tThe first position defining the area to emerge.\n-- @param\t{Vector}\tpos2\t\tThe second position defining the area to emerge.\n-- @param\t{function}\tcallback\tThe callback to call when the emerging process is complete.\n-- @param\t{any}\t\tcallback_state\tA state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)\nfunction wea_c.emerge_area(pos1, pos2, callback, callback_state)",
	"params": [
		{
			"directive": "param",
			"text": "{Vector}\tpos1\t\tThe first position defining the area to emerge.",
			"name": "{Vector}",
			"type": "pos1",
			"description": "The first position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "{Vector}\tpos2\t\tThe second position defining the area to emerge.",
			"name": "{Vector}",
			"type": "pos2",
			"description": "The second position defining the area to emerge."
		},
		{
			"directive": "param",
			"text": "{function}\tcallback\tThe callback to call when the emerging process is complete.",
			"name": "{function}",
			"type": "callback",
			"description": "The callback to call when the emerging process is complete."
		},
		{
			"directive": "param",
			"text": "{any}\t\tcallback_state\tA state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)",
			"name": "{any}",
			"type": "callback_state",
			"description": "A state object to pass to the callback as a 2nd parameter (the 1st parameter is the emerge_area progress tracking state object)"
		}
	],
	"name_full": "worldeditadditions_core.emerge_area",
	"filename": "worldeditadditions_core/utils/nodes.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/nodes.lua#L82-L89"
}

eta 🔗

Calculates the estimated time remaining from a list of times. Intended to be used where one has a number of works units, and one has a list of how long the most recent units have taken to run.

Arguments

NameTypeDefault valueDescription
existing_timesnumber[]nil

A list of times - in ms - that the most recent work units have taken.

done_countnumbernil

The number of work units completed so far.

total_countnumbernil

The total number of work units to be completed.

Returns

nil

Source
--- Calculates the estimated time remaining from a list of times.
-- Intended to be used where one has a number of works units, and one has a
-- list of how long the most recent units have taken to run.
-- @param	existing_times	number[]	A list of times - in ms - that the most recent work units have taken.
-- @param	done_count		number		The number of work units completed so far.
-- @param	total_count		number		The total number of work units to be completed.
function wea_c.eta(existing_times, done_count, total_count)
{
	"type": "function",
	"internal": false,
	"description": "Calculates the estimated time remaining from a list of times.\nIntended to be used where one has a number of works units, and one has a\nlist of how long the most recent units have taken to run.",
	"directives": [
		{
			"directive": "param",
			"text": "existing_times\tnumber[]\tA list of times - in ms - that the most recent work units have taken.",
			"name": "existing_times",
			"type": "number[]",
			"description": "A list of times - in ms - that the most recent work units have taken."
		},
		{
			"directive": "param",
			"text": "done_count\t\tnumber\t\tThe number of work units completed so far.",
			"name": "done_count",
			"type": "number",
			"description": "The number of work units completed so far."
		},
		{
			"directive": "param",
			"text": "total_count\t\tnumber\t\tThe total number of work units to be completed.",
			"name": "total_count",
			"type": "number",
			"description": "The total number of work units to be completed."
		}
	],
	"line": 79,
	"namespace": "worldeditadditions_core",
	"line_last": 85,
	"name": "eta",
	"instanced": false,
	"args": [
		"existing_times",
		"done_count",
		"total_count"
	],
	"text": "--- Calculates the estimated time remaining from a list of times.\n-- Intended to be used where one has a number of works units, and one has a\n-- list of how long the most recent units have taken to run.\n-- @param\texisting_times\tnumber[]\tA list of times - in ms - that the most recent work units have taken.\n-- @param\tdone_count\t\tnumber\t\tThe number of work units completed so far.\n-- @param\ttotal_count\t\tnumber\t\tThe total number of work units to be completed.\nfunction wea_c.eta(existing_times, done_count, total_count)",
	"params": [
		{
			"directive": "param",
			"text": "existing_times\tnumber[]\tA list of times - in ms - that the most recent work units have taken.",
			"name": "existing_times",
			"type": "number[]",
			"description": "A list of times - in ms - that the most recent work units have taken."
		},
		{
			"directive": "param",
			"text": "done_count\t\tnumber\t\tThe number of work units completed so far.",
			"name": "done_count",
			"type": "number",
			"description": "The number of work units completed so far."
		},
		{
			"directive": "param",
			"text": "total_count\t\tnumber\t\tThe total number of work units to be completed.",
			"name": "total_count",
			"type": "number",
			"description": "The total number of work units to be completed."
		}
	],
	"name_full": "worldeditadditions_core.eta",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L80-L86"
}

fetch_command_def 🔗

Fetches the definition of a WorldEditAdditions or WorldEdit command Does not support fetching generic Minetest commands - check minetest.registered_chatcommands for this.

Arguments

NameTypeDefault valueDescription
cmdnamestringnil

The name of the command to fetch the definition for.

Returns

nil

Source
--- Fetches the definition of a WorldEditAdditions or WorldEdit command
-- Does not support fetching generic Minetest commands - check
-- minetest.registered_chatcommands for this.
-- @param	cmdname		string		The name of the command to fetch the definition for.
local function fetch_command_def(cmdname)
{
	"type": "function",
	"internal": false,
	"description": "Fetches the definition of a WorldEditAdditions or WorldEdit command\nDoes not support fetching generic Minetest commands - check\nminetest.registered_chatcommands for this.",
	"directives": [
		{
			"directive": "param",
			"text": "cmdname\t\tstring\t\tThe name of the command to fetch the definition for.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command to fetch the definition for."
		}
	],
	"line": 4,
	"namespace": "worldeditadditions_core",
	"line_last": 8,
	"name": "fetch_command_def",
	"instanced": false,
	"args": [
		"cmdname"
	],
	"text": "--- Fetches the definition of a WorldEditAdditions or WorldEdit command\n-- Does not support fetching generic Minetest commands - check\n-- minetest.registered_chatcommands for this.\n-- @param\tcmdname\t\tstring\t\tThe name of the command to fetch the definition for.\nlocal function fetch_command_def(cmdname)",
	"params": [
		{
			"directive": "param",
			"text": "cmdname\t\tstring\t\tThe name of the command to fetch the definition for.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command to fetch the definition for."
		}
	],
	"name_full": "worldeditadditions_core.fetch_command_def",
	"filename": "worldeditadditions_core/core/fetch_command_def.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/fetch_command_def.lua#L5-L9"
}

get_all_sapling_aliases 🔗

Returns the current key ⇒ value table of sapling names and aliases.

Arguments

NameTypeDefault valueDescription

Returns

table

Source
--- Returns the current key ⇒ value table of sapling names and aliases.
-- @return	table
function wea_c.get_all_sapling_aliases()
{
	"type": "function",
	"internal": false,
	"description": "Returns the current key ⇒ value table of sapling names and aliases.",
	"directives": [
		{
			"directive": "returns",
			"text": "table",
			"type": "table"
		}
	],
	"line": 109,
	"namespace": "worldeditadditions_core",
	"line_last": 111,
	"name": "get_all_sapling_aliases",
	"instanced": false,
	"args": [
		""
	],
	"text": "--- Returns the current key ⇒ value table of sapling names and aliases.\n-- @return\ttable\nfunction wea_c.get_all_sapling_aliases()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "table",
		"type": "table"
	},
	"name_full": "worldeditadditions_core.get_all_sapling_aliases",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L110-L112"
}

get_ms_time 🔗

Returns the minetest.get_us_time() in ms

Arguments

NameTypeDefault valueDescription

Returns

float

Source
--- Returns the minetest.get_us_time() in ms
-- @return	float
function wea_c.get_ms_time()
{
	"type": "function",
	"internal": false,
	"description": "Returns the minetest.get_us_time() in ms",
	"directives": [
		{
			"directive": "returns",
			"text": "float",
			"type": "float"
		}
	],
	"line": 73,
	"namespace": "worldeditadditions_core",
	"line_last": 75,
	"name": "get_ms_time",
	"instanced": false,
	"args": [
		""
	],
	"text": "--- Returns the minetest.get_us_time() in ms\n-- @return\tfloat\nfunction wea_c.get_ms_time()",
	"params": [],
	"returns": {
		"directive": "returns",
		"text": "float",
		"type": "float"
	},
	"name_full": "worldeditadditions_core.get_ms_time",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L74-L76"
}

getsign 🔗

Returns the sign (+ or -) at the beginning of a string if present.

Arguments

NameTypeDefault valueDescription
srcstring|intnil

Input string.

Returns

string|int :

Returns the signed multiplier (1|-1).

Source
--- Returns the sign (+ or -) at the beginning of a string if present.
-- @param	src	string|int	Input string.
-- @return	string|int	Returns the signed multiplier (1|-1).
function wea_c.getsign(src)
{
	"type": "function",
	"internal": false,
	"description": "Returns the sign (+ or -) at the beginning of a string if present.",
	"directives": [
		{
			"directive": "param",
			"text": "src\tstring|int\tInput string.",
			"name": "src",
			"type": "string|int",
			"description": "Input string."
		},
		{
			"directive": "returns",
			"text": "string|int\tReturns the signed multiplier (1|-1).",
			"type": "string|int",
			"description": "Returns the signed multiplier (1|-1)."
		}
	],
	"line": 95,
	"namespace": "worldeditadditions_core",
	"line_last": 98,
	"name": "getsign",
	"instanced": false,
	"args": [
		"src"
	],
	"text": "--- Returns the sign (+ or -) at the beginning of a string if present.\n-- @param\tsrc\tstring|int\tInput string.\n-- @return\tstring|int\tReturns the signed multiplier (1|-1).\nfunction wea_c.getsign(src)",
	"params": [
		{
			"directive": "param",
			"text": "src\tstring|int\tInput string.",
			"name": "src",
			"type": "string|int",
			"description": "Input string."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string|int\tReturns the signed multiplier (1|-1).",
		"type": "string|int",
		"description": "Returns the signed multiplier (1|-1)."
	},
	"name_full": "worldeditadditions_core.getsign",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L96-L99"
}

inspect 🔗

Serialises an arbitrary value to a string. Note that although the resulting table looks like valid Lua, it isn't. Completely arbitrarily, if a table (or it's associated metatable) has the key __name then it is conidered the name of the parent metatable. This can be useful for identifying custom table-based types. Should anyone come across a 'proper' way to obtain the name of a metatable in pure vanilla Lua, I will update this to follow that standard instead.

Arguments

NameTypeDefault valueDescription
itemanynil

Input item to serialise.

sepstringnil

key value seperator

new_linestringnil

key value pair delimiter

Returns

string :

concatenated table pairs

Source
--- Serialises an arbitrary value to a string.
-- Note that although the resulting table *looks* like valid Lua, it isn't.
-- Completely arbitrarily, if a table (or it's associated metatable) has the
-- key __name then it is conidered the name of the parent metatable. This can
-- be useful for identifying custom table-based types.
-- Should anyone come across a 'proper' way to obtain the name of a metatable
-- in pure vanilla Lua, I will update this to follow that standard instead.
-- @param	item		any		Input item to serialise.
-- @param	sep			string	key value seperator
-- @param	new_line	string	key value pair delimiter
-- @return	string	concatenated table pairs
local function inspect(item, maxdepth)
{
	"type": "function",
	"internal": false,
	"description": "Serialises an arbitrary value to a string.\nNote that although the resulting table *looks* like valid Lua, it isn't.\nCompletely arbitrarily, if a table (or it's associated metatable) has the\nkey __name then it is conidered the name of the parent metatable. This can\nbe useful for identifying custom table-based types.\nShould anyone come across a 'proper' way to obtain the name of a metatable\nin pure vanilla Lua, I will update this to follow that standard instead.",
	"directives": [
		{
			"directive": "param",
			"text": "item\t\tany\t\tInput item to serialise.",
			"name": "item",
			"type": "any",
			"description": "Input item to serialise."
		},
		{
			"directive": "param",
			"text": "sep\t\t\tstring\tkey value seperator",
			"name": "sep",
			"type": "string",
			"description": "key value seperator"
		},
		{
			"directive": "param",
			"text": "new_line\tstring\tkey value pair delimiter",
			"name": "new_line",
			"type": "string",
			"description": "key value pair delimiter"
		},
		{
			"directive": "returns",
			"text": "string\tconcatenated table pairs",
			"type": "string",
			"description": "concatenated table pairs"
		}
	],
	"line": 9,
	"namespace": "worldeditadditions_core",
	"line_last": 20,
	"name": "inspect",
	"instanced": false,
	"args": [
		"item",
		"maxdepth"
	],
	"text": "--- Serialises an arbitrary value to a string.\n-- Note that although the resulting table *looks* like valid Lua, it isn't.\n-- Completely arbitrarily, if a table (or it's associated metatable) has the\n-- key __name then it is conidered the name of the parent metatable. This can\n-- be useful for identifying custom table-based types.\n-- Should anyone come across a 'proper' way to obtain the name of a metatable\n-- in pure vanilla Lua, I will update this to follow that standard instead.\n-- @param\titem\t\tany\t\tInput item to serialise.\n-- @param\tsep\t\t\tstring\tkey value seperator\n-- @param\tnew_line\tstring\tkey value pair delimiter\n-- @return\tstring\tconcatenated table pairs\nlocal function inspect(item, maxdepth)",
	"params": [
		{
			"directive": "param",
			"text": "item\t\tany\t\tInput item to serialise.",
			"name": "item",
			"type": "any",
			"description": "Input item to serialise."
		},
		{
			"directive": "param",
			"text": "sep\t\t\tstring\tkey value seperator",
			"name": "sep",
			"type": "string",
			"description": "key value seperator"
		},
		{
			"directive": "param",
			"text": "new_line\tstring\tkey value pair delimiter",
			"name": "new_line",
			"type": "string",
			"description": "key value pair delimiter"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string\tconcatenated table pairs",
		"type": "string",
		"description": "concatenated table pairs"
	},
	"name_full": "worldeditadditions_core.inspect",
	"filename": "worldeditadditions_core/utils/inspect.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/inspect.lua#L10-L21"
}

is_airlike 🔗

Determines whether the given node/content id is an airlike node or not. It is recommended that the result of this function be cached.

Arguments

NameTypeDefault valueDescription
idnumbernil

The content/node id to check.

Returns

bool :

Whether the given node/content id is an airlike node or not.

Source
--- Determines whether the given node/content id is an airlike node or not.
-- It is recommended that the result of this function be cached.
-- @param	id		number	The content/node id to check.
-- @return	bool	Whether the given node/content id is an airlike node or not.
function wea_c.is_airlike(id)
{
	"type": "function",
	"internal": false,
	"description": "Determines whether the given node/content id is an airlike node or not.\nIt is recommended that the result of this function be cached.",
	"directives": [
		{
			"directive": "param",
			"text": "id\t\tnumber\tThe content/node id to check.",
			"name": "id",
			"type": "number",
			"description": "The content/node id to check."
		},
		{
			"directive": "returns",
			"text": "bool\tWhether the given node/content id is an airlike node or not.",
			"type": "bool",
			"description": "Whether the given node/content id is an airlike node or not."
		}
	],
	"line": 8,
	"namespace": "worldeditadditions_core",
	"line_last": 12,
	"name": "is_airlike",
	"instanced": false,
	"args": [
		"id"
	],
	"text": "--- Determines whether the given node/content id is an airlike node or not.\n-- It is recommended that the result of this function be cached.\n-- @param\tid\t\tnumber\tThe content/node id to check.\n-- @return\tbool\tWhether the given node/content id is an airlike node or not.\nfunction wea_c.is_airlike(id)",
	"params": [
		{
			"directive": "param",
			"text": "id\t\tnumber\tThe content/node id to check.",
			"name": "id",
			"type": "number",
			"description": "The content/node id to check."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the given node/content id is an airlike node or not.",
		"type": "bool",
		"description": "Whether the given node/content id is an airlike node or not."
	},
	"name_full": "worldeditadditions_core.is_airlike",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L9-L13"
}

is_liquidlike 🔗

Determines whether the given node/content id is a liquid-ish node or not. It is recommended that the result of this function be cached.

Arguments

NameTypeDefault valueDescription
idnumbernil

The content/node id to check.

Returns

bool :

Whether the given node/content id is a liquid-ish node or not.

Source
--- Determines whether the given node/content id is a liquid-ish node or not.
-- It is recommended that the result of this function be cached.
-- @param	id		number	The content/node id to check.
-- @return	bool	Whether the given node/content id is a liquid-ish node or not.
function wea_c.is_liquidlike(id)
{
	"type": "function",
	"internal": false,
	"description": "Determines whether the given node/content id is a liquid-ish node or not.\nIt is recommended that the result of this function be cached.",
	"directives": [
		{
			"directive": "param",
			"text": "id\t\tnumber\tThe content/node id to check.",
			"name": "id",
			"type": "number",
			"description": "The content/node id to check."
		},
		{
			"directive": "returns",
			"text": "bool\tWhether the given node/content id is a liquid-ish node or not.",
			"type": "bool",
			"description": "Whether the given node/content id is a liquid-ish node or not."
		}
	],
	"line": 39,
	"namespace": "worldeditadditions_core",
	"line_last": 43,
	"name": "is_liquidlike",
	"instanced": false,
	"args": [
		"id"
	],
	"text": "--- Determines whether the given node/content id is a liquid-ish node or not.\n-- It is recommended that the result of this function be cached.\n-- @param\tid\t\tnumber\tThe content/node id to check.\n-- @return\tbool\tWhether the given node/content id is a liquid-ish node or not.\nfunction wea_c.is_liquidlike(id)",
	"params": [
		{
			"directive": "param",
			"text": "id\t\tnumber\tThe content/node id to check.",
			"name": "id",
			"type": "number",
			"description": "The content/node id to check."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the given node/content id is a liquid-ish node or not.",
		"type": "bool",
		"description": "Whether the given node/content id is a liquid-ish node or not."
	},
	"name_full": "worldeditadditions_core.is_liquidlike",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L40-L44"
}

is_sapling 🔗

Determines whether the given node/content id is a sapling or not. Nodes with the "sapling" group are considered saplings. It is recommended that the result of this function be cached.

Arguments

NameTypeDefault valueDescription
idnumbernil

The content/node id to check.

Returns

bool :

Whether the given node/content id is a sapling or not.

Source
--- Determines whether the given node/content id is a sapling or not.
-- Nodes with the "sapling" group are considered saplings.
-- It is recommended that the result of this function be cached.
-- @param	id		number	The content/node id to check.
-- @return	bool	Whether the given node/content id is a sapling or not.
function wea_c.is_sapling(id)
{
	"type": "function",
	"internal": false,
	"description": "Determines whether the given node/content id is a sapling or not.\nNodes with the \"sapling\" group are considered saplings.\nIt is recommended that the result of this function be cached.",
	"directives": [
		{
			"directive": "param",
			"text": "id\t\tnumber\tThe content/node id to check.",
			"name": "id",
			"type": "number",
			"description": "The content/node id to check."
		},
		{
			"directive": "returns",
			"text": "bool\tWhether the given node/content id is a sapling or not.",
			"type": "bool",
			"description": "Whether the given node/content id is a sapling or not."
		}
	],
	"line": 58,
	"namespace": "worldeditadditions_core",
	"line_last": 63,
	"name": "is_sapling",
	"instanced": false,
	"args": [
		"id"
	],
	"text": "--- Determines whether the given node/content id is a sapling or not.\n-- Nodes with the \"sapling\" group are considered saplings.\n-- It is recommended that the result of this function be cached.\n-- @param\tid\t\tnumber\tThe content/node id to check.\n-- @return\tbool\tWhether the given node/content id is a sapling or not.\nfunction wea_c.is_sapling(id)",
	"params": [
		{
			"directive": "param",
			"text": "id\t\tnumber\tThe content/node id to check.",
			"name": "id",
			"type": "number",
			"description": "The content/node id to check."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether the given node/content id is a sapling or not.",
		"type": "bool",
		"description": "Whether the given node/content id is a sapling or not."
	},
	"name_full": "worldeditadditions_core.is_sapling",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L59-L64"
}

linear_interpolate 🔗

Interpolates between the 2 given points

TODO: refactor numbers.lua and move this function into there instead

Arguments

NameTypeDefault valueDescription
aVector3|numbernil

The starting point.

bVector3|numbernil

The ending point.

timenumbernil

The percentage between 0 and 1 to interpolate to.

Returns

Vector3|number :

The interpolated point.

Source
--- Interpolates between the 2 given points
-- 
-- TODO: refactor numbers.lua and move this function into there instead
-- @param	a		Vector3|number		The starting point.
-- @param	b		Vector3|number		The ending point.
-- @param	time	number				The percentage between 0 and 1 to interpolate to.
-- @returns	Vector3|number				The interpolated point.
local function linear_interpolate(a, b, time)
{
	"type": "function",
	"internal": false,
	"description": "Interpolates between the 2 given points\n\nTODO: refactor numbers.lua and move this function into there instead",
	"directives": [
		{
			"directive": "param",
			"text": "a\t\tVector3|number\t\tThe starting point.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The starting point."
		},
		{
			"directive": "param",
			"text": "b\t\tVector3|number\t\tThe ending point.",
			"name": "b",
			"type": "Vector3|number",
			"description": "The ending point."
		},
		{
			"directive": "param",
			"text": "time\tnumber\t\t\t\tThe percentage between 0 and 1 to interpolate to.",
			"name": "time",
			"type": "number",
			"description": "The percentage between 0 and 1 to interpolate to."
		},
		{
			"directive": "returns",
			"text": "Vector3|number\t\t\t\tThe interpolated point.",
			"type": "Vector3|number",
			"description": "The interpolated point."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core",
	"line_last": 13,
	"name": "linear_interpolate",
	"instanced": false,
	"args": [
		"a",
		"b",
		"time"
	],
	"text": "--- Interpolates between the 2 given points\n-- \n-- TODO: refactor numbers.lua and move this function into there instead\n-- @param\ta\t\tVector3|number\t\tThe starting point.\n-- @param\tb\t\tVector3|number\t\tThe ending point.\n-- @param\ttime\tnumber\t\t\t\tThe percentage between 0 and 1 to interpolate to.\n-- @returns\tVector3|number\t\t\t\tThe interpolated point.\nlocal function linear_interpolate(a, b, time)",
	"params": [
		{
			"directive": "param",
			"text": "a\t\tVector3|number\t\tThe starting point.",
			"name": "a",
			"type": "Vector3|number",
			"description": "The starting point."
		},
		{
			"directive": "param",
			"text": "b\t\tVector3|number\t\tThe ending point.",
			"name": "b",
			"type": "Vector3|number",
			"description": "The ending point."
		},
		{
			"directive": "param",
			"text": "time\tnumber\t\t\t\tThe percentage between 0 and 1 to interpolate to.",
			"name": "time",
			"type": "number",
			"description": "The percentage between 0 and 1 to interpolate to."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "Vector3|number\t\t\t\tThe interpolated point.",
		"type": "Vector3|number",
		"description": "The interpolated point."
	},
	"name_full": "worldeditadditions_core.linear_interpolate",
	"filename": "worldeditadditions_core/utils/chaikin.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/chaikin.lua#L7-L14"
}

max 🔗

Finds the maximum value in the given list.

Arguments

NameTypeDefault valueDescription
listnumber[]nil

The list (table) of numbers to find the maximum value of.

Returns

number :

The maximum value in the given list.

Source
--- Finds the maximum value in the given list.
-- @param	list	number[]	The list (table) of numbers to find the maximum value of.
-- @returns	number	The maximum value in the given list.
function wea_c.max(list)
{
	"type": "function",
	"internal": false,
	"description": "Finds the maximum value in the given list.",
	"directives": [
		{
			"directive": "param",
			"text": "list\tnumber[]\tThe list (table) of numbers to find the maximum value of.",
			"name": "list",
			"type": "number[]",
			"description": "The list (table) of numbers to find the maximum value of."
		},
		{
			"directive": "returns",
			"text": "number\tThe maximum value in the given list.",
			"type": "number",
			"description": "The maximum value in the given list."
		}
	],
	"line": 55,
	"namespace": "worldeditadditions_core",
	"line_last": 58,
	"name": "max",
	"instanced": false,
	"args": [
		"list"
	],
	"text": "--- Finds the maximum value in the given list.\n-- @param\tlist\tnumber[]\tThe list (table) of numbers to find the maximum value of.\n-- @returns\tnumber\tThe maximum value in the given list.\nfunction wea_c.max(list)",
	"params": [
		{
			"directive": "param",
			"text": "list\tnumber[]\tThe list (table) of numbers to find the maximum value of.",
			"name": "list",
			"type": "number[]",
			"description": "The list (table) of numbers to find the maximum value of."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe maximum value in the given list.",
		"type": "number",
		"description": "The maximum value in the given list."
	},
	"name_full": "worldeditadditions_core.max",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L56-L59"
}

min 🔗

Finds the minimum value in the given list.

Arguments

NameTypeDefault valueDescription
listnumber[]nil

The list (table) of numbers to find the minimum value of.

Returns

number :

The minimum value in the given list.

Source
--- Finds the minimum value in the given list.
-- @param	list	number[]	The list (table) of numbers to find the minimum value of.
-- @returns	number	The minimum value in the given list.
function wea_c.min(list)
{
	"type": "function",
	"internal": false,
	"description": "Finds the minimum value in the given list.",
	"directives": [
		{
			"directive": "param",
			"text": "list\tnumber[]\tThe list (table) of numbers to find the minimum value of.",
			"name": "list",
			"type": "number[]",
			"description": "The list (table) of numbers to find the minimum value of."
		},
		{
			"directive": "returns",
			"text": "number\tThe minimum value in the given list.",
			"type": "number",
			"description": "The minimum value in the given list."
		}
	],
	"line": 41,
	"namespace": "worldeditadditions_core",
	"line_last": 44,
	"name": "min",
	"instanced": false,
	"args": [
		"list"
	],
	"text": "--- Finds the minimum value in the given list.\n-- @param\tlist\tnumber[]\tThe list (table) of numbers to find the minimum value of.\n-- @returns\tnumber\tThe minimum value in the given list.\nfunction wea_c.min(list)",
	"params": [
		{
			"directive": "param",
			"text": "list\tnumber[]\tThe list (table) of numbers to find the minimum value of.",
			"name": "list",
			"type": "number[]",
			"description": "The list (table) of numbers to find the minimum value of."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\tThe minimum value in the given list.",
		"type": "number",
		"description": "The minimum value in the given list."
	},
	"name_full": "worldeditadditions_core.min",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L42-L45"
}

normalise_saplingname 🔗

Attempts to normalise a sapling name using the currently registered aliases.

Arguments

NameTypeDefault valueDescription
in_namestringnil

The sapling name to normalise

return_nil_on_failureboolnil

Whether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false).

Returns

nil

Source
--- Attempts to normalise a sapling name using the currently registered aliases.
-- @param	in_name					string	The sapling name  to normalise
-- @param	return_nil_on_failure	bool	Whether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false).
function wea_c.normalise_saplingname(in_name, return_nil_on_failure)
{
	"type": "function",
	"internal": false,
	"description": "Attempts to normalise a sapling name using the currently registered aliases.",
	"directives": [
		{
			"directive": "param",
			"text": "in_name\t\t\t\t\tstring\tThe sapling name  to normalise",
			"name": "in_name",
			"type": "string",
			"description": "The sapling name  to normalise"
		},
		{
			"directive": "param",
			"text": "return_nil_on_failure\tbool\tWhether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false).",
			"name": "return_nil_on_failure",
			"type": "bool",
			"description": "Whether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false)."
		}
	],
	"line": 115,
	"namespace": "worldeditadditions_core",
	"line_last": 118,
	"name": "normalise_saplingname",
	"instanced": false,
	"args": [
		"in_name",
		"return_nil_on_failure"
	],
	"text": "--- Attempts to normalise a sapling name using the currently registered aliases.\n-- @param\tin_name\t\t\t\t\tstring\tThe sapling name  to normalise\n-- @param\treturn_nil_on_failure\tbool\tWhether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false).\nfunction wea_c.normalise_saplingname(in_name, return_nil_on_failure)",
	"params": [
		{
			"directive": "param",
			"text": "in_name\t\t\t\t\tstring\tThe sapling name  to normalise",
			"name": "in_name",
			"type": "string",
			"description": "The sapling name  to normalise"
		},
		{
			"directive": "param",
			"text": "return_nil_on_failure\tbool\tWhether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false).",
			"name": "return_nil_on_failure",
			"type": "bool",
			"description": "Whether to return nil if we fail to resolve the sapling name with an alias, or return the original node name instead (default: false)."
		}
	],
	"name_full": "worldeditadditions_core.normalise_saplingname",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L116-L119"
}

player_axis2d 🔗

Returns the player's facing direction on the horizontal axes only.

Arguments

NameTypeDefault valueDescription
namestringnil

The name of the player to return facing direction of.

Returns

string,int :

Returns axis name and sign multiplier.

Source
--- Returns the player's facing direction on the horizontal axes only.
-- @deprecated		Use wea_c.player_dir instead.
-- @param	name	string	The name of the player to return facing direction of.
-- @return	string,int	Returns axis name and sign multiplier.
function wea_c.player_axis2d(name)
{
	"type": "function",
	"internal": false,
	"description": "Returns the player's facing direction on the horizontal axes only.",
	"directives": [
		{
			"directive": "deprecated",
			"text": "Use wea_c.player_dir instead."
		},
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		},
		{
			"directive": "returns",
			"text": "string,int\tReturns axis name and sign multiplier.",
			"type": "string,int",
			"description": "Returns axis name and sign multiplier."
		}
	],
	"line": 82,
	"namespace": "worldeditadditions_core",
	"line_last": 86,
	"name": "player_axis2d",
	"instanced": false,
	"args": [
		"name"
	],
	"text": "--- Returns the player's facing direction on the horizontal axes only.\n-- @deprecated\t\tUse wea_c.player_dir instead.\n-- @param\tname\tstring\tThe name of the player to return facing direction of.\n-- @return\tstring,int\tReturns axis name and sign multiplier.\nfunction wea_c.player_axis2d(name)",
	"params": [
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string,int\tReturns axis name and sign multiplier.",
		"type": "string,int",
		"description": "Returns axis name and sign multiplier."
	},
	"name_full": "worldeditadditions_core.player_axis2d",
	"filename": "worldeditadditions_core/utils/player.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/player.lua#L83-L87"
}

player_dir 🔗

Returns the player's facing info including relative DIRs.

Arguments

NameTypeDefault valueDescription
namestringnil

The name of the player to return facing direction of.

Returns

table(vector3+) :

xyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down).

Source
--- Returns the player's facing info including relative DIRs.
-- @param	name	string	The name of the player to return facing direction of.
-- @returns	table(vector3+)	xyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down).
function wea_c.player_dir(name)
{
	"type": "function",
	"internal": false,
	"description": "Returns the player's facing info including relative DIRs.",
	"directives": [
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		},
		{
			"directive": "returns",
			"text": "table(vector3+)\txyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down).",
			"type": "table(vector3+)",
			"description": "xyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down)."
		}
	],
	"line": 15,
	"namespace": "worldeditadditions_core",
	"line_last": 18,
	"name": "player_dir",
	"instanced": false,
	"args": [
		"name"
	],
	"text": "--- Returns the player's facing info including relative DIRs.\n-- @param\tname\tstring\tThe name of the player to return facing direction of.\n-- @returns\ttable(vector3+)\txyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down).\nfunction wea_c.player_dir(name)",
	"params": [
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "table(vector3+)\txyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down).",
		"type": "table(vector3+)",
		"description": "xyz raw values and {axis,sign} tables for facing direction and relative direction keys (front, back, left, right, up, down)."
	},
	"name_full": "worldeditadditions_core.player_dir",
	"filename": "worldeditadditions_core/utils/player.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/player.lua#L16-L19"
}

player_vector 🔗

Returns the player's position (at leg level).

Arguments

NameTypeDefault valueDescription
namestringnil

The name of the player to return facing direction of.

Returns

vector :

Returns position.

Source
--- Returns the player's position (at leg level).
-- @param	name	string	The name of the player to return facing direction of.
-- @return	vector	Returns position.
function wea_c.player_vector(name)
{
	"type": "function",
	"internal": false,
	"description": "Returns the player's position (at leg level).",
	"directives": [
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		},
		{
			"directive": "returns",
			"text": "vector\tReturns position.",
			"type": "vector",
			"description": "Returns position."
		}
	],
	"line": 8,
	"namespace": "worldeditadditions_core",
	"line_last": 11,
	"name": "player_vector",
	"instanced": false,
	"args": [
		"name"
	],
	"text": "--- Returns the player's position (at leg level).\n-- @param\tname\tstring\tThe name of the player to return facing direction of.\n-- @return\tvector\tReturns position.\nfunction wea_c.player_vector(name)",
	"params": [
		{
			"directive": "param",
			"text": "name\tstring\tThe name of the player to return facing direction of.",
			"name": "name",
			"type": "string",
			"description": "The name of the player to return facing direction of."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "vector\tReturns position.",
		"type": "vector",
		"description": "Returns position."
	},
	"name_full": "worldeditadditions_core.player_vector",
	"filename": "worldeditadditions_core/utils/player.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/player.lua#L9-L12"
}

range 🔗

Return a sequence of numbers as a list.

Arguments

NameTypeDefault valueDescription
minnumbernil

The minimum value in the sequence.

maxnumbernil

The maximum value in the sequence.

stepnumbernil

The value to increment between each value in the sequence.

Returns

number[] :

The list of numbers.

Source
--- Return a sequence of numbers as a list.
-- @example
-- local result = worldeditadditions_core.range(0, 10, 1)
-- -- [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]
-- @example
-- local result = worldeditadditions_core.range(6, 12, 2)
-- -- [ 6, 8, 10, 12 ]
-- @param	min		number		The minimum value in the sequence.
-- @param	max		number		The maximum value in the sequence.
-- @param	step	number		The value to increment between each value in the sequence.
-- @returns	number[]	The list of numbers.
function wea_c.range(min, max, step)
{
	"type": "function",
	"internal": false,
	"description": "Return a sequence of numbers as a list.",
	"directives": [
		{
			"directive": "example",
			"text": "local result = worldeditadditions_core.range(0, 10, 1)\n-- [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]"
		},
		{
			"directive": "example",
			"text": "local result = worldeditadditions_core.range(6, 12, 2)\n-- [ 6, 8, 10, 12 ]"
		},
		{
			"directive": "param",
			"text": "min\t\tnumber\t\tThe minimum value in the sequence.",
			"name": "min",
			"type": "number",
			"description": "The minimum value in the sequence."
		},
		{
			"directive": "param",
			"text": "max\t\tnumber\t\tThe maximum value in the sequence.",
			"name": "max",
			"type": "number",
			"description": "The maximum value in the sequence."
		},
		{
			"directive": "param",
			"text": "step\tnumber\t\tThe value to increment between each value in the sequence.",
			"name": "step",
			"type": "number",
			"description": "The value to increment between each value in the sequence."
		},
		{
			"directive": "returns",
			"text": "number[]\tThe list of numbers.",
			"type": "number[]",
			"description": "The list of numbers."
		}
	],
	"line": 118,
	"namespace": "worldeditadditions_core",
	"line_last": 129,
	"name": "range",
	"instanced": false,
	"args": [
		"min",
		"max",
		"step"
	],
	"text": "--- Return a sequence of numbers as a list.\n-- @example\n-- local result = worldeditadditions_core.range(0, 10, 1)\n-- -- [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 ]\n-- @example\n-- local result = worldeditadditions_core.range(6, 12, 2)\n-- -- [ 6, 8, 10, 12 ]\n-- @param\tmin\t\tnumber\t\tThe minimum value in the sequence.\n-- @param\tmax\t\tnumber\t\tThe maximum value in the sequence.\n-- @param\tstep\tnumber\t\tThe value to increment between each value in the sequence.\n-- @returns\tnumber[]\tThe list of numbers.\nfunction wea_c.range(min, max, step)",
	"params": [
		{
			"directive": "param",
			"text": "min\t\tnumber\t\tThe minimum value in the sequence.",
			"name": "min",
			"type": "number",
			"description": "The minimum value in the sequence."
		},
		{
			"directive": "param",
			"text": "max\t\tnumber\t\tThe maximum value in the sequence.",
			"name": "max",
			"type": "number",
			"description": "The maximum value in the sequence."
		},
		{
			"directive": "param",
			"text": "step\tnumber\t\tThe value to increment between each value in the sequence.",
			"name": "step",
			"type": "number",
			"description": "The value to increment between each value in the sequence."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number[]\tThe list of numbers.",
		"type": "number[]",
		"description": "The list of numbers."
	},
	"name_full": "worldeditadditions_core.range",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L119-L130"
}

raycast 🔗

Raycasts to find a node in the direction the given player is looking.

This function is not currently aware of custom hitboxes.

Arguments

NameTypeDefault valueDescription
playerPlayernil

The player object to raycast from.

maxdistnumbernil

The maximum distance to raycast.

skip_liquidboolnil

Whether to skip liquids when raycasting.

Returns

position, number :

nil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found.

Source
--- Raycasts to find a node in the direction the given player is looking.
-- 
-- This function is not currently aware of custom hitboxes.
-- @param	player			Player	The player object to raycast from.
-- @param	maxdist			number	The maximum distance to raycast.
-- @param	skip_liquid		bool	Whether to skip liquids when raycasting.
-- @return	position, number		nil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found.
function wea_c.raycast(player, maxdist, skip_liquid)
{
	"type": "function",
	"internal": false,
	"description": "Raycasts to find a node in the direction the given player is looking.\n\nThis function is not currently aware of custom hitboxes.",
	"directives": [
		{
			"directive": "param",
			"text": "player\t\t\tPlayer\tThe player object to raycast from.",
			"name": "player",
			"type": "Player",
			"description": "The player object to raycast from."
		},
		{
			"directive": "param",
			"text": "maxdist\t\t\tnumber\tThe maximum distance to raycast.",
			"name": "maxdist",
			"type": "number",
			"description": "The maximum distance to raycast."
		},
		{
			"directive": "param",
			"text": "skip_liquid\t\tbool\tWhether to skip liquids when raycasting.",
			"name": "skip_liquid",
			"type": "bool",
			"description": "Whether to skip liquids when raycasting."
		},
		{
			"directive": "returns",
			"text": "position, number\t\tnil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found.",
			"type": "position, number",
			"description": "nil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core",
	"line_last": 13,
	"name": "raycast",
	"instanced": false,
	"args": [
		"player",
		"maxdist",
		"skip_liquid"
	],
	"text": "--- Raycasts to find a node in the direction the given player is looking.\n-- \n-- This function is not currently aware of custom hitboxes.\n-- @param\tplayer\t\t\tPlayer\tThe player object to raycast from.\n-- @param\tmaxdist\t\t\tnumber\tThe maximum distance to raycast.\n-- @param\tskip_liquid\t\tbool\tWhether to skip liquids when raycasting.\n-- @return\tposition, number\t\tnil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found.\nfunction wea_c.raycast(player, maxdist, skip_liquid)",
	"params": [
		{
			"directive": "param",
			"text": "player\t\t\tPlayer\tThe player object to raycast from.",
			"name": "player",
			"type": "Player",
			"description": "The player object to raycast from."
		},
		{
			"directive": "param",
			"text": "maxdist\t\t\tnumber\tThe maximum distance to raycast.",
			"name": "maxdist",
			"type": "number",
			"description": "The maximum distance to raycast."
		},
		{
			"directive": "param",
			"text": "skip_liquid\t\tbool\tWhether to skip liquids when raycasting.",
			"name": "skip_liquid",
			"type": "bool",
			"description": "Whether to skip liquids when raycasting."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "position, number\t\tnil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found.",
		"type": "position, number",
		"description": "nil if nothing was found (or unloaded chunks were hit), or the position as an {x, y, z} table and the node id if something was found."
	},
	"name_full": "worldeditadditions_core.raycast",
	"filename": "worldeditadditions_core/utils/raycast_adv.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/raycast_adv.lua#L7-L14"
}

register_alias 🔗

Register an alias of an existing worldeditadditions/worldedit command.

Arguments

NameTypeDefault valueDescription
cmdname_targetstringnil

The target name for the alias

cmdname_sourcestringnil

The source name of the command to alias the target to.

overrideboolfalse

Whether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.

Returns

bool :

Whether the override operation was successful or not.

Source
--- Register an alias of an existing worldeditadditions/worldedit command.
-- @param	cmdname_target	string	The target name for the alias
-- @param	cmdname_source	string	The source name of the command to alias the target to.
-- @param	override=false	bool	Whether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.
-- @returns	bool			Whether the override operation was successful or not.
local function register_alias(cmdname_target, cmdname_source, override)
{
	"type": "function",
	"internal": false,
	"description": "Register an alias of an existing worldeditadditions/worldedit command.",
	"directives": [
		{
			"directive": "param",
			"text": "cmdname_target\tstring\tThe target name for the alias",
			"name": "cmdname_target",
			"type": "string",
			"description": "The target name for the alias"
		},
		{
			"directive": "param",
			"text": "cmdname_source\tstring\tThe source name of the command to alias the target to.",
			"name": "cmdname_source",
			"type": "string",
			"description": "The source name of the command to alias the target to."
		},
		{
			"directive": "param",
			"text": "override=false\tbool\tWhether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.",
			"name": "override",
			"type": "bool",
			"description": "Whether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.",
			"default_value": "false"
		},
		{
			"directive": "returns",
			"text": "bool\t\t\tWhether the override operation was successful or not.",
			"type": "bool",
			"description": "Whether the override operation was successful or not."
		}
	],
	"line": 6,
	"namespace": "worldeditadditions_core",
	"line_last": 11,
	"name": "register_alias",
	"instanced": false,
	"args": [
		"cmdname_target",
		"cmdname_source",
		"override"
	],
	"text": "--- Register an alias of an existing worldeditadditions/worldedit command.\n-- @param\tcmdname_target\tstring\tThe target name for the alias\n-- @param\tcmdname_source\tstring\tThe source name of the command to alias the target to.\n-- @param\toverride=false\tbool\tWhether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.\n-- @returns\tbool\t\t\tWhether the override operation was successful or not.\nlocal function register_alias(cmdname_target, cmdname_source, override)",
	"params": [
		{
			"directive": "param",
			"text": "cmdname_target\tstring\tThe target name for the alias",
			"name": "cmdname_target",
			"type": "string",
			"description": "The target name for the alias"
		},
		{
			"directive": "param",
			"text": "cmdname_source\tstring\tThe source name of the command to alias the target to.",
			"name": "cmdname_source",
			"type": "string",
			"description": "The source name of the command to alias the target to."
		},
		{
			"directive": "param",
			"text": "override=false\tbool\tWhether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.",
			"name": "override",
			"type": "bool",
			"description": "Whether to override the target command name if it exists. Defaults to false, which results in an error being thrown if the target command name already exists.",
			"default_value": "false"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\t\tWhether the override operation was successful or not.",
		"type": "bool",
		"description": "Whether the override operation was successful or not."
	},
	"name_full": "worldeditadditions_core.register_alias",
	"filename": "worldeditadditions_core/core/register_alias.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/register_alias.lua#L7-L12"
}

register_sapling_alias 🔗

Register a new sapling alias.

Arguments

NameTypeDefault valueDescription
sapling_node_namestringnil

The canonical name of the sapling.

aliasstringnil

The alias name of the sapling.

Returns

bool[,string] :

Whether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value.

Source
--- Register a new sapling alias.
-- @param	sapling_node_name	string		The canonical name of the sapling.
-- @param	alias				string		The alias name of the sapling.
-- @returns	bool[,string]		Whether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value.
function wea_c.register_sapling_alias(sapling_node_name, alias)
{
	"type": "function",
	"internal": false,
	"description": "Register a new sapling alias.",
	"directives": [
		{
			"directive": "param",
			"text": "sapling_node_name\tstring\t\tThe canonical name of the sapling.",
			"name": "sapling_node_name",
			"type": "string",
			"description": "The canonical name of the sapling."
		},
		{
			"directive": "param",
			"text": "alias\t\t\t\tstring\t\tThe alias name of the sapling.",
			"name": "alias",
			"type": "string",
			"description": "The alias name of the sapling."
		},
		{
			"directive": "returns",
			"text": "bool[,string]\t\tWhether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value.",
			"type": "bool[,string]",
			"description": "Whether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value."
		}
	],
	"line": 84,
	"namespace": "worldeditadditions_core",
	"line_last": 88,
	"name": "register_sapling_alias",
	"instanced": false,
	"args": [
		"sapling_node_name",
		"alias"
	],
	"text": "--- Register a new sapling alias.\n-- @param\tsapling_node_name\tstring\t\tThe canonical name of the sapling.\n-- @param\talias\t\t\t\tstring\t\tThe alias name of the sapling.\n-- @returns\tbool[,string]\t\tWhether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value.\nfunction wea_c.register_sapling_alias(sapling_node_name, alias)",
	"params": [
		{
			"directive": "param",
			"text": "sapling_node_name\tstring\t\tThe canonical name of the sapling.",
			"name": "sapling_node_name",
			"type": "string",
			"description": "The canonical name of the sapling."
		},
		{
			"directive": "param",
			"text": "alias\t\t\t\tstring\t\tThe alias name of the sapling.",
			"name": "alias",
			"type": "string",
			"description": "The alias name of the sapling."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool[,string]\t\tWhether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value.",
		"type": "bool[,string]",
		"description": "Whether the alias registration was successful or not. If false, then an error message as a string is also returned as the second value."
	},
	"name_full": "worldeditadditions_core.register_sapling_alias",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L85-L89"
}

register_sapling_alias_many 🔗

Convenience function to register many sapling aliases at once.

Arguments

NameTypeDefault valueDescription
tbl[string, string][]nil

A list of tables containing exactly 2 strings in the form { sapling_node_name, alias }.

Returns

bool[,string] :

Whether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value.

Source
--- Convenience function to register many sapling aliases at once.
-- @param	tbl	[string, string][]	A list of tables containing exactly 2 strings in the form { sapling_node_name, alias }.
-- @returns	bool[,string]		Whether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value.
function wea_c.register_sapling_alias_many(tbl)
{
	"type": "function",
	"internal": false,
	"description": "Convenience function to register many sapling aliases at once.",
	"directives": [
		{
			"directive": "param",
			"text": "tbl\t[string, string][]\tA list of tables containing exactly 2 strings in the form { sapling_node_name, alias }.",
			"name": "tbl",
			"type": "[string, string][]",
			"description": "A list of tables containing exactly 2 strings in the form { sapling_node_name, alias }."
		},
		{
			"directive": "returns",
			"text": "bool[,string]\t\tWhether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value.",
			"type": "bool[,string]",
			"description": "Whether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value."
		}
	],
	"line": 95,
	"namespace": "worldeditadditions_core",
	"line_last": 98,
	"name": "register_sapling_alias_many",
	"instanced": false,
	"args": [
		"tbl"
	],
	"text": "--- Convenience function to register many sapling aliases at once.\n-- @param\ttbl\t[string, string][]\tA list of tables containing exactly 2 strings in the form { sapling_node_name, alias }.\n-- @returns\tbool[,string]\t\tWhether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value.\nfunction wea_c.register_sapling_alias_many(tbl)",
	"params": [
		{
			"directive": "param",
			"text": "tbl\t[string, string][]\tA list of tables containing exactly 2 strings in the form { sapling_node_name, alias }.",
			"name": "tbl",
			"type": "[string, string][]",
			"description": "A list of tables containing exactly 2 strings in the form { sapling_node_name, alias }."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool[,string]\t\tWhether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value.",
		"type": "bool[,string]",
		"description": "Whether the alias registrations were successful or not. If false, then an error message as a string is also returned as the second value."
	},
	"name_full": "worldeditadditions_core.register_sapling_alias_many",
	"filename": "worldeditadditions_core/utils/node_identification.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/node_identification.lua#L96-L99"
}

round 🔗

Rounds a number to a given number of decimal places.

Arguments

NameTypeDefault valueDescription
numnumbernil

The number to round.

numDecimalPlacesnumbernil

The number of decimal places to round to. Should be an integer greater than or equal to 0.

Returns

nil

Source
--- Rounds a number to a given number of decimal places.
-- @source http://lua-users.org/wiki/SimpleRound
-- @param	num					number	The number to round.
-- @param	numDecimalPlaces 	number	The number of decimal places to round to. Should be an integer greater than or equal to 0.
function wea_c.round(num, numDecimalPlaces)
{
	"type": "function",
	"internal": false,
	"description": "Rounds a number to a given number of decimal places.",
	"directives": [
		{
			"directive": "source",
			"text": "http://lua-users.org/wiki/SimpleRound"
		},
		{
			"directive": "param",
			"text": "num\t\t\t\t\tnumber\tThe number to round.",
			"name": "num",
			"type": "number",
			"description": "The number to round."
		},
		{
			"directive": "param",
			"text": "numDecimalPlaces \tnumber\tThe number of decimal places to round to. Should be an integer greater than or equal to 0.",
			"name": "numDecimalPlaces ",
			"type": "number",
			"description": "The number of decimal places to round to. Should be an integer greater than or equal to 0."
		}
	],
	"line": 4,
	"namespace": "worldeditadditions_core",
	"line_last": 8,
	"name": "round",
	"instanced": false,
	"args": [
		"num",
		"numDecimalPlaces"
	],
	"text": "--- Rounds a number to a given number of decimal places.\n-- @source http://lua-users.org/wiki/SimpleRound\n-- @param\tnum\t\t\t\t\tnumber\tThe number to round.\n-- @param\tnumDecimalPlaces \tnumber\tThe number of decimal places to round to. Should be an integer greater than or equal to 0.\nfunction wea_c.round(num, numDecimalPlaces)",
	"params": [
		{
			"directive": "param",
			"text": "num\t\t\t\t\tnumber\tThe number to round.",
			"name": "num",
			"type": "number",
			"description": "The number to round."
		},
		{
			"directive": "param",
			"text": "numDecimalPlaces \tnumber\tThe number of decimal places to round to. Should be an integer greater than or equal to 0.",
			"name": "numDecimalPlaces ",
			"type": "number",
			"description": "The number of decimal places to round to. Should be an integer greater than or equal to 0."
		}
	],
	"name_full": "worldeditadditions_core.round",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L5-L9"
}

run_command 🔗

Runs a command with the given name and options for the given player.

Arguments

NameTypeDefault valueDescription
cmdnamestringnil

The name of the command to run.

optionstablenil

The table of options associated with the command. See worldeditadditions_core.register_command for more information.

player_namestringnil

The name of the player to execute the command for.

paramtextstringnil

The unparsed argument string to pass to the command when executing it.

Returns

nil

Source
--- Runs a command with the given name and options for the given player.
-- @param	cmdname		string	The name of the command to run.
-- @param	options		table	The table of options associated with the command. See worldeditadditions_core.register_command for more information.
-- @param	player_name	string	The name of the player to execute the command for.
-- @param	paramtext	string	The unparsed argument string to pass to the command when executing it.
local function run_command(cmdname, options, player_name, paramtext)
{
	"type": "function",
	"internal": false,
	"description": "Runs a command with the given name and options for the given player.",
	"directives": [
		{
			"directive": "param",
			"text": "cmdname\t\tstring\tThe name of the command to run.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command to run."
		},
		{
			"directive": "param",
			"text": "options\t\ttable\tThe table of options associated with the command. See worldeditadditions_core.register_command for more information.",
			"name": "options",
			"type": "table",
			"description": "The table of options associated with the command. See worldeditadditions_core.register_command for more information."
		},
		{
			"directive": "param",
			"text": "player_name\tstring\tThe name of the player to execute the command for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to execute the command for."
		},
		{
			"directive": "param",
			"text": "paramtext\tstring\tThe unparsed argument string to pass to the command when executing it.",
			"name": "paramtext",
			"type": "string",
			"description": "The unparsed argument string to pass to the command when executing it."
		}
	],
	"line": 18,
	"namespace": "worldeditadditions_core",
	"line_last": 23,
	"name": "run_command",
	"instanced": false,
	"args": [
		"cmdname",
		"options",
		"player_name",
		"paramtext"
	],
	"text": "--- Runs a command with the given name and options for the given player.\n-- @param\tcmdname\t\tstring\tThe name of the command to run.\n-- @param\toptions\t\ttable\tThe table of options associated with the command. See worldeditadditions_core.register_command for more information.\n-- @param\tplayer_name\tstring\tThe name of the player to execute the command for.\n-- @param\tparamtext\tstring\tThe unparsed argument string to pass to the command when executing it.\nlocal function run_command(cmdname, options, player_name, paramtext)",
	"params": [
		{
			"directive": "param",
			"text": "cmdname\t\tstring\tThe name of the command to run.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command to run."
		},
		{
			"directive": "param",
			"text": "options\t\ttable\tThe table of options associated with the command. See worldeditadditions_core.register_command for more information.",
			"name": "options",
			"type": "table",
			"description": "The table of options associated with the command. See worldeditadditions_core.register_command for more information."
		},
		{
			"directive": "param",
			"text": "player_name\tstring\tThe name of the player to execute the command for.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player to execute the command for."
		},
		{
			"directive": "param",
			"text": "paramtext\tstring\tThe unparsed argument string to pass to the command when executing it.",
			"name": "paramtext",
			"type": "string",
			"description": "The unparsed argument string to pass to the command when executing it."
		}
	],
	"name_full": "worldeditadditions_core.run_command",
	"filename": "worldeditadditions_core/core/run_command.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/run_command.lua#L19-L24"
}

safe_region 🔗

Captures the given function in the safe_region subsystem for later execution. CAUTION: This command is not available for general use.

Arguments

NameTypeDefault valueDescription
player_namestringnil

The name of the player.

cmdnamestringnil

The name of the command being executed.

funcfunctionnil

The function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed).

Returns

nil

Source
--- Captures the given function in the safe_region subsystem for later execution.
-- CAUTION: This command is not available for general use.
-- @internal
-- @param	player_name		string		The name of the player.
-- @param	cmdname			string		The name of the command being executed.
-- @param	func			function	The function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed).
-- @returns	nil
local function safe_region(player_name, cmdname, func)
{
	"type": "function",
	"internal": true,
	"description": "Captures the given function in the safe_region subsystem for later execution.\nCAUTION: This command is not available for general use.",
	"directives": [
		{
			"directive": "internal",
			"text": ""
		},
		{
			"directive": "param",
			"text": "player_name\t\tstring\t\tThe name of the player.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player."
		},
		{
			"directive": "param",
			"text": "cmdname\t\t\tstring\t\tThe name of the command being executed.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command being executed."
		},
		{
			"directive": "param",
			"text": "func\t\t\tfunction\tThe function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed).",
			"name": "func",
			"type": "function",
			"description": "The function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed)."
		},
		{
			"directive": "returns",
			"text": "nil",
			"type": "nil"
		}
	],
	"line": 21,
	"namespace": "worldeditadditions_core",
	"line_last": 28,
	"name": "safe_region",
	"instanced": false,
	"args": [
		"player_name",
		"cmdname",
		"func"
	],
	"text": "--- Captures the given function in the safe_region subsystem for later execution.\n-- CAUTION: This command is not available for general use.\n-- @internal\n-- @param\tplayer_name\t\tstring\t\tThe name of the player.\n-- @param\tcmdname\t\t\tstring\t\tThe name of the command being executed.\n-- @param\tfunc\t\t\tfunction\tThe function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed).\n-- @returns\tnil\nlocal function safe_region(player_name, cmdname, func)",
	"params": [
		{
			"directive": "param",
			"text": "player_name\t\tstring\t\tThe name of the player.",
			"name": "player_name",
			"type": "string",
			"description": "The name of the player."
		},
		{
			"directive": "param",
			"text": "cmdname\t\t\tstring\t\tThe name of the command being executed.",
			"name": "cmdname",
			"type": "string",
			"description": "The name of the command being executed."
		},
		{
			"directive": "param",
			"text": "func\t\t\tfunction\tThe function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed).",
			"name": "func",
			"type": "function",
			"description": "The function to execute later. Will be passed NO ARGUMENTS should it ever get executed in the future (though its future execution is not guaranteed)."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "nil",
		"type": "nil"
	},
	"name_full": "worldeditadditions_core.safe_region",
	"filename": "worldeditadditions_core/core/safe_region.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/core/safe_region.lua#L22-L29"
}

str_ends 🔗

Equivalent to string.endsWith in JS

Arguments

NameTypeDefault valueDescription
strstringnil

The string to operate on

substr_endnumbernil

The ending string to look for

Returns

bool :

Whether substr_end is present at the end of str

Source
--- Equivalent to string.endsWith in JS
-- @param	str			string	The string to operate on
-- @param	substr_end	number	The ending string to look for
-- @returns	bool		Whether substr_end is present at the end of str
local function str_ends(str, substr_end)
{
	"type": "function",
	"internal": false,
	"description": "Equivalent to string.endsWith in JS",
	"directives": [
		{
			"directive": "param",
			"text": "str\t\t\tstring\tThe string to operate on",
			"name": "str",
			"type": "string",
			"description": "The string to operate on"
		},
		{
			"directive": "param",
			"text": "substr_end\tnumber\tThe ending string to look for",
			"name": "substr_end",
			"type": "number",
			"description": "The ending string to look for"
		},
		{
			"directive": "returns",
			"text": "bool\t\tWhether substr_end is present at the end of str",
			"type": "bool",
			"description": "Whether substr_end is present at the end of str"
		}
	],
	"line": 32,
	"namespace": "worldeditadditions_core",
	"line_last": 36,
	"name": "str_ends",
	"instanced": false,
	"args": [
		"str",
		"substr_end"
	],
	"text": "--- Equivalent to string.endsWith in JS\n-- @param\tstr\t\t\tstring\tThe string to operate on\n-- @param\tsubstr_end\tnumber\tThe ending string to look for\n-- @returns\tbool\t\tWhether substr_end is present at the end of str\nlocal function str_ends(str, substr_end)",
	"params": [
		{
			"directive": "param",
			"text": "str\t\t\tstring\tThe string to operate on",
			"name": "str",
			"type": "string",
			"description": "The string to operate on"
		},
		{
			"directive": "param",
			"text": "substr_end\tnumber\tThe ending string to look for",
			"name": "substr_end",
			"type": "number",
			"description": "The ending string to look for"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\t\tWhether substr_end is present at the end of str",
		"type": "bool",
		"description": "Whether substr_end is present at the end of str"
	},
	"name_full": "worldeditadditions_core.str_ends",
	"filename": "worldeditadditions_core/utils/strings/polyfill.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/strings/polyfill.lua#L33-L37"
}

str_padend 🔗

Pads str to length len with char from right

Arguments

NameTypeDefault valueDescription

Returns

nil

Source
--- Pads str to length len with char from right
-- @source https://snipplr.com/view/13092/strlpad--pad-string-to-the-left
local function str_padend(str, len, char)
{
	"type": "function",
	"internal": false,
	"description": "Pads str to length len with char from right",
	"directives": [
		{
			"directive": "source",
			"text": "https://snipplr.com/view/13092/strlpad--pad-string-to-the-left"
		}
	],
	"line": 11,
	"namespace": "worldeditadditions_core",
	"line_last": 13,
	"name": "str_padend",
	"instanced": false,
	"args": [
		"str",
		"len",
		"char"
	],
	"text": "--- Pads str to length len with char from right\n-- @source https://snipplr.com/view/13092/strlpad--pad-string-to-the-left\nlocal function str_padend(str, len, char)",
	"params": [],
	"name_full": "worldeditadditions_core.str_padend",
	"filename": "worldeditadditions_core/utils/strings/polyfill.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/strings/polyfill.lua#L12-L14"
}

str_starts 🔗

Equivalent to string.startsWith in JS

Arguments

NameTypeDefault valueDescription
strstringnil

The string to operate on

startnumbernil

The start string to look for

Returns

bool :

Whether start is present at the beginning of str

Source
--- Equivalent to string.startsWith in JS
-- @param	str		string	The string to operate on
-- @param	start	number	The start string to look for
-- @returns	bool	Whether start is present at the beginning of str
local function str_starts(str, start)
{
	"type": "function",
	"internal": false,
	"description": "Equivalent to string.startsWith in JS",
	"directives": [
		{
			"directive": "param",
			"text": "str\t\tstring\tThe string to operate on",
			"name": "str",
			"type": "string",
			"description": "The string to operate on"
		},
		{
			"directive": "param",
			"text": "start\tnumber\tThe start string to look for",
			"name": "start",
			"type": "number",
			"description": "The start string to look for"
		},
		{
			"directive": "returns",
			"text": "bool\tWhether start is present at the beginning of str",
			"type": "bool",
			"description": "Whether start is present at the beginning of str"
		}
	],
	"line": 24,
	"namespace": "worldeditadditions_core",
	"line_last": 28,
	"name": "str_starts",
	"instanced": false,
	"args": [
		"str",
		"start"
	],
	"text": "--- Equivalent to string.startsWith in JS\n-- @param\tstr\t\tstring\tThe string to operate on\n-- @param\tstart\tnumber\tThe start string to look for\n-- @returns\tbool\tWhether start is present at the beginning of str\nlocal function str_starts(str, start)",
	"params": [
		{
			"directive": "param",
			"text": "str\t\tstring\tThe string to operate on",
			"name": "str",
			"type": "string",
			"description": "The string to operate on"
		},
		{
			"directive": "param",
			"text": "start\tnumber\tThe start string to look for",
			"name": "start",
			"type": "number",
			"description": "The start string to look for"
		}
	],
	"returns": {
		"directive": "returns",
		"text": "bool\tWhether start is present at the beginning of str",
		"type": "bool",
		"description": "Whether start is present at the beginning of str"
	},
	"name_full": "worldeditadditions_core.str_starts",
	"filename": "worldeditadditions_core/utils/strings/polyfill.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/strings/polyfill.lua#L25-L29"
}

sum 🔗

Adds up all the numbers in the given list

Arguments

NameTypeDefault valueDescription
number[]The list of numbers to add.nil

Returns

number :

The sum total of all the numbers in the given list.

Source
--- Adds up all the numbers in the given list
-- @param	number[]	The list of numbers to add.
-- @returns	number		The sum total of all the numbers in the given list.
function wea_c.sum(list)
{
	"type": "function",
	"internal": false,
	"description": "Adds up all the numbers in the given list",
	"directives": [
		{
			"directive": "param",
			"text": "number[]\tThe list of numbers to add.",
			"name": "number[]",
			"type": "The list of numbers to add."
		},
		{
			"directive": "returns",
			"text": "number\t\tThe sum total of all the numbers in the given list.",
			"type": "number",
			"description": "The sum total of all the numbers in the given list."
		}
	],
	"line": 21,
	"namespace": "worldeditadditions_core",
	"line_last": 24,
	"name": "sum",
	"instanced": false,
	"args": [
		"list"
	],
	"text": "--- Adds up all the numbers in the given list\n-- @param\tnumber[]\tThe list of numbers to add.\n-- @returns\tnumber\t\tThe sum total of all the numbers in the given list.\nfunction wea_c.sum(list)",
	"params": [
		{
			"directive": "param",
			"text": "number[]\tThe list of numbers to add.",
			"name": "number[]",
			"type": "The list of numbers to add."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number\t\tThe sum total of all the numbers in the given list.",
		"type": "number",
		"description": "The sum total of all the numbers in the given list."
	},
	"name_full": "worldeditadditions_core.sum",
	"filename": "worldeditadditions_core/utils/numbers.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/numbers.lua#L22-L25"
}

trim 🔗

Trims whitespace from a string from the beginning and the end. From http://lua-users.org/wiki/StringTrim

Arguments

NameTypeDefault valueDescription
strstringnil

The string to trim the whitespace from.

Returns

string :

A copy of the original string with the whitespace trimmed.

Source
--- Trims whitespace from a string from the beginning and the end.
-- From http://lua-users.org/wiki/StringTrim
-- @param	str		string	The string to trim the whitespace from.
-- @returns	string	A copy of the original string with the whitespace trimmed.
local function trim(str)
{
	"type": "function",
	"internal": false,
	"description": "Trims whitespace from a string from the beginning and the end.\nFrom http://lua-users.org/wiki/StringTrim",
	"directives": [
		{
			"directive": "param",
			"text": "str\t\tstring\tThe string to trim the whitespace from.",
			"name": "str",
			"type": "string",
			"description": "The string to trim the whitespace from."
		},
		{
			"directive": "returns",
			"text": "string\tA copy of the original string with the whitespace trimmed.",
			"type": "string",
			"description": "A copy of the original string with the whitespace trimmed."
		}
	],
	"line": 40,
	"namespace": "worldeditadditions_core",
	"line_last": 44,
	"name": "trim",
	"instanced": false,
	"args": [
		"str"
	],
	"text": "--- Trims whitespace from a string from the beginning and the end.\n-- From http://lua-users.org/wiki/StringTrim\n-- @param\tstr\t\tstring\tThe string to trim the whitespace from.\n-- @returns\tstring\tA copy of the original string with the whitespace trimmed.\nlocal function trim(str)",
	"params": [
		{
			"directive": "param",
			"text": "str\t\tstring\tThe string to trim the whitespace from.",
			"name": "str",
			"type": "string",
			"description": "The string to trim the whitespace from."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "string\tA copy of the original string with the whitespace trimmed.",
		"type": "string",
		"description": "A copy of the original string with the whitespace trimmed."
	},
	"name_full": "worldeditadditions_core.trim",
	"filename": "worldeditadditions_core/utils/strings/polyfill.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/strings/polyfill.lua#L41-L45"
}

unwind_node_list 🔗

Unwinds a list of { node = string, weight = number } tables into a list of node ids. The node ids will be repeated multiple times according to their weights (e.g. an entry with a weight of 2 will be repeated twice).

Arguments

NameTypeDefault valueDescription
listtable[]nil

The list to unwind.

Returns

number[],number :

The unwound list of node ids, follows by the number of node ids in total.

Source
--- Unwinds a list of { node = string, weight = number } tables into a list of node ids.
-- The node ids will be repeated multiple times according to their weights
-- (e.g. an entry with a weight of 2 will be repeated twice).
-- @param	list		table[]		The list to unwind.
-- @return	number[],number			The unwound list of node ids, follows by the number of node ids in total.
function wea_c.unwind_node_list(list)
{
	"type": "function",
	"internal": false,
	"description": "Unwinds a list of { node = string, weight = number } tables into a list of node ids.\nThe node ids will be repeated multiple times according to their weights\n(e.g. an entry with a weight of 2 will be repeated twice).",
	"directives": [
		{
			"directive": "param",
			"text": "list\t\ttable[]\t\tThe list to unwind.",
			"name": "list",
			"type": "table[]",
			"description": "The list to unwind."
		},
		{
			"directive": "returns",
			"text": "number[],number\t\t\tThe unwound list of node ids, follows by the number of node ids in total.",
			"type": "number[],number",
			"description": "The unwound list of node ids, follows by the number of node ids in total."
		}
	],
	"line": 20,
	"namespace": "worldeditadditions_core",
	"line_last": 25,
	"name": "unwind_node_list",
	"instanced": false,
	"args": [
		"list"
	],
	"text": "--- Unwinds a list of { node = string, weight = number } tables into a list of node ids.\n-- The node ids will be repeated multiple times according to their weights\n-- (e.g. an entry with a weight of 2 will be repeated twice).\n-- @param\tlist\t\ttable[]\t\tThe list to unwind.\n-- @return\tnumber[],number\t\t\tThe unwound list of node ids, follows by the number of node ids in total.\nfunction wea_c.unwind_node_list(list)",
	"params": [
		{
			"directive": "param",
			"text": "list\t\ttable[]\t\tThe list to unwind.",
			"name": "list",
			"type": "table[]",
			"description": "The list to unwind."
		}
	],
	"returns": {
		"directive": "returns",
		"text": "number[],number\t\t\tThe unwound list of node ids, follows by the number of node ids in total.",
		"type": "number[],number",
		"description": "The unwound list of node ids, follows by the number of node ids in total."
	},
	"name_full": "worldeditadditions_core.unwind_node_list",
	"filename": "worldeditadditions_core/utils/nodes.lua",
	"url": "https://github.com/sbrl/Minetest-WorldEditAdditions/blob/dev/worldeditadditions_core/utils/nodes.lua#L21-L26"
}