add aabb drop models support
This commit is contained in:
@@ -280,8 +280,23 @@ static int l_get_model(lua::State* L) {
|
||||
case BlockModel::custom: return lua::pushstring(L, "custom");
|
||||
case BlockModel::none: return lua::pushstring(L, "none");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int l_get_hitbox(lua::State* L) {
|
||||
if (auto def = require_block(L)) {
|
||||
auto& hitbox = def->rt.hitboxes[0].at(lua::tointeger(L, 2));
|
||||
lua::createtable(L, 2, 0);
|
||||
|
||||
lua::pushvec3_arr(L, hitbox.min());
|
||||
lua::rawseti(L, 1);
|
||||
|
||||
lua::pushvec3_arr(L, hitbox.size());
|
||||
lua::rawseti(L, 2);
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg blocklib [] = {
|
||||
@@ -309,5 +324,6 @@ const luaL_Reg blocklib [] = {
|
||||
{"seek_origin", lua::wrap<l_seek_origin>},
|
||||
{"get_textures", lua::wrap<l_get_textures>},
|
||||
{"get_model", lua::wrap<l_get_model>},
|
||||
{"get_hitbox", lua::wrap<l_get_hitbox>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user