update block library docs & add block.get_picking_item(...)

This commit is contained in:
MihailRis
2024-07-09 18:39:33 +03:00
parent c94c2697e7
commit 277155e3d1
2 changed files with 52 additions and 24 deletions
+8
View File
@@ -300,6 +300,13 @@ static int l_get_rotation_profile(lua::State* L) {
return 0;
}
static int l_get_picking_item(lua::State* L) {
if (auto def = require_block(L)) {
return lua::pushinteger(L, def->rt.pickingItem);
}
return 0;
}
const luaL_Reg blocklib [] = {
{"index", lua::wrap<l_index>},
{"name", lua::wrap<l_name>},
@@ -327,5 +334,6 @@ const luaL_Reg blocklib [] = {
{"get_model", lua::wrap<l_get_model>},
{"get_hitbox", lua::wrap<l_get_hitbox>},
{"get_rotation_profile", lua::wrap<l_get_rotation_profile>},
{"get_picking_item", lua::wrap<l_get_picking_item>},
{NULL, NULL}
};