hud.get_block_inventory and inventory.move

This commit is contained in:
MihailRis
2024-04-03 20:50:26 +03:00
parent cbdc151373
commit 0dc3ab50a2
7 changed files with 79 additions and 1 deletions
+11
View File
@@ -109,12 +109,23 @@ static int l_hud_resume(lua_State* L) {
return 0;
}
static int l_hud_get_block_inventory(lua_State* L) {
auto inventory = scripting::hud->getBlockInventory();
if (inventory == nullptr) {
lua_pushinteger(L, 0);
} else {
lua_pushinteger(L, inventory->getId());
}
return 1;
}
const luaL_Reg hudlib [] = {
{"open_inventory", lua_wrap_errors<l_hud_open_inventory>},
{"close_inventory", lua_wrap_errors<l_hud_close_inventory>},
{"open_block", lua_wrap_errors<l_hud_open_block>},
{"open_permanent", lua_wrap_errors<l_hud_open_permanent>},
{"show_overlay", lua_wrap_errors<l_hud_show_overlay>},
{"get_block_inventory", lua_wrap_errors<l_hud_get_block_inventory>},
{"close", lua_wrap_errors<l_hud_close>},
{"pause", lua_wrap_errors<l_hud_pause>},
{"resume", lua_wrap_errors<l_hud_resume>},