mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
add standard components test
This commit is contained in:
parent
e0e5faa4a8
commit
c54be7b2b1
6 changed files with 46 additions and 11 deletions
|
|
@ -230,24 +230,21 @@ bool scripting::on_item_break_block(Player* player, const ItemDef* item, int x,
|
|||
bool scripting::on_entity_spawn(const EntityDef& def, entityid_t eid) {
|
||||
std::string name = def.name + ".spawn";
|
||||
return lua::emit_event(lua::get_main_thread(), name, [eid] (auto L) {
|
||||
lua::pushinteger(L, eid);
|
||||
return 1;
|
||||
return lua::pushinteger(L, eid);
|
||||
});
|
||||
}
|
||||
|
||||
bool scripting::on_entity_despawn(const EntityDef& def, entityid_t eid) {
|
||||
std::string name = def.name + ".despawn";
|
||||
return lua::emit_event(lua::get_main_thread(), name, [eid] (auto L) {
|
||||
lua::pushinteger(L, eid);
|
||||
return 1;
|
||||
return lua::pushinteger(L, eid);
|
||||
});
|
||||
}
|
||||
|
||||
bool scripting::on_entity_grounded(const EntityDef& def, entityid_t eid) {
|
||||
std::string name = def.name + ".grounded";
|
||||
return lua::emit_event(lua::get_main_thread(), name, [eid] (auto L) {
|
||||
lua::pushinteger(L, eid);
|
||||
return 1;
|
||||
return lua::pushinteger(L, eid);
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue