diff options
author | Paramat <paramat@users.noreply.github.com> | 2018-04-05 17:21:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-05 17:21:41 +0100 |
commit | 32d456bd2d4dda50f77c01c702d1b5a5ff26134b (patch) | |
tree | 5f70367cacdc3901d3a9746563aad5ed3b3054c4 /src/script/lua_api | |
parent | 077f231111082272359a916c3e41049aaf699151 (diff) | |
download | minetest-32d456bd2d4dda50f77c01c702d1b5a5ff26134b.tar.gz minetest-32d456bd2d4dda50f77c01c702d1b5a5ff26134b.tar.bz2 minetest-32d456bd2d4dda50f77c01c702d1b5a5ff26134b.zip |
Biome API / cavegen: Add definable cave liquid for a biome (#7192)
Add 'node_cave_liquid' as a new field in biome registration.
If field is absent cave liquids fall back to classic behaviour.
Diffstat (limited to 'src/script/lua_api')
-rw-r--r-- | src/script/lua_api/l_mapgen.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/script/lua_api/l_mapgen.cpp b/src/script/lua_api/l_mapgen.cpp index d7bb96086..03a2b3eea 100644 --- a/src/script/lua_api/l_mapgen.cpp +++ b/src/script/lua_api/l_mapgen.cpp @@ -389,9 +389,11 @@ Biome *read_biome_def(lua_State *L, int index, const NodeDefManager *ndef) b->vertical_blend = getintfield_default(L, index, "vertical_blend", 0); b->flags = 0; // reserved - b->min_pos = getv3s16field_default(L, index, "min_pos", v3s16(-31000, -31000, -31000)); + b->min_pos = getv3s16field_default( + L, index, "min_pos", v3s16(-31000, -31000, -31000)); getintfield(L, index, "y_min", b->min_pos.Y); - b->max_pos = getv3s16field_default(L, index, "max_pos", v3s16(31000, 31000, 31000)); + b->max_pos = getv3s16field_default( + L, index, "max_pos", v3s16(31000, 31000, 31000)); getintfield(L, index, "y_max", b->max_pos.Y); std::vector<std::string> &nn = b->m_nodenames; @@ -403,6 +405,7 @@ Biome *read_biome_def(lua_State *L, int index, const NodeDefManager *ndef) nn.push_back(getstringfield_default(L, index, "node_river_water", "")); nn.push_back(getstringfield_default(L, index, "node_riverbed", "")); nn.push_back(getstringfield_default(L, index, "node_dust", "")); + nn.push_back(getstringfield_default(L, index, "node_cave_liquid", "")); ndef->pendNodeResolve(b); return b; |