1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-14 09:05:19 +02:00

Lua on each mapgen thread (#13092)

This commit is contained in:
sfan5
2024-02-13 22:47:30 +01:00
committed by GitHub
parent d4b107e2e8
commit 3cac17d23e
32 changed files with 1329 additions and 193 deletions

View File

@@ -243,6 +243,44 @@ public:
static void InitializeClient(lua_State *L, int top);
};
/*
* Duplicates of certain env APIs that operate not on the global
* map but on a VoxelManipulator. This is for emerge scripting.
*/
class ModApiEnvVM : public ModApiEnvBase {
private:
// get_node_max_level(pos)
static int l_get_node_max_level(lua_State *L);
// get_node_level(pos)
static int l_get_node_level(lua_State *L);
// set_node_level(pos)
static int l_set_node_level(lua_State *L);
// add_node_level(pos)
static int l_add_node_level(lua_State *L);
// find_node_near(pos, radius, nodenames, [search_center])
static int l_find_node_near(lua_State *L);
// find_nodes_in_area(minp, maxp, nodenames, [grouped])
static int l_find_nodes_in_area(lua_State *L);
// find_surface_nodes_in_area(minp, maxp, nodenames)
static int l_find_nodes_in_area_under_air(lua_State *L);
// spawn_tree(pos, treedef)
static int l_spawn_tree(lua_State *L);
// Helper: get the vmanip we're operating on
static MMVManip *getVManip(lua_State *L);
public:
static void InitializeEmerge(lua_State *L, int top);
};
class LuaABM : public ActiveBlockModifier {
private:
int m_id;