diff --git a/builtin/game/features.lua b/builtin/game/features.lua index 874d3e8856ff..0b69df755400 100644 --- a/builtin/game/features.lua +++ b/builtin/game/features.lua @@ -1,5 +1,8 @@ -- Minetest: builtin/features.lua +-- The changelog is located in doc/lua_api.md +core.api_version = 1 + core.features = { glasslike_framed = true, nodebox_as_selectionbox = true, diff --git a/doc/lua_api.md b/doc/lua_api.md index be11a4c5dc9e..ab7877171acf 100644 --- a/doc/lua_api.md +++ b/doc/lua_api.md @@ -5277,6 +5277,23 @@ Minetest includes the following settings to control behavior of privileges: 'minetest' namespace reference ============================== +API Version +----------- + +* `minetest.api_version`: numeric value + * Describes the modding API capabilities and behavior. This value + depends on the server version and can be used to achieve backwards + compatibility in mods. + * This supersedes the concept of `minetest.features`. + * Exists since Minetest version 5.9.0. Use the expression + `(minetest.api_version or 0)` as a fallback. + +**API Version History** + + * API version 1 (5.9.0): + * All of `minetest.features` + + Utilities --------- @@ -5401,6 +5418,8 @@ Utilities lsystem_decoration_type = true, -- Overrideable pointing range using the itemstack meta key `"range"` (5.9.0) item_meta_range = true, + + -- All the features above are present if `(minetest.api_version or 0) >= 1` } ```