1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

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.
This commit is contained in:
Paramat 2018-04-05 17:21:41 +01:00 committed by GitHub
parent 077f231111
commit 32d456bd2d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 40 additions and 12 deletions

View file

@ -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;