aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_mapgen.cpp
Commit message (Expand)AuthorAge
...
* Fix warnings and other misc. minor changeskwolekr2014-11-14
* Add Generator Element Management frameworkkwolekr2014-11-12
* Split up mapgen.cppkwolekr2014-11-01
* Fix erroneous lua_pop parameterkwolekr2014-10-30
* Refactor decoration-related codekwolekr2014-10-29
* Prevent invalid memory access under failure conditionskwolekr2014-10-28
* Add NodeResolver and clean up node name -> content ID resolution systemkwolekr2014-10-26
* Split settings into seperate source and header filesShadowNinja2014-09-21
* Simplify and optimize schematic replacementsShadowNinja2014-09-11
* Use "core" namespace internallyShadowNinja2014-05-08
* Fix all warnings reported by clangSfan52014-04-15
* Update set_mapgen_params and set_gen_notify Lua API to use new flag formatkwolekr2014-03-08
* Fix g_settings not being includedSfan52014-02-16
* Schematic: Add force_placement parameter to minetest.place_structure APIkwolekr2014-02-15
* Add minetest.set_noiseparam_defaults() Lua APIkwolekr2014-02-15
* Add capability to read table flag fields from Lua APIkwolekr2014-02-09
* Make flag strings clear specified flag with 'no' prefixkwolekr2014-02-08
* Huge overhaul of the entire MapgenParams systemkwolekr2014-02-03
* Add map feature generation notify Lua APIkwolekr2013-12-14
* Fix leak and possible segfault in minetest.set_mapgen_paramskwolekr2013-12-08
* Decoration: Add schematic Y-slice probability supportkwolekr2013-12-01
* Decoration: Stop DecoSimple::resolveNodeNames from complaining about no node ...kwolekr2013-11-17
* Fix some warnings and other minor detailskwolekr2013-09-16
* Omnicleanup: header cleanup, add ModApiUtil shared between game and mainmenuKahrl2013-08-14
_cache; } // If block doesn't exist, return NULL std::unordered_map<s16, MapBlock*>::const_iterator n = m_blocks.find(y); block = (n != m_blocks.end() ? n->second : nullptr); // Cache the last result m_block_cache_y = y; m_block_cache = block; return block; } MapBlock * MapSector::getBlockNoCreateNoEx(s16 y) { return getBlockBuffered(y); } MapBlock * MapSector::createBlankBlockNoInsert(s16 y) { assert(getBlockBuffered(y) == NULL); // Pre-condition v3s16 blockpos_map(m_pos.X, y, m_pos.Y); MapBlock *block = new MapBlock(m_parent, blockpos_map, m_gamedef); return block; } MapBlock * MapSector::createBlankBlock(s16 y) { MapBlock *block = createBlankBlockNoInsert(y); m_blocks[y] = block; return block; } void MapSector::insertBlock(MapBlock *block) { s16 block_y = block->getPos().Y; MapBlock *block2 = getBlockBuffered(block_y); if (block2) { throw AlreadyExistsException("Block already exists"); } v2s16 p2d(block->getPos().X, block->getPos().Z); assert(p2d == m_pos); // Insert into container m_blocks[block_y] = block; } void MapSector::deleteBlock(MapBlock *block) { s16 block_y = block->getPos().Y; // Clear from cache m_block_cache = nullptr; // Remove from container m_blocks.erase(block_y); // Delete delete block; } void MapSector::getBlocks(MapBlockVect &dest) { for (auto &block : m_blocks) { dest.push_back(block.second); } }