aboutsummaryrefslogtreecommitdiff
path: root/doc
Commit message (Collapse)AuthorAge
* Add doc to list breaking changes for the next major releaseZughy2022-05-10
|
* Docs: Recommend `self.name` (#12239)Lars Müller2022-05-09
|
* Add vector.combine (#11920)Lars Müller2022-05-04
|
* Async environment for mods to do concurrent tasks (#11131)sfan52022-05-02
|
* Support CSS Color Module Level 4 (#12204)Lars Müller2022-04-27
|
* Fix typo: vector.check() ought to be vector.check(v)Lars Müller2022-04-24
|
* Update docs to reference CSS Color Module Level 3Lars Müller2022-04-21
| | | as the named color "rebeccapurple" is unavailable, Level 4 clearly isn't supported; the link should not point to a dev version of the spec either
* Remove unneeded ObjectRef setter return values (#12179)Lars Müller2022-04-10
|
* Spacing fixesShadowNinja2022-04-08
|
* Fix the documentation of InvRef:get_lists() and clean up code (#12150)DS2022-03-29
|
* Add API to control shadow intensity from the game/mod (#11944)x20482022-03-26
| | | * Also Disable shadows when sun/moon is hidden. Fixes #11972.
* Improve lua vector helper class doumentation (#12090)DS2022-03-19
|
* Readd basic_debug as a HUD flag (#12020)Lars Müller2022-03-05
|
* Allow get_sky to return a table (#11963)Zughy2022-03-05
|
* Lua API documentation: Various fixes (#12059)SmallJoker2022-02-23
| | | | | Change 1: Clarify when on_step collision information is provided Change 2: Document PostgreSQL and Redis settings Change 3: Overall AreaStore documentation improvements including consistent parameter naming based on community suggestions
* Lua API: Consistently use double vs. single quotes (#12075)Lars Müller2022-02-22
|
* Add support for 'seed' in disallow_mapgen_settings (#12023)Wuzzy2022-02-12
|
* Correct world_format.txt specification (#12061)Dennis Jenkins2022-02-12
| | | The node timers appear at the end of a mapblock for map format version >= 25, not just map format version 25.
* Allow to set the displayed item count and its alignment via meta (#8448)DS2022-02-10
| | | | | | | | | | | | | * Allow to set the displayed item count and its offset via meta * fix rect constr call * devtest: add dump_item chatcommand * fix rect2 constr call (sdim is a position (typedef for v2s32), not a dimension) and remove background because it would work now * add missing utf8 to wide conversion * rename to count_meta
* Add more documentation for the list[] fs element (#11979)DS2022-02-03
|
* Document moon orientation relative to sunLars Mueller2022-01-31
|
* Use virtual paths to specify exact mod to enable (#11784)rubenwardy2022-01-30
|
* Continue with 5.6.0-devsfan52022-01-30
|
* Define control(bits) as "unset" for entities (#11995)Lars Müller2022-01-27
|
* Bump formspec version (#11980)Vincent Robinson2022-01-23
|
* Fix consistency of sky sun/moon texture behavioursfan52022-01-22
| | | | Also cleans up related code somewhat.
* Allow resetting celestial vault elements by leaving its arguments empty (#11922)Zughy2022-01-22
|
* Fully remove bitmap font support (#11863)sfan52022-01-08
| | | Freetype is now a build requirement.
* Use a database for mod storage (#11763)Jude Melton-Houghton2022-01-07
|
* Fix damage wraparound if very high damage (#11872)Wuzzy2022-01-06
|
* Fix incorrect bit positions in paramtype documentationAritz Erkiaga2022-01-06
|
* Better document sky_color scope (#11892)Zughy2022-01-01
|
* Add padding[] element to formspecs (#11821)Vincent Robinson2021-12-30
|
* Remove wrong function from lua_api.txtsfan52021-12-19
|
* Disable inventory if player's inventory formspec is blank (#11827)ROllerozxa2021-12-13
|
* Add pauloue's ItemStack example to docs (#9853)Francisco2021-12-10
|
* Implemented disconnect_player (#10492)Corey Powell2021-11-26
| | | Co-authored-by: rubenwardy <rw@rubenwardy.com>
* Add Lua bitop library (#9847)Lejo2021-11-26
|
* Add backwards-compatible behaviour if too few CAO textures specifiedsfan52021-11-22
| | | (#11766)
* Allow for Game-Specific Menu Music (#11241)ExeVirus2021-11-22
|
* Lua API: Add `rmdir`, `cpdir` and `mvdir` (#9638)Elijah Duffy2021-11-10
| | | | Co-authored-by: rubenwardy <rw@rubenwardy.com>
* Fix number of tool uses being off by 1..32767 (#11110)Wuzzy2021-10-31
|
* Fix item duplication if player dies during interact callback (alternative) ↵sfan52021-10-25
| | | | (#11662)
* Add no_texture.png as fallback for unspecified texturesWuzzy2021-10-20
|
* Add embedded PNG texture modifier (#11498)hecks2021-10-13
|
* Move archive extraction in content store to async jobsfan52021-10-07
|
* Add "MINETEST_MOD_PATH" environment variable (#11515)emixa-d2021-10-07
| | | | This adds an environment variable MINETEST_MOD_PATH. When it exists, Minetest will look there for mods in addition to ~/.minetest/mods/.
* Add get_server_max_lag() (#11671)Wuzzy2021-10-05
|
* Split liquid_viscosity to liquid_viscosity and move_resistance (#10810)Wuzzy2021-10-01
|
* Add feature table entry for new dynamic media APIsfan52021-09-19
|
)) { lua_pushfstring(L, ">%s", options); options = lua_tostring(L, -1); lua_pushvalue(L, arg+1); lua_xmove(L, L1, 1); } else return luaL_argerror(L, arg+1, "function or level expected"); if (!lua_getinfo(L1, options, &ar)) return luaL_argerror(L, arg+2, "invalid option"); lua_createtable(L, 0, 2); if (strchr(options, 'S')) { settabss(L, "source", ar.source); settabss(L, "short_src", ar.short_src); settabsi(L, "linedefined", ar.linedefined); settabsi(L, "lastlinedefined", ar.lastlinedefined); settabss(L, "what", ar.what); } if (strchr(options, 'l')) settabsi(L, "currentline", ar.currentline); if (strchr(options, 'u')) settabsi(L, "nups", ar.nups); if (strchr(options, 'n')) { settabss(L, "name", ar.name); settabss(L, "namewhat", ar.namewhat); } if (strchr(options, 'L')) treatstackoption(L, L1, "activelines"); if (strchr(options, 'f')) treatstackoption(L, L1, "func"); return 1; /* return table */ } static int db_getlocal (lua_State *L) { int arg; lua_State *L1 = getthread(L, &arg); lua_Debug ar; const char *name; if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ return luaL_argerror(L, arg+1, "level out of range"); name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2)); if (name) { lua_xmove(L1, L, 1); lua_pushstring(L, name); lua_pushvalue(L, -2); return 2; } else { lua_pushnil(L); return 1; } } static int db_setlocal (lua_State *L) { int arg; lua_State *L1 = getthread(L, &arg); lua_Debug ar; if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ return luaL_argerror(L, arg+1, "level out of range"); luaL_checkany(L, arg+3); lua_settop(L, arg+3); lua_xmove(L, L1, 1); lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); return 1; } static int auxupvalue (lua_State *L, int get) { const char *name; int n = luaL_checkint(L, 2); luaL_checktype(L, 1, LUA_TFUNCTION); if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */ name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); if (name == NULL) return 0; lua_pushstring(L, name); lua_insert(L, -(get+1)); return get + 1; } static int db_getupvalue (lua_State *L) { return auxupvalue(L, 1); } static int db_setupvalue (lua_State *L) { luaL_checkany(L, 3); return auxupvalue(L, 0); } static const char KEY_HOOK = 'h'; static void hookf (lua_State *L, lua_Debug *ar) { static const char *const hooknames[] = {"call", "return", "line", "count", "tail return"}; lua_pushlightuserdata(L, (void *)&KEY_HOOK); lua_rawget(L, LUA_REGISTRYINDEX); lua_pushlightuserdata(L, L); lua_rawget(L, -2); if (lua_isfunction(L, -1)) { lua_pushstring(L, hooknames[(int)ar->event]); if (ar->currentline >= 0) lua_pushinteger(L, ar->currentline); else lua_pushnil(L); lua_assert(lua_getinfo(L, "lS", ar)); lua_call(L, 2, 0); } } static int makemask (const char *smask, int count) { int mask = 0; if (strchr(smask, 'c')) mask |= LUA_MASKCALL; if (strchr(smask, 'r')) mask |= LUA_MASKRET; if (strchr(smask, 'l')) mask |= LUA_MASKLINE; if (count > 0) mask |= LUA_MASKCOUNT; return mask; } static char *unmakemask (int mask, char *smask) { int i = 0; if (mask & LUA_MASKCALL) smask[i++] = 'c'; if (mask & LUA_MASKRET) smask[i++] = 'r'; if (mask & LUA_MASKLINE) smask[i++] = 'l'; smask[i] = '\0'; return smask; } static void gethooktable (lua_State *L) { lua_pushlightuserdata(L, (void *)&KEY_HOOK); lua_rawget(L, LUA_REGISTRYINDEX); if (!lua_istable(L, -1)) { lua_pop(L, 1); lua_createtable(L, 0, 1); lua_pushlightuserdata(L, (void *)&KEY_HOOK); lua_pushvalue(L, -2); lua_rawset(L, LUA_REGISTRYINDEX); } } static int db_sethook (lua_State *L) { int arg, mask, count; lua_Hook func; lua_State *L1 = getthread(L, &arg); if (lua_isnoneornil(L, arg+1)) { lua_settop(L, arg+1); func = NULL; mask = 0; count = 0; /* turn off hooks */ } else { const char *smask = luaL_checkstring(L, arg+2); luaL_checktype(L, arg+1, LUA_TFUNCTION); count = luaL_optint(L, arg+3, 0); func = hookf; mask = makemask(smask, count); } gethooktable(L); lua_pushlightuserdata(L, L1); lua_pushvalue(L, arg+1); lua_rawset(L, -3); /* set new hook */ lua_pop(L, 1); /* remove hook table */ lua_sethook(L1, func, mask, count); /* set hooks */ return 0; } static int db_gethook (lua_State *L) { int arg; lua_State *L1 = getthread(L, &arg); char buff[5]; int mask = lua_gethookmask(L1); lua_Hook hook = lua_gethook(L1); if (hook != NULL && hook != hookf) /* external hook? */ lua_pushliteral(L, "external hook"); else { gethooktable(L); lua_pushlightuserdata(L, L1); lua_rawget(L, -2); /* get hook */ lua_remove(L, -2); /* remove hook table */ } lua_pushstring(L, unmakemask(mask, buff)); lua_pushinteger(L, lua_gethookcount(L1)); return 3; } static int db_debug (lua_State *L) { for (;;) { char buffer[250]; fputs("lua_debug> ", stderr); if (fgets(buffer, sizeof(buffer), stdin) == 0 || strcmp(buffer, "cont\n") == 0) return 0; if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || lua_pcall(L, 0, 0, 0)) { fputs(lua_tostring(L, -1), stderr); fputs("\n", stderr); } lua_settop(L, 0); /* remove eventual returns */ } } #define LEVELS1 12 /* size of the first part of the stack */ #define LEVELS2 10 /* size of the second part of the stack */ static int db_errorfb (lua_State *L) { int level; int firstpart = 1; /* still before eventual `...' */ int arg; lua_State *L1 = getthread(L, &arg); lua_Debug ar; if (lua_isnumber(L, arg+2)) { level = (int)lua_tointeger(L, arg+2); lua_pop(L, 1); } else level = (L == L1) ? 1 : 0; /* level 0 may be this own function */ if (lua_gettop(L) == arg) lua_pushliteral(L, ""); else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */ else lua_pushliteral(L, "\n"); lua_pushliteral(L, "stack traceback:"); while (lua_getstack(L1, level++, &ar)) { if (level > LEVELS1 && firstpart) { /* no more than `LEVELS2' more levels? */ if (!lua_getstack(L1, level+LEVELS2, &ar)) level--; /* keep going */ else { lua_pushliteral(L, "\n\t..."); /* too many levels */ while (lua_getstack(L1, level+LEVELS2, &ar)) /* find last levels */ level++; } firstpart = 0; continue; } lua_pushliteral(L, "\n\t"); lua_getinfo(L1, "Snl", &ar); lua_pushfstring(L, "%s:", ar.short_src); if (ar.currentline > 0) lua_pushfstring(L, "%d:", ar.currentline); if (*ar.namewhat != '\0') /* is there a name? */ lua_pushfstring(L, " in function " LUA_QS, ar.name); else { if (*ar.what == 'm') /* main? */ lua_pushfstring(L, " in main chunk"); else if (*ar.what == 'C' || *ar.what == 't') lua_pushliteral(L, " ?"); /* C function or tail call */ else lua_pushfstring(L, " in function <%s:%d>", ar.short_src, ar.linedefined); } lua_concat(L, lua_gettop(L) - arg); } lua_concat(L, lua_gettop(L) - arg); return 1; } static const luaL_Reg dblib[] = { {"debug", db_debug}, {"getfenv", db_getfenv}, {"gethook", db_gethook}, {"getinfo", db_getinfo}, {"getlocal", db_getlocal}, {"getregistry", db_getregistry}, {"getmetatable", db_getmetatable}, {"getupvalue", db_getupvalue}, {"setfenv", db_setfenv}, {"sethook", db_sethook}, {"setlocal", db_setlocal}, {"setmetatable", db_setmetatable}, {"setupvalue", db_setupvalue}, {"traceback", db_errorfb}, {NULL, NULL} }; LUALIB_API int luaopen_debug (lua_State *L) { luaL_register(L, LUA_DBLIBNAME, dblib); return 1; }