Skip to content

Commit

Permalink
Add two missing classes to async environment
Browse files Browse the repository at this point in the history
  • Loading branch information
sfan5 committed Aug 14, 2023
1 parent 16da954 commit f9c881e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions doc/lua_api.md
Expand Up @@ -6454,6 +6454,7 @@ This allows you easy interoperability for delegating work to jobs.
### List of APIs available in an async environment

Classes:
* `AreaStore`
* `ItemStack`
* `PerlinNoise`
* `PerlinNoiseMap`
Expand Down
3 changes: 3 additions & 0 deletions games/devtest/mods/unittests/inside_async_env.lua
Expand Up @@ -10,6 +10,9 @@ local function do_tests()
assert(not core.object_refs)
-- stuff that should be here
assert(ItemStack)
local meta = ItemStack():get_meta()
assert(type(meta) == "userdata")
assert(type(meta.set_tool_capabilities) == "function")
assert(core.registered_items[""])
-- alias handling
assert(core.registered_items["unittests:steel_ingot_alias"].name ==
Expand Down
2 changes: 2 additions & 0 deletions src/script/scripting_server.cpp
Expand Up @@ -174,6 +174,8 @@ void ServerScripting::InitializeModApi(lua_State *L, int top)
void ServerScripting::InitializeAsync(lua_State *L, int top)
{
// classes
ItemStackMetaRef::Register(L);
LuaAreaStore::Register(L);
LuaItemStack::Register(L);
LuaPerlinNoise::Register(L);
LuaPerlinNoiseMap::Register(L);
Expand Down

0 comments on commit f9c881e

Please sign in to comment.