mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 11:01:49 +00:00
hud.get_block_inventory and inventory.move
This commit is contained in:
parent
cbdc151373
commit
0dc3ab50a2
7 changed files with 79 additions and 1 deletions
|
|
@ -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>},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue