hud.get_block_inventory and inventory.move
This commit is contained in:
@@ -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>},
|
||||
|
||||
Reference in New Issue
Block a user