added item.description() to itemlib, and update docs

This commit is contained in:
GHOST11111100
2025-07-26 17:21:00 +03:00
parent b4d41a59e4
commit 59d706323a
5 changed files with 55 additions and 0 deletions
+8
View File
@@ -57,6 +57,13 @@ static int l_caption(lua::State* L) {
return 0;
}
static int l_description(lua::State* L) {
if (auto def = get_item_def(L, 1)) {
return lua::pushstring(L, def->description);
}
return 0;
}
static int l_placing_block(lua::State* L) {
if (auto def = get_item_def(L, 1)) {
return lua::pushinteger(L, def->rt.placingBlock);
@@ -108,6 +115,7 @@ const luaL_Reg itemlib[] = {
{"defs_count", lua::wrap<l_defs_count>},
{"icon", lua::wrap<l_get_icon>},
{"caption", lua::wrap<l_caption>},
{"description", lua::wrap<l_description>},
{"placing_block", lua::wrap<l_placing_block>},
{"model_name", lua::wrap<l_model_name>},
{"emission", lua::wrap<l_emission>},