Skip to content

Commit 7e649f9

Browse files
committedNov 9, 2019
Corrections to client_lua_api.txt
1 parent b1f2a69 commit 7e649f9

File tree

2 files changed

+24
-24
lines changed

2 files changed

+24
-24
lines changed
 

‎doc/client_lua_api.txt

+23-24
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ Startup
3030
Mods are loaded during client startup from the mod load paths by running
3131
the `init.lua` scripts in a shared environment.
3232

33-
In order to load client-side mods in a world, the following conditions need to be satisfied:
33+
In order to load client-side mods, the following conditions need to be satisfied:
3434

3535
1) `$path_user/minetest.conf` contains the setting `enable_client_modding = true`
3636

@@ -43,14 +43,10 @@ be loaded or have limited functionality. See setting `csm_restriction_flags` for
4343
Paths
4444
-----
4545
* `RUN_IN_PLACE=1` (Windows release, local build)
46-
* `$path_user`:
47-
* Linux: `<build directory>`
48-
* Windows: `<build directory>`
49-
* `$path_share`
50-
* Linux: `<build directory>`
51-
* Windows: `<build directory>`
46+
* `$path_user`: `<build directory>`
47+
* `$path_share`: `<build directory>`
5248
* `RUN_IN_PLACE=0`: (Linux release)
53-
* `$path_share`
49+
* `$path_share`:
5450
* Linux: `/usr/share/minetest`
5551
* Windows: `<install directory>/minetest-0.4.x`
5652
* `$path_user`:
@@ -75,7 +71,6 @@ On an installed version on Linux:
7571

7672
Modpack support
7773
----------------
78-
**NOTE: Not implemented yet.**
7974

8075
Mods can be put in a subdirectory, if the parent directory, which otherwise
8176
should be a mod, contains a file named `modpack.conf`.
@@ -90,30 +85,36 @@ Mod directory structure
9085

9186
clientmods
9287
├── modname
93-
| ├── depends.txt
94-
| ├── init.lua
88+
│   ├── mod.conf
89+
│   ├── init.lua
9590
└── another
9691

9792
### modname
93+
9894
The location of this directory.
9995

100-
### depends.txt
101-
List of mods that have to be loaded before loading this mod.
96+
### mod.conf
97+
98+
An (optional) settings file that provides meta information about the mod.
10299

103-
A single line contains a single modname.
100+
* `name`: The mod name. Allows Minetest to determine the mod name even if the
101+
folder is wrongly named.
102+
* `description`: Description of mod to be shown in the Mods tab of the main
103+
menu.
104+
* `depends`: A comma separated list of dependencies. These are mods that must be
105+
loaded before this mod.
106+
* `optional_depends`: A comma separated list of optional dependencies.
107+
Like a dependency, but no error if the mod doesn't exist.
104108

105-
Optional dependencies can be defined by appending a question mark
106-
to a single modname. Their meaning is that if the specified mod
107-
is missing, that does not prevent this mod from being loaded.
109+
### `init.lua`
108110

109-
### init.lua
110111
The main Lua script. Running this script should register everything it
111112
wants to register. Subsequent execution depends on minetest calling the
112113
registered callbacks.
113114

114-
### `sounds`
115-
Media files (sounds) that will be transferred to the
116-
client and will be available for use by the mod.
115+
**NOTE**: Client mods currently can't provide and textures, sounds or models by
116+
themselves. Any media referenced in function calls must already be loaded
117+
(provided by mods that exist on the server).
117118

118119
Naming convention for registered textual names
119120
----------------------------------------------
@@ -142,7 +143,7 @@ The `:` prefix can also be used for maintaining backwards compatibility.
142143

143144
Sounds
144145
------
145-
**NOTE: max_hear_distance and connecting to objects is not implemented.**
146+
**NOTE: Connecting sounds to objects is not implemented.**
146147

147148
Only Ogg Vorbis files are supported.
148149

@@ -182,13 +183,11 @@ Examples of sound parameter tables:
182183
{
183184
pos = {x = 1, y = 2, z = 3},
184185
gain = 1.0, -- default
185-
max_hear_distance = 32, -- default, uses an euclidean metric
186186
}
187187
-- Play connected to an object, looped
188188
{
189189
object = <an ObjectRef>,
190190
gain = 1.0, -- default
191-
max_hear_distance = 32, -- default, uses an euclidean metric
192191
loop = true,
193192
}
194193

‎src/client/client.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ void Client::loadMods()
155155
// complain about mods with unsatisfied dependencies
156156
if (!modconf.isConsistent()) {
157157
modconf.printUnsatisfiedModsError();
158+
return;
158159
}
159160

160161
// Print mods

0 commit comments

Comments
 (0)
Please sign in to comment.