mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
add inventory.get_uses, inventory.use, item.uses & update base:bazalt_breaker
This commit is contained in:
parent
231fc7e0d0
commit
bbfc0dbf17
5 changed files with 40 additions and 4 deletions
|
|
@ -80,6 +80,13 @@ static int l_emission(lua::State* L) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int l_uses(lua::State* L) {
|
||||
if (auto def = get_item_def(L, 1)) {
|
||||
return lua::pushinteger(L, def->uses);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg itemlib[] = {
|
||||
{"index", lua::wrap<l_index>},
|
||||
{"name", lua::wrap<l_name>},
|
||||
|
|
@ -90,4 +97,6 @@ const luaL_Reg itemlib[] = {
|
|||
{"placing_block", lua::wrap<l_placing_block>},
|
||||
{"model_name", lua::wrap<l_model_name>},
|
||||
{"emission", lua::wrap<l_emission>},
|
||||
{NULL, NULL}};
|
||||
{"uses", lua::wrap<l_uses>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue