mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
feat: support items data in base pack
This commit is contained in:
parent
5384843892
commit
3aa7d6ac28
6 changed files with 21 additions and 8 deletions
|
|
@ -208,7 +208,10 @@ static int l_get_all_data(lua::State* L, ItemStack& stack) {
|
|||
}
|
||||
|
||||
static int l_has_data(lua::State* L, ItemStack& stack) {
|
||||
auto key = lua::require_string(L, 3);
|
||||
auto key = lua::tostring(L, 3);
|
||||
if (key == nullptr) {
|
||||
return lua::pushboolean(L, stack.hasFields());
|
||||
}
|
||||
return lua::pushboolean(L, stack.getField(key) != nullptr);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue