Add two missing classes to async environment

This commit is contained in:
sfan5 2023-06-17 19:52:40 +02:00
parent 16da954bd7
commit f9c881eb5a
3 changed files with 6 additions and 0 deletions

@ -6454,6 +6454,7 @@ This allows you easy interoperability for delegating work to jobs.
### List of APIs available in an async environment ### List of APIs available in an async environment
Classes: Classes:
* `AreaStore`
* `ItemStack` * `ItemStack`
* `PerlinNoise` * `PerlinNoise`
* `PerlinNoiseMap` * `PerlinNoiseMap`

@ -10,6 +10,9 @@ local function do_tests()
assert(not core.object_refs) assert(not core.object_refs)
-- stuff that should be here -- stuff that should be here
assert(ItemStack) assert(ItemStack)
local meta = ItemStack():get_meta()
assert(type(meta) == "userdata")
assert(type(meta.set_tool_capabilities) == "function")
assert(core.registered_items[""]) assert(core.registered_items[""])
-- alias handling -- alias handling
assert(core.registered_items["unittests:steel_ingot_alias"].name == assert(core.registered_items["unittests:steel_ingot_alias"].name ==

@ -174,6 +174,8 @@ void ServerScripting::InitializeModApi(lua_State *L, int top)
void ServerScripting::InitializeAsync(lua_State *L, int top) void ServerScripting::InitializeAsync(lua_State *L, int top)
{ {
// classes // classes
ItemStackMetaRef::Register(L);
LuaAreaStore::Register(L);
LuaItemStack::Register(L); LuaItemStack::Register(L);
LuaPerlinNoise::Register(L); LuaPerlinNoise::Register(L);
LuaPerlinNoiseMap::Register(L); LuaPerlinNoiseMap::Register(L);