mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
mapgen: Resolve nodes in ctor rather than makeChunk
This commit is contained in:
parent
03f3f958ed
commit
6b4307791a
4 changed files with 62 additions and 50 deletions
|
@ -38,8 +38,16 @@ void MapgenSinglenodeParams::writeParams(Settings *settings) {
|
|||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
MapgenSinglenode::MapgenSinglenode(int mapgenid, MapgenParams *params) {
|
||||
MapgenSinglenode::MapgenSinglenode(int mapgenid,
|
||||
MapgenParams *params, EmergeManager *emerge)
|
||||
{
|
||||
flags = params->flags;
|
||||
|
||||
INodeDefManager *ndef = emerge->ndef;
|
||||
|
||||
c_node = ndef->getId("mapgen_singlenode");
|
||||
if (c_node == CONTENT_IGNORE)
|
||||
c_node = CONTENT_AIR;
|
||||
}
|
||||
|
||||
|
||||
|
@ -68,10 +76,6 @@ void MapgenSinglenode::makeChunk(BlockMakeData *data) {
|
|||
// Area of central chunk
|
||||
v3s16 node_min = blockpos_min*MAP_BLOCKSIZE;
|
||||
v3s16 node_max = (blockpos_max+v3s16(1,1,1))*MAP_BLOCKSIZE-v3s16(1,1,1);
|
||||
|
||||
content_t c_node = ndef->getId("mapgen_singlenode");
|
||||
if (c_node == CONTENT_IGNORE)
|
||||
c_node = CONTENT_AIR;
|
||||
|
||||
MapNode n_node(c_node);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue