Skip to content

Conversation

@BuckarooBanzay
Copy link
Owner

@LoneWolfHT (i think you asked about this on discord)

Async mapgen won't work with the mapsync mod because of the missing core.get_meta function. Mapsync deserializes map metadata (inventories, timers, etc) in the main mapgen thread.
Separating map-deserializing and metadata-deserializing in separate environments (sync/async) sounds like asking for trouble (race-conditions, mainly) IMO

Docs: https://github.com/luanti-org/luanti/blob/master/doc/lua_api.md#async-environment

The async environment does not have access to the map, entities, players or any globals defined in the 'usual' environment.

Well, i tried, sounded too good to be true anyway :/

mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: ServerError: AsyncErr: Lua: Runtime error from mod 'mapsync' in callback on_generated(): /github/workspace/deserialize_mapblock.lua:26: attempt to call field 'get_meta' (a nil value)
mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: stack traceback:
mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: 	/github/workspace/deserialize_mapblock.lua:26: in function 'deserialize_mapblock'
mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: 	/github/workspace/deserialize_chunk.lua:23: in function 'deserialize_chunk'
mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: 	/github/workspace/load.lua:8: in function 'load'
mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: 	/github/workspace/mapgen.async.lua:5: in function </github/workspace/mapgen.async.lua:1>
mtt-1  | 2025-05-22 05:34:13: ERROR[Main]: 	/usr/local/share/luanti/builtin/common/register.lua:26: in function </usr/local/share/luanti/builtin/common/register.lua:12>

@BuckarooBanzay BuckarooBanzay added enhancement New feature or request invalid This doesn't seem right labels May 22, 2025
@LoneWolfHT
Copy link

RIP, thanks for trying

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request invalid This doesn't seem right

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants