1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-11-06 18:25:21 +01:00

Fix indentation

This commit is contained in:
Bradley Pierce
2024-01-27 10:38:30 -05:00
parent caee8eeff3
commit 9bb080b0a9
10 changed files with 154 additions and 152 deletions

View File

@@ -49,10 +49,10 @@ Contributions are welcome! Here's how you can help:
* The following lines should describe the commit, starting a new line for each point. * The following lines should describe the commit, starting a new line for each point.
5. Once you are happy with your changes, submit a pull request. 5. Once you are happy with your changes, submit a pull request.
* Open the [pull request form](https://github.com/minetest/minetest/pull/new/master). * Open the [pull request form](https://github.com/minetest/minetest/pull/new/master).
* Add a description explaining what you've done (or if it's a work-in-progress - * Add a description explaining what you've done (or if it's a work-in-progress -
what you need to do). what you need to do).
* Make sure to fill out the pull request template. * Make sure to fill out the pull request template.
### A pull request is Considered Mergeable When: ### A pull request is Considered Mergeable When:

View File

@@ -79,7 +79,7 @@ The file is a key-value store of modpack details.
* `name`: The modpack name. * `name`: The modpack name.
* `description`: Description of mod to be shown in the Mods tab of the main * `description`: Description of mod to be shown in the Mods tab of the main
menu. menu.
Mod directory structure Mod directory structure
------------------------ ------------------------
@@ -99,13 +99,13 @@ The location of this directory.
An (optional) settings file that provides meta information about the mod. An (optional) settings file that provides meta information about the mod.
* `name`: The mod name. Allows Minetest to determine the mod name even if the * `name`: The mod name. Allows Minetest to determine the mod name even if the
folder is wrongly named. folder is wrongly named.
* `description`: Description of mod to be shown in the Mods tab of the main * `description`: Description of mod to be shown in the Mods tab of the main
menu. menu.
* `depends`: A comma separated list of dependencies. These are mods that must be * `depends`: A comma separated list of dependencies. These are mods that must be
loaded before this mod. loaded before this mod.
* `optional_depends`: A comma separated list of optional dependencies. * `optional_depends`: A comma separated list of optional dependencies.
Like a dependency, but no error if the mod doesn't exist. Like a dependency, but no error if the mod doesn't exist.
### `init.lua` ### `init.lua`
@@ -254,7 +254,7 @@ Refer to `lua_api.md`.
# Helper Functions # Helper Functions
* `dump2(obj, name="_", dumped={})` * `dump2(obj, name="_", dumped={})`
* Return object serialized as a string, handles reference loops * Return object serialized as a string, handles reference loops
* `dump(obj, dumped={})` * `dump(obj, dumped={})`
* Return object serialized as a string * Return object serialized as a string
* `math.hypot(x, y)` * `math.hypot(x, y)`
@@ -294,14 +294,14 @@ Refer to `lua_api.md`.
* `minetest.get_current_modname()`: returns the currently loading mod's name, when we are loading a mod * `minetest.get_current_modname()`: returns the currently loading mod's name, when we are loading a mod
* `minetest.get_modpath(modname)`: returns virtual path of given mod including * `minetest.get_modpath(modname)`: returns virtual path of given mod including
the trailing separator. This is useful to load additional Lua files the trailing separator. This is useful to load additional Lua files
contained in your mod: contained in your mod:
e.g. `dofile(minetest.get_modpath(minetest.get_current_modname()) .. "stuff.lua")` e.g. `dofile(minetest.get_modpath(minetest.get_current_modname()) .. "stuff.lua")`
* `minetest.get_language()`: returns two strings * `minetest.get_language()`: returns two strings
* the current gettext locale * the current gettext locale
* the current language code (the same as used for client-side translations) * the current language code (the same as used for client-side translations)
* `minetest.get_version()`: returns a table containing components of the * `minetest.get_version()`: returns a table containing components of the
engine version. Components: engine version. Components:
* `project`: Name of the project, eg, "Minetest" * `project`: Name of the project, eg, "Minetest"
* `string`: Simple version, eg, "1.2.3-dev" * `string`: Simple version, eg, "1.2.3-dev"
* `hash`: Full git version (only set if available), eg, "1.2.3-dev-01234567-dirty" * `hash`: Full git version (only set if available), eg, "1.2.3-dev-01234567-dirty"
@@ -318,10 +318,10 @@ Refer to `lua_api.md`.
ColorString. If the ColorSpec is invalid, returns `nil`. ColorString. If the ColorSpec is invalid, returns `nil`.
* `colorspec`: The ColorSpec to convert * `colorspec`: The ColorSpec to convert
* `minetest.get_csm_restrictions()`: returns a table of `Flags` indicating the * `minetest.get_csm_restrictions()`: returns a table of `Flags` indicating the
restrictions applied to the current mod. restrictions applied to the current mod.
* If a flag in this table is set to true, the feature is RESTRICTED. * If a flag in this table is set to true, the feature is RESTRICTED.
* Possible flags: `load_client_mods`, `chat_messages`, `read_itemdefs`, * Possible flags: `load_client_mods`, `chat_messages`, `read_itemdefs`,
`read_nodedefs`, `lookup_nodes`, `read_playerinfo` `read_nodedefs`, `lookup_nodes`, `read_playerinfo`
* `minetest.urlencode(str)`: Encodes non-unreserved URI characters by a * `minetest.urlencode(str)`: Encodes non-unreserved URI characters by a
percent sign followed by two hex digits. See percent sign followed by two hex digits. See
[RFC 3986, section 2.3](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3). [RFC 3986, section 2.3](https://datatracker.ietf.org/doc/html/rfc3986#section-2.3).

View File

@@ -30,7 +30,7 @@ For Fedora users:
For openSUSE users: For openSUSE users:
sudo zypper install gcc cmake libjpeg8-devel libpng16-devel openal-soft-devel libcurl-devel sqlite3-devel luajit-devel libzstd-devel Mesa-libGL-devel libXi-devel libvorbis-devel freetype2-devel SDL2-devel sudo zypper install gcc cmake libjpeg8-devel libpng16-devel openal-soft-devel libcurl-devel sqlite3-devel luajit-devel libzstd-devel Mesa-libGL-devel libXi-devel libvorbis-devel freetype2-devel SDL2-devel
For Arch users: For Arch users:
@@ -58,11 +58,11 @@ For Fedora users:
For Arch users: For Arch users:
sudo pacman -S git sudo pacman -S git
For Alpine users: For Alpine users:
sudo apk add git sudo apk add git
For Void users: For Void users:

View File

@@ -9,7 +9,7 @@ Before installing them onto a device they however need to be signed.
This requires an installation of the Android SDK and `adb`. This requires an installation of the Android SDK and `adb`.
```bash ```bash
.../android-sdk/build-tools/30.0.3/apksigner sign --ks ~/.android/debug.keystore \ .../android-sdk/build-tools/30.0.3/apksigner sign --ks ~/.android/debug.keystore \
app-arm64-v8a-release-unsigned.apk app-arm64-v8a-release-unsigned.apk
# Enter 'android' (without quotes) when asked for a password # Enter 'android' (without quotes) when asked for a password
``` ```

View File

@@ -84,9 +84,9 @@ The game directory can contain the following files:
* `map_persistent`: Specifies whether newly created worlds should use * `map_persistent`: Specifies whether newly created worlds should use
a persistent map backend. Defaults to `true` (= "sqlite3") a persistent map backend. Defaults to `true` (= "sqlite3")
* `author`: The author of the game. It only appears when downloaded from * `author`: The author of the game. It only appears when downloaded from
ContentDB. ContentDB.
* `release`: Ignore this: Should only ever be set by ContentDB, as it is * `release`: Ignore this: Should only ever be set by ContentDB, as it is
an internal ID used to track versions. an internal ID used to track versions.
* `minetest.conf`: * `minetest.conf`:
Used to set default settings when running this game. Used to set default settings when running this game.
* `settingtypes.txt`: * `settingtypes.txt`:
@@ -147,13 +147,13 @@ should be a mod, contains a file named `modpack.conf`.
The file is a key-value store of modpack details. The file is a key-value store of modpack details.
* `name`: The modpack name. Allows Minetest to determine the modpack name even * `name`: The modpack name. Allows Minetest to determine the modpack name even
if the folder is wrongly named. if the folder is wrongly named.
* `description`: Description of mod to be shown in the Mods tab of the main * `description`: Description of mod to be shown in the Mods tab of the main
menu. menu.
* `author`: The author of the modpack. It only appears when downloaded from * `author`: The author of the modpack. It only appears when downloaded from
ContentDB. ContentDB.
* `release`: Ignore this: Should only ever be set by ContentDB, as it is an * `release`: Ignore this: Should only ever be set by ContentDB, as it is an
internal ID used to track versions. internal ID used to track versions.
* `title`: A human-readable title to address the modpack. * `title`: A human-readable title to address the modpack.
> [!NOTE] > [!NOTE]
@@ -192,17 +192,17 @@ The location of this directory can be fetched by using
A `Settings` file that provides meta information about the mod. A `Settings` file that provides meta information about the mod.
* `name`: The mod name. Allows Minetest to determine the mod name even if the * `name`: The mod name. Allows Minetest to determine the mod name even if the
folder is wrongly named. folder is wrongly named.
* `description`: Description of mod to be shown in the Mods tab of the main * `description`: Description of mod to be shown in the Mods tab of the main
menu. menu.
* `depends`: A comma separated list of dependencies. These are mods that must be * `depends`: A comma separated list of dependencies. These are mods that must be
loaded before this mod. loaded before this mod.
* `optional_depends`: A comma separated list of optional dependencies. * `optional_depends`: A comma separated list of optional dependencies.
Like a dependency, but no error if the mod doesn't exist. Like a dependency, but no error if the mod doesn't exist.
* `author`: The author of the mod. It only appears when downloaded from * `author`: The author of the mod. It only appears when downloaded from
ContentDB. ContentDB.
* `release`: Ignore this: Should only ever be set by ContentDB, as it is an * `release`: Ignore this: Should only ever be set by ContentDB, as it is an
internal ID used to track versions. internal ID used to track versions.
* `title`: A human-readable title to address the mod. * `title`: A human-readable title to address the mod.
### `screenshot.png` ### `screenshot.png`
@@ -1160,10 +1160,10 @@ These sound groups are played back by the engine if provided.
* `player_damage`: Played when the local player takes damage (gain = 0.5) * `player_damage`: Played when the local player takes damage (gain = 0.5)
* `player_falling_damage`: Played when the local player takes * `player_falling_damage`: Played when the local player takes
damage by falling (gain = 0.5) damage by falling (gain = 0.5)
* `player_jump`: Played when the local player jumps * `player_jump`: Played when the local player jumps
* `default_dig_<groupname>`: Default node digging sound (gain = 0.5) * `default_dig_<groupname>`: Default node digging sound (gain = 0.5)
(see node sound definition for details) (see node sound definition for details)
@@ -1642,15 +1642,15 @@ Lower z-index elements are displayed behind higher z-index elements. Elements
with same z-index are displayed in an arbitrary order. Default 0. with same z-index are displayed in an arbitrary order. Default 0.
Supports negative values. By convention, the following values are recommended: Supports negative values. By convention, the following values are recommended:
* -400: Graphical effects, such as vignette * -400: Graphical effects, such as vignette
* -300: Name tags, waypoints * -300: Name tags, waypoints
* -200: Wieldhand * -200: Wieldhand
* -100: Things that block the player's view, e.g. masks * -100: Things that block the player's view, e.g. masks
* 0: Default. For standard in-game HUD elements like crosshair, hotbar, * 0: Default. For standard in-game HUD elements like crosshair, hotbar,
minimap, builtin statbars, etc. minimap, builtin statbars, etc.
* 100: Temporary text messages or notification icons * 100: Temporary text messages or notification icons
* 1000: Full-screen effects such as full-black screen or credits. * 1000: Full-screen effects such as full-black screen or credits.
This includes effects that cover the entire screen This includes effects that cover the entire screen
If your HUD element doesn't fit into any category, pick a number If your HUD element doesn't fit into any category, pick a number
between the suggested values between the suggested values
@@ -2096,12 +2096,12 @@ to games.
### Node-Only Groups ### Node-Only Groups
* `attached_node`: the node is 'attached' to a neighboring node. It checks * `attached_node`: the node is 'attached' to a neighboring node. It checks
whether the node it is attached to is walkable. If it whether the node it is attached to is walkable. If it
isn't, the node will drop as an item. isn't, the node will drop as an item.
* `1`: if the node is wallmounted, the node is attached in the wallmounted * `1`: if the node is wallmounted, the node is attached in the wallmounted
direction. Otherwise, the node is attached to the node below. direction. Otherwise, the node is attached to the node below.
* `2`: if the node is facedir or 4dir, the facedir or 4dir direction is checked. * `2`: if the node is facedir or 4dir, the facedir or 4dir direction is checked.
No effect for other nodes. No effect for other nodes.
* `3`: the node is always attached to the node below. * `3`: the node is always attached to the node below.
* `4`: the node is always attached to the node above. * `4`: the node is always attached to the node above.
> [!NOTE] > [!NOTE]
@@ -2137,12 +2137,12 @@ to games.
* `falling_node`: if there is no walkable block under the node it will fall * `falling_node`: if there is no walkable block under the node it will fall
* `float`: the node will not fall through liquids (`liquidtype ~= "none"`) * `float`: the node will not fall through liquids (`liquidtype ~= "none"`)
* `level`: Can be used to give an additional sense of progression in the game. * `level`: Can be used to give an additional sense of progression in the game.
* A larger level will cause e.g. a weapon of a lower level make much less * A larger level will cause e.g. a weapon of a lower level make much less
damage, and get worn out much faster, or not be able to get drops damage, and get worn out much faster, or not be able to get drops
from destroyed nodes. from destroyed nodes.
* `0` is something that is directly accessible at the start of gameplay * `0` is something that is directly accessible at the start of gameplay
* There is no upper limit * There is no upper limit
* See also: `leveldiff` in [Tool Capabilities] * See also: `leveldiff` in [Tool Capabilities]
* `slippery`: Players and items will slide on the node. * `slippery`: Players and items will slide on the node.
Slipperiness rises steadily with `slippery` value, starting at 1. Slipperiness rises steadily with `slippery` value, starting at 1.
@@ -2175,11 +2175,11 @@ to games.
some blood effects when hitting. some blood effects when hitting.
* `explody`: Especially prone to explosions * `explody`: Especially prone to explosions
* `oddly_breakable_by_hand`: * `oddly_breakable_by_hand`:
Can be added to nodes that shouldn't logically be breakable by the Can be added to nodes that shouldn't logically be breakable by the
hand but are. Somewhat similar to `dig_immediate`, but times are more hand but are. Somewhat similar to `dig_immediate`, but times are more
like `{[1]=3.50,[2]=2.00,[3]=0.70}` and this does not override the like `{[1]=3.50,[2]=2.00,[3]=0.70}` and this does not override the
digging speed of an item if it can dig at a faster speed than this digging speed of an item if it can dig at a faster speed than this
suggests for the hand. suggests for the hand.
## Examples of Custom Groups ## Examples of Custom Groups
@@ -2386,7 +2386,7 @@ the entity itself.
* `time_from_last_punch` is time from last punch (by `puncher`) or `nil`. * `time_from_last_punch` is time from last punch (by `puncher`) or `nil`.
* `tool_capabilities` can be `nil`. * `tool_capabilities` can be `nil`.
* `direction` is a unit vector, pointing from the source of the punch to * `direction` is a unit vector, pointing from the source of the punch to
the punched object. the punched object.
* `damage` damage that will be done to entity * `damage` damage that will be done to entity
Return value of this function will determine if damage is done by this function Return value of this function will determine if damage is done by this function
(retval true) or shall be done by engine (retval false) (retval true) or shall be done by engine (retval false)
@@ -2680,7 +2680,7 @@ background elements are drawn before all other elements.
* Formspec prepends are not affected by the coordinates in the main form. * Formspec prepends are not affected by the coordinates in the main form.
They must enable it explicitly. They must enable it explicitly.
* For information on converting forms to the new coordinate system, see `Migrating * For information on converting forms to the new coordinate system, see `Migrating
to Real Coordinates`. to Real Coordinates`.
### `container[<X>,<Y>]` ### `container[<X>,<Y>]`
@@ -2804,7 +2804,7 @@ background elements are drawn before all other elements.
* `name`: Element name that can be used for styling * `name`: Element name that can be used for styling
* `mesh`: The mesh model to use. * `mesh`: The mesh model to use.
* `textures`: The mesh textures to use according to the mesh materials. * `textures`: The mesh textures to use according to the mesh materials.
Texture names must be separated by commas. Texture names must be separated by commas.
* `rotation {X,Y}` (Optional): Initial rotation of the camera. * `rotation {X,Y}` (Optional): Initial rotation of the camera.
The axes are euler angles in degrees. The axes are euler angles in degrees.
* `continuous` (Optional): Whether the rotation is continuous. Default `false`. * `continuous` (Optional): Whether the rotation is continuous. Default `false`.
@@ -3367,8 +3367,8 @@ Some types may inherit styles from parent types.
* `bgimg_hovered` - background image when hovered. Defaults to bgimg when not provided. * `bgimg_hovered` - background image when hovered. Defaults to bgimg when not provided.
* This is deprecated, use states instead. * This is deprecated, use states instead.
* `bgimg_middle` - Makes the bgimg textures render in 9-sliced mode and defines the middle rect. * `bgimg_middle` - Makes the bgimg textures render in 9-sliced mode and defines the middle rect.
See `background9[]` documentation for more details. This property also pads the See `background9[]` documentation for more details. This property also pads the
button's content when set. button's content when set.
* `bgimg_pressed` - background image when pressed. Defaults to `bgimg` when not provided. * `bgimg_pressed` - background image when pressed. Defaults to `bgimg` when not provided.
* This is deprecated, use states instead. * This is deprecated, use states instead.
* `font` - Sets font type. This is a comma separated list of options. Valid options: * `font` - Sets font type. This is a comma separated list of options. Valid options:
@@ -3387,7 +3387,7 @@ Some types may inherit styles from parent types.
* `content_offset` - 2d vector, shifts the position of the button's content without resizing it. * `content_offset` - 2d vector, shifts the position of the button's content without resizing it.
* `noclip` - boolean, set to true to allow the element to exceed formspec bounds. * `noclip` - boolean, set to true to allow the element to exceed formspec bounds.
* `padding` - rect, adds space between the edges of the button and the content. This value is * `padding` - rect, adds space between the edges of the button and the content. This value is
relative to bgimg_middle. relative to bgimg_middle.
* `sound` - a sound to be played when triggered. * `sound` - a sound to be played when triggered.
* `textcolor` - color, default `white`. * `textcolor` - color, default `white`.
* `checkbox` * `checkbox`
@@ -3426,7 +3426,7 @@ Some types may inherit styles from parent types.
* `fgimg_pressed` - image when pressed. Defaults to `fgimg` when not provided. * `fgimg_pressed` - image when pressed. Defaults to `fgimg` when not provided.
* This is deprecated, use states instead. * This is deprecated, use states instead.
* `fgimg_middle` - Makes the fgimg textures render in 9-sliced mode and defines the middle rect. * `fgimg_middle` - Makes the fgimg textures render in 9-sliced mode and defines the middle rect.
See `background9[]` documentation for more details. See `background9[]` documentation for more details.
* `sound` - a sound to be played when triggered. * `sound` - a sound to be played when triggered.
> [!NOTE] > [!NOTE]
> The parameters of any given `image_button` will take precedence over `fgimg`/`fgimg_pressed` > The parameters of any given `image_button` will take precedence over `fgimg`/`fgimg_pressed`
@@ -3725,8 +3725,8 @@ vectors are written like this: `(x, y, z)`:
`np` is the next position in the string after the vector. `np` is the next position in the string after the vector.
* Returns `nil` on failure. * Returns `nil` on failure.
* `s`: Has to begin with a substring of the form `"(x, y, z)"`. Additional * `s`: Has to begin with a substring of the form `"(x, y, z)"`. Additional
spaces, leaving away commas and adding an additional comma to the end spaces, leaving away commas and adding an additional comma to the end
is allowed. is allowed.
* `init`: If given starts looking for the vector at this string index. * `init`: If given starts looking for the vector at this string index.
* `vector.to_string(v)`: * `vector.to_string(v)`:
* Returns a string of the form `"(x, y, z)"`. * Returns a string of the form `"(x, y, z)"`.
@@ -3897,8 +3897,9 @@ For example:
* X1, Y1, ... Z2 are coordinates * X1, Y1, ... Z2 are coordinates
* `relative_to`: Optional. If set to a position, each coordinate * `relative_to`: Optional. If set to a position, each coordinate
can use the tilde notation for relative positions can use the tilde notation for relative positions
* Tilde notation: "~": Relative coordinate * Tilde notation:
"~<number>": Relative coordinate plus <number> * `"~"`: Relative coordinate
* `"~<number>"`: Relative coordinate plus `<number>`
* Example: `minetest.string_to_area("(1,2,3) (~5,~-5,~)", {x=10,y=10,z=10})` * Example: `minetest.string_to_area("(1,2,3) (~5,~-5,~)", {x=10,y=10,z=10})`
returns `{x=1,y=2,z=3}, {x=15,y=5,z=10}` returns `{x=1,y=2,z=3}, {x=15,y=5,z=10}`
* `minetest.formspec_escape(string)`: returns a string * `minetest.formspec_escape(string)`: returns a string
@@ -5335,7 +5336,7 @@ Minetest includes the following settings to control behavior of privileges:
way. Use this instead of below code when writing e.g. database files: way. Use this instead of below code when writing e.g. database files:
`local f = io.open(path, "wb"); f:write(content); f:close()` `local f = io.open(path, "wb"); f:write(content); f:close()`
* `minetest.get_version()`: returns a table containing components of the * `minetest.get_version()`: returns a table containing components of the
engine version. Components: engine version. Components:
* `project`: Name of the project, eg, "Minetest" * `project`: Name of the project, eg, "Minetest"
* `string`: Simple version, eg, "1.2.3-dev" * `string`: Simple version, eg, "1.2.3-dev"
* `proto_min`: The minimum supported protocol version * `proto_min`: The minimum supported protocol version
@@ -5535,12 +5536,13 @@ Call these functions only at load time!
* `reason`: a PlayerHPChangeReason table. * `reason`: a PlayerHPChangeReason table.
* The `type` field will have one of the following values: * The `type` field will have one of the following values:
* `set_hp`: A mod or the engine called `set_hp` without * `set_hp`: A mod or the engine called `set_hp` without
giving a type - use this for custom damage types. giving a type - use this for custom damage types.
* `punch`: Was punched. `reason.object` will hold the puncher, or nil if none. * `punch`: Was punched. `reason.object` will hold the puncher, or nil if none.
* `fall` * `fall`
* `node_damage`: `damage_per_second` from a neighboring node. * `node_damage`:
`reason.node` will hold the node name or nil. * `damage_per_second` from a neighboring node.
`reason.node_pos` will hold the position of the node * `reason.node` will hold the node name or nil.
* `reason.node_pos` will hold the position of the node
* `drown` * `drown`
* `respawn` * `respawn`
* Any of the above types may have additional fields from mods. * Any of the above types may have additional fields from mods.
@@ -6027,10 +6029,10 @@ handler.
* Clear all objects in the environment * Clear all objects in the environment
* Takes an optional table as an argument with the field `mode`. * Takes an optional table as an argument with the field `mode`.
* mode = `"full"`: Load and go through every mapblock, clearing * mode = `"full"`: Load and go through every mapblock, clearing
objects (default). objects (default).
* mode = `"quick"`: Clear objects immediately in loaded mapblocks, * mode = `"quick"`: Clear objects immediately in loaded mapblocks,
clear objects in unloaded mapblocks only when the clear objects in unloaded mapblocks only when the
mapblocks are next activated. mapblocks are next activated.
* `minetest.load_area(pos1[, pos2])` * `minetest.load_area(pos1[, pos2])`
* Load the mapblocks containing the area from `pos1` to `pos2`. * Load the mapblocks containing the area from `pos1` to `pos2`.
`pos2` defaults to `pos1` if not specified. `pos2` defaults to `pos1` if not specified.
@@ -6069,7 +6071,7 @@ handler.
* `pos2`: end of the ray * `pos2`: end of the ray
* `objects`: if false, only nodes will be returned. Default is `true`. * `objects`: if false, only nodes will be returned. Default is `true`.
* `liquids`: if false, liquid nodes (`liquidtype ~= "none"`) won't be * `liquids`: if false, liquid nodes (`liquidtype ~= "none"`) won't be
returned. Default is `false`. returned. Default is `false`.
* `minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)` * `minetest.find_path(pos1,pos2,searchdistance,max_jump,max_drop,algorithm)`
* returns table containing path that can be walked on * returns table containing path that can be walked on
* returns a table of 3D points representing a path from `pos1` to `pos2` or * returns a table of 3D points representing a path from `pos1` to `pos2` or
@@ -6500,9 +6502,9 @@ Variables:
* `options`: table containing the following parameters * `options`: table containing the following parameters
* `filepath`: path to a media file on the filesystem * `filepath`: path to a media file on the filesystem
* `to_player`: name of the player the media should be sent to instead of * `to_player`: name of the player the media should be sent to instead of
all players (optional) all players (optional)
* `ephemeral`: boolean that marks the media as ephemeral, * `ephemeral`: boolean that marks the media as ephemeral,
it will not be cached on the client (optional, default false) it will not be cached on the client (optional, default false)
* `callback`: function with arguments `name`, which is a player name * `callback`: function with arguments `name`, which is a player name
* Pushes the specified media file to client(s). (details below) * Pushes the specified media file to client(s). (details below)
The file must be a supported image, sound or model format. The file must be a supported image, sound or model format.
@@ -6769,8 +6771,8 @@ Variables:
restriction with maliciously crafted Lua bytecode if mod security is restriction with maliciously crafted Lua bytecode if mod security is
disabled. disabled.
* This function should not be used on untrusted data, regardless of the * This function should not be used on untrusted data, regardless of the
value of `safe`. It is fine to serialize then deserialize user-provided value of `safe`. It is fine to serialize then deserialize user-provided
data, but directly providing user input to deserialize is always unsafe. data, but directly providing user input to deserialize is always unsafe.
* Example: `deserialize('return {["foo"] = "bar"}')`, * Example: `deserialize('return {["foo"] = "bar"}')`,
returns `{foo="bar"}` returns `{foo="bar"}`
* Example: `deserialize('print("foo")')`, returns `nil` * Example: `deserialize('print("foo")')`, returns `nil`
@@ -6805,7 +6807,7 @@ Variables:
* Decodes a string encoded in base64. * Decodes a string encoded in base64.
* `minetest.is_protected(pos, name)`: returns boolean * `minetest.is_protected(pos, name)`: returns boolean
* Returning `true` restricts the player `name` from modifying (i.e. digging, * Returning `true` restricts the player `name` from modifying (i.e. digging,
placing) the node at position `pos`. placing) the node at position `pos`.
* `name` will be `""` for non-players or unknown players. * `name` will be `""` for non-players or unknown players.
* This function should be overridden by protection mods. It is highly * This function should be overridden by protection mods. It is highly
recommended to grant access to players with the `protection_bypass` privilege. recommended to grant access to players with the `protection_bypass` privilege.
@@ -7077,7 +7079,7 @@ An `InvRef` is a reference to an inventory.
* `get_stack(listname, i)`: get a copy of stack index `i` in list * `get_stack(listname, i)`: get a copy of stack index `i` in list
* `set_stack(listname, i, stack)`: copy `stack` to index `i` in list * `set_stack(listname, i, stack)`: copy `stack` to index `i` in list
* `get_list(listname)`: returns full list (list of `ItemStack`s) * `get_list(listname)`: returns full list (list of `ItemStack`s)
or `nil` if list doesn't exist (size 0) or `nil` if list doesn't exist (size 0)
* `set_list(listname, list)`: set full list (size will not change) * `set_list(listname, list)`: set full list (size will not change)
* `get_lists()`: returns table that maps listnames to inventory lists * `get_lists()`: returns table that maps listnames to inventory lists
* `set_lists(lists)`: sets inventory lists (size will not change) * `set_lists(lists)`: sets inventory lists (size will not change)
@@ -7442,7 +7444,7 @@ child will follow movement and rotation of that bone.
* For players: HP are also limited by `hp_max` specified in object properties * For players: HP are also limited by `hp_max` specified in object properties
* `get_inventory()`: returns an `InvRef` for players, otherwise returns `nil` * `get_inventory()`: returns an `InvRef` for players, otherwise returns `nil`
* `get_wield_list()`: returns the name of the inventory list the wielded item * `get_wield_list()`: returns the name of the inventory list the wielded item
is in. is in.
* `get_wield_index()`: returns the wield list index of the wielded item (starting with 1) * `get_wield_index()`: returns the wield list index of the wielded item (starting with 1)
* `get_wielded_item()`: returns a copy of the wielded item as an `ItemStack` * `get_wielded_item()`: returns a copy of the wielded item as an `ItemStack`
* `set_wielded_item(item)`: replaces the wielded item, returns `true` if * `set_wielded_item(item)`: replaces the wielded item, returns `true` if
@@ -7461,17 +7463,17 @@ child will follow movement and rotation of that bone.
* Sets the object animation parameters and (re)starts the animation * Sets the object animation parameters and (re)starts the animation
* Animations only work with a `"mesh"` visual * Animations only work with a `"mesh"` visual
* `frame_range`: Beginning and end frame (as specified in the mesh file). * `frame_range`: Beginning and end frame (as specified in the mesh file).
* Syntax: `{x=start_frame, y=end_frame}` * Syntax: `{x=start_frame, y=end_frame}`
* Animation interpolates towards the end frame but stops when it is reached * Animation interpolates towards the end frame but stops when it is reached
* If looped, there is no interpolation back to the start frame * If looped, there is no interpolation back to the start frame
* If looped, the model should look identical at start and end * If looped, the model should look identical at start and end
* Only integer numbers are supported * Only integer numbers are supported
* default: `{x=1, y=1}` * default: `{x=1, y=1}`
* `frame_speed`: How fast the animation plays, in frames per second (number) * `frame_speed`: How fast the animation plays, in frames per second (number)
* default: `15.0` * default: `15.0`
* `frame_blend`: number, default: `0.0` * `frame_blend`: number, default: `0.0`
* `frame_loop`: If `true`, animation will loop. If false, it will play once * `frame_loop`: If `true`, animation will loop. If false, it will play once
* default: `true` * default: `true`
* `get_animation()`: returns current animation parameters set by `set_animation`: * `get_animation()`: returns current animation parameters set by `set_animation`:
* `frame_range`, `frame_speed`, `frame_blend`, `frame_loop`. * `frame_range`, `frame_speed`, `frame_blend`, `frame_loop`.
* `set_animation_frame_speed(frame_speed)` * `set_animation_frame_speed(frame_speed)`
@@ -7486,7 +7488,7 @@ child will follow movement and rotation of that bone.
* `position`: relative position, default `{x=0, y=0, z=0}` * `position`: relative position, default `{x=0, y=0, z=0}`
* `rotation`: relative rotation in degrees, default `{x=0, y=0, z=0}` * `rotation`: relative rotation in degrees, default `{x=0, y=0, z=0}`
* `forced_visible`: Boolean to control whether the attached entity * `forced_visible`: Boolean to control whether the attached entity
should appear in first person, default `false`. should appear in first person, default `false`.
* This command may fail silently (do nothing) when it would result * This command may fail silently (do nothing) when it would result
in circular attachments. in circular attachments.
* `get_attach()`: * `get_attach()`:
@@ -7496,14 +7498,14 @@ child will follow movement and rotation of that bone.
object. object.
* `set_detach()`: Detaches object. No-op if object was not attached. * `set_detach()`: Detaches object. No-op if object was not attached.
* `set_bone_position([bone, position, rotation])` * `set_bone_position([bone, position, rotation])`
* Shorthand for `set_bone_override(bone, {position = position, rotation = rotation:apply(math.rad)})` using absolute values. * Shorthand for `set_bone_override(bone, {position = position, rotation = rotation:apply(math.rad)})` using absolute values.
> [!WARNING] > [!WARNING]
> **Deprecated**, use `set_bone_override` instead. > **Deprecated**, use `set_bone_override` instead.
> [!NOTE] > [!NOTE]
> Rotation is in degrees, not radians. > Rotation is in degrees, not radians.
* `get_bone_position(bone)`: returns the previously set position and rotation of the bone * `get_bone_position(bone)`: returns the previously set position and rotation of the bone
* Shorthand for `get_bone_override(bone).position.vec, get_bone_override(bone).rotation.vec:apply(math.deg)`. * Shorthand for `get_bone_override(bone).position.vec, get_bone_override(bone).rotation.vec:apply(math.deg)`.
> [!WARNING] > [!WARNING]
> **Deprecated**, use `get_bone_override` instead. > **Deprecated**, use `get_bone_override` instead.
@@ -7734,7 +7736,7 @@ child will follow movement and rotation of that bone.
> Some of the fields don't exist in old API versions, see feature `physics_overrides_v2`. > Some of the fields don't exist in old API versions, see feature `physics_overrides_v2`.
* `get_physics_override()`: returns the table given to `set_physics_override` * `get_physics_override()`: returns the table given to `set_physics_override`
* `hud_add(hud definition)`: add a HUD element described by HUD def, returns ID * `hud_add(hud definition)`: add a HUD element described by HUD def, returns ID
number on success number on success
* `hud_remove(id)`: remove the HUD element of the specified ID * `hud_remove(id)`: remove the HUD element of the specified ID
* `hud_change(id, stat, value)`: change a value of a previously added HUD * `hud_change(id, stat, value)`: change a value of a previously added HUD
element. element.
@@ -7800,9 +7802,9 @@ child will follow movement and rotation of that bone.
* `sky_parameters` is a table with the following optional fields: * `sky_parameters` is a table with the following optional fields:
* `base_color`: ColorSpec, meaning depends on `type` (default: `#ffffff`) * `base_color`: ColorSpec, meaning depends on `type` (default: `#ffffff`)
* `body_orbit_tilt`: Float, rotation angle of sun/moon orbit in degrees. * `body_orbit_tilt`: Float, rotation angle of sun/moon orbit in degrees.
By default, orbit is controlled by a client-side setting, and this field is not set. By default, orbit is controlled by a client-side setting, and this field is not set.
After a value is assigned, it can only be changed to another float value. After a value is assigned, it can only be changed to another float value.
Valid range [-60.0,60.0] (default: not set) Valid range [-60.0,60.0] (default: not set)
* `type`: Available types: * `type`: Available types:
* `"regular"`: Uses 0 textures, `base_color` ignored * `"regular"`: Uses 0 textures, `base_color` ignored
* `"skybox"`: Uses 6 textures, `base_color` used as fog. * `"skybox"`: Uses 6 textures, `base_color` used as fog.
@@ -7836,24 +7838,24 @@ child will follow movement and rotation of that bone.
* `fog_moon_tint`: ColorSpec, changes the fog tinting for the moon * `fog_moon_tint`: ColorSpec, changes the fog tinting for the moon
at sunrise and sunset. (default: `#7f99cc`) at sunrise and sunset. (default: `#7f99cc`)
* `fog_tint_type`: string, changes which mode the directional fog * `fog_tint_type`: string, changes which mode the directional fog
abides by, `"custom"` uses `sun_tint` and `moon_tint`, while abides by, `"custom"` uses `sun_tint` and `moon_tint`, while
`"default"` uses the classic Minetest sun and moon tinting. `"default"` uses the classic Minetest sun and moon tinting.
Will use tonemaps, if set to `"default"`. (default: `"default"`) Will use tonemaps, if set to `"default"`. (default: `"default"`)
* `fog`: A table with following optional fields: * `fog`: A table with following optional fields:
* `fog_distance`: integer, set an upper bound the client's viewing_range (inluding range_all). * `fog_distance`: integer, set an upper bound the client's viewing_range (inluding range_all).
By default, fog_distance is controlled by the client's viewing_range, and this field is not set. By default, fog_distance is controlled by the client's viewing_range, and this field is not set.
Any value >= 0 sets the desired upper bound for the client's viewing_range and disables range_all. Any value >= 0 sets the desired upper bound for the client's viewing_range and disables range_all.
Any value < 0, resets the behavior to being client-controlled. Any value < 0, resets the behavior to being client-controlled.
(default: -1) (default: -1)
* `fog_start`: float, override the client's fog_start. * `fog_start`: float, override the client's fog_start.
Fraction of the visible distance at which fog starts to be rendered. Fraction of the visible distance at which fog starts to be rendered.
By default, fog_start is controlled by the client's `fog_start` setting, and this field is not set. By default, fog_start is controlled by the client's `fog_start` setting, and this field is not set.
Any value between [0.0, 0.99] set the fog_start as a fraction of the viewing_range. Any value between [0.0, 0.99] set the fog_start as a fraction of the viewing_range.
Any value < 0, resets the behavior to being client-controlled. Any value < 0, resets the behavior to being client-controlled.
(default: -1) (default: -1)
* `fog_color`: ColorSpec, override the color of the fog. * `fog_color`: ColorSpec, override the color of the fog.
Unlike `base_color` above this will apply regardless of the skybox type. Unlike `base_color` above this will apply regardless of the skybox type.
(default: `"#00000000"`, which means no override) (default: `"#00000000"`, which means no override)
> [!WARNING] > [!WARNING]
> The darkening of the ColorSpec is subject to change. > The darkening of the ColorSpec is subject to change.
* `set_sky(base_color, type, {texture names}, clouds)` * `set_sky(base_color, type, {texture names}, clouds)`
@@ -7985,7 +7987,7 @@ child will follow movement and rotation of that bone.
* `center_weight_power` set the power factor for center-weighted luminance measurement (default: `1.0`) * `center_weight_power` set the power factor for center-weighted luminance measurement (default: `1.0`)
* `volumetric_light`: is a table that controls volumetric light (a.k.a. "godrays") * `volumetric_light`: is a table that controls volumetric light (a.k.a. "godrays")
* `strength`: sets the strength of the volumetric light effect from 0 (off, default) to 1 (strongest) * `strength`: sets the strength of the volumetric light effect from 0 (off, default) to 1 (strongest)
* This value has no effect on clients who have the "Volumetric Lighting" or "Bloom" shaders disabled. * This value has no effect on clients who have the "Volumetric Lighting" or "Bloom" shaders disabled.
* `get_lighting()`: returns the current state of lighting for the player. * `get_lighting()`: returns the current state of lighting for the player.
* Result is a table with the same fields as `light_definition` in `set_lighting`. * Result is a table with the same fields as `light_definition` in `set_lighting`.
@@ -8136,7 +8138,7 @@ It can be created via `Raycast(pos1, pos2, objects, liquids)` or
* `pos2`: end of the ray * `pos2`: end of the ray
* `objects`: if false, only nodes will be returned. Default is true. * `objects`: if false, only nodes will be returned. Default is true.
* `liquids`: if false, liquid nodes (`liquidtype ~= "none"`) won't be * `liquids`: if false, liquid nodes (`liquidtype ~= "none"`) won't be
returned. Default is false. returned. Default is false.
### Limitations ### Limitations
@@ -8653,14 +8655,14 @@ Used by `minetest.register_node`, `minetest.register_craftitem`, and
-- even those for which `pointable = false` -- even those for which `pointable = false`
pointabilities = { pointabilities = {
nodes = { nodes = {
["default:stone"] = "blocking", ["default:stone"] = "blocking",
["group:leaves"] = false, ["group:leaves"] = false,
}, },
objects = { objects = {
["modname:entityname"] = true, ["modname:entityname"] = true,
["group:ghosty"] = true, -- (an armor group) ["group:ghosty"] = true, -- (an armor group)
} }
}, },
-- Contains lists to override the `pointable` property of pointed nodes and objects. -- Contains lists to override the `pointable` property of pointed nodes and objects.
-- The index can be a node/entity name or a group with the prefix `"group:"`. -- The index can be a node/entity name or a group with the prefix `"group:"`.
@@ -9490,10 +9492,10 @@ Parameters:
* `output`: Same as for shaped recipe * `output`: Same as for shaped recipe
* `recipe`: An itemname of the single input item * `recipe`: An itemname of the single input item
* `cooktime`: (optional) Time it takes to cook this item, in seconds. * `cooktime`: (optional) Time it takes to cook this item, in seconds.
A floating-point number. (default: 3.0) A floating-point number. (default: 3.0)
* `replacements`: Same meaning as for shaped recipes, but the mods * `replacements`: Same meaning as for shaped recipes, but the mods
that utilize cooking recipes (e.g. for adding a furnace that utilize cooking recipes (e.g. for adding a furnace
node) need to implement replacements on their own node) need to implement replacements on their own
> [!NOTE] > [!NOTE]
> Games and mods are free to re-interpret the cooktime in special > Games and mods are free to re-interpret the cooktime in special
@@ -9527,10 +9529,10 @@ Parameters:
* `type = "fuel"`: Mandatory * `type = "fuel"`: Mandatory
* `recipe`: Itemname of the item to be used as fuel * `recipe`: Itemname of the item to be used as fuel
* `burntime`: (optional) Burning time this item provides, in seconds. * `burntime`: (optional) Burning time this item provides, in seconds.
A floating-point number. (default: 1.0) A floating-point number. (default: 1.0)
* `replacements`: Same meaning as for shaped recipes, but the mods * `replacements`: Same meaning as for shaped recipes, but the mods
that utilize fuels need to implement replacements that utilize fuels need to implement replacements
on their own on their own
> [!NOTE] > [!NOTE]
> Games and mods are free to re-interpret the burntime in special cases, > Games and mods are free to re-interpret the burntime in special cases,

View File

@@ -199,16 +199,16 @@ Passed to `HTTPApiTable.fetch` callback. Returned by
* `type`: "background", "overlay", "header" or "footer" * `type`: "background", "overlay", "header" or "footer"
* `tile`: tile the image instead of scaling (background only) * `tile`: tile the image instead of scaling (background only)
* `minsize`: minimum tile size, images are scaled to at least this size prior * `minsize`: minimum tile size, images are scaled to at least this size prior
doing tiling (background only) doing tiling (background only)
* `core.set_clouds(<true/false>)` * `core.set_clouds(<true/false>)`
* `core.set_topleft_text(text)` * `core.set_topleft_text(text)`
* `core.show_keys_menu()` * `core.show_keys_menu()`
* `core.show_path_select_dialog(formname, caption, is_file_select)` * `core.show_path_select_dialog(formname, caption, is_file_select)`
* shows a path select dialog * shows a path select dialog
* `formname` is base name of dialog response returned in fields * `formname` is base name of dialog response returned in fields
- if dialog was accepted `"_accepted"` * if dialog was accepted `"_accepted"`
will be added to fieldname containing the path will be added to fieldname containing the path
- if dialog was canceled `"_cancelled"` * if dialog was canceled `"_cancelled"`
will be added to fieldname value is set to formname itself will be added to fieldname value is set to formname itself
* if `is_file_select` is `true`, a file and not a folder will be selected * if `is_file_select` is `true`, a file and not a folder will be selected
* returns nil or selected file/folder * returns nil or selected file/folder
@@ -420,10 +420,10 @@ For a complete list of methods of the `Settings` object see
the result of `async_job` is passed to this function the result of `async_job` is passed to this function
## Limitations of Async Operations ## Limitations of Async Operations
* No access to global lua variables, don't even try
* Limited set of available functions * No access to global lua variables, don't even try
e.g. No access to functions modifying menu like `core.start`, `core.close`, * Limited set of available functions, e.g. No access to functions modifying menu
`core.show_path_select_dialog` like `core.start`, `core.close`, `core.show_path_select_dialog`

View File

@@ -60,9 +60,9 @@ by texture packs. All existing fallback textures can be found in the directory
### Gameplay Textures ### Gameplay Textures
* `bubble.png`: the bubble texture when the player is drowning * `bubble.png`: the bubble texture when the player is drowning
(default size: 12×12) (default size: 12×12)
* `bubble_gone.png`: like `bubble.png`, but denotes lack of breath * `bubble_gone.png`: like `bubble.png`, but denotes lack of breath
(transparent by default, same size as bubble.png) (transparent by default, same size as bubble.png)
* `crack_anylength.png`: node overlay texture when digging * `crack_anylength.png`: node overlay texture when digging
@@ -79,9 +79,9 @@ by texture packs. All existing fallback textures can be found in the directory
* `halo.png`: used for the node highlighting mesh * `halo.png`: used for the node highlighting mesh
* `heart.png`: used to display the health points of the player * `heart.png`: used to display the health points of the player
(default size: 12×12) (default size: 12×12)
* `heart_gone.png`: like `heart.png`, but denotes lack of health points * `heart_gone.png`: like `heart.png`, but denotes lack of health points
(transparent by default, same size as heart.png) (transparent by default, same size as heart.png)
* `minimap_mask_round.png`: round minimap mask, white gets replaced by the map * `minimap_mask_round.png`: round minimap mask, white gets replaced by the map
* `minimap_mask_square.png`: mask used for the square minimap * `minimap_mask_square.png`: mask used for the square minimap
@@ -155,23 +155,23 @@ more files in a texture pack called override.txt
Each line in an override.txt file is a rule. It consists of Each line in an override.txt file is a rule. It consists of
itemname target texture itemname target texture
For example, For example,
default:dirt_with_grass sides default_stone.png default:dirt_with_grass sides default_stone.png
or or
default:sword_steel inventory my_steel_sword.png default:sword_steel inventory my_steel_sword.png
You can list multiple targets on one line as a comma-separated list: You can list multiple targets on one line as a comma-separated list:
default:tree top,bottom my_special_tree.png default:tree top,bottom my_special_tree.png
You can use texture modifiers, as usual: You can use texture modifiers, as usual:
default:dirt_with_grass sides default_stone.png^[brighten default:dirt_with_grass sides default_stone.png^[brighten
Finally, if a line is empty or starts with '#' it will be considered Finally, if a line is empty or starts with '#' it will be considered
a comment and not read as a rule. You can use this to better organize a comment and not read as a rule. You can use this to better organize

View File

@@ -404,7 +404,7 @@ Timestamp and node ID mappings were introduced in map format version 29.
* `u32` timestamp * `u32` timestamp
* Timestamp when last saved, as seconds from starting the game. * Timestamp when last saved, as seconds from starting the game.
* `0xffffffff` = invalid/unknown timestamp, nothing should be done with the time * `0xffffffff` = invalid/unknown timestamp, nothing should be done with the time
difference when loaded difference when loaded
* `u8` `name_id_mapping_version` * `u8` `name_id_mapping_version`
* Should be zero for map format version 29. * Should be zero for map format version 29.

View File

@@ -53,7 +53,7 @@ Edit and view metadata of items.
Usage: Usage:
* Place/Punch: Opens item metadata editor of the item in the next * Place/Punch: Opens item metadata editor of the item in the next
inventory slot from the wielded item inventory slot from the wielded item
## Entity Rotator ## Entity Rotator

View File

@@ -30,13 +30,13 @@ Optionally, you can also define additional helper functions `FS`, `NS` and `NFS`
Here is the list of all recognized function names. All functions return a string. Here is the list of all recognized function names. All functions return a string.
* `S`: Returns translation of input. See Minetest's `lua_api.md`. You should always have at * `S`: Returns translation of input. See Minetest's `lua_api.md`. You should always have at
least this function defined. least this function defined.
* `NS`: Returns the input. Useful to make a string visible to the script without actually * `NS`: Returns the input. Useful to make a string visible to the script without actually
translating it here. translating it here.
* `FS`: Same as `S`, but returns a formspec-escaped version of the translation of the input. * `FS`: Same as `S`, but returns a formspec-escaped version of the translation of the input.
Supported for convenience. Supported for convenience.
* `NFS`: Returns a formspec-escaped version of the input, but not translated. * `NFS`: Returns a formspec-escaped version of the input, but not translated.
Supported for convenience. Supported for convenience.
Here is the boilerplate code you have to add at the top of your source code file: Here is the boilerplate code you have to add at the top of your source code file: