#include <map.h>
|
| | MMVManip (Map *map) |
| virtual | ~MMVManip ()=default |
| void | initialEmerge (v3s16 blockpos_min, v3s16 blockpos_max, bool load_if_inexistent=true) |
| std::map< v3s16, bool > | getCoveredBlocks () const |
| | Uses the flags array to determine which blocks the VManip covers, and for which of them we have any data.
|
| void | blitBackAll (std::map< v3s16, MapBlock * > *modified_blocks, bool overwrite_generated=true) const |
| | Writes data in VManip back to the map.
|
| MMVManip * | clone () const |
| void | reparent (Map *map) |
| bool | isOrphan () const |
| | VoxelManipulator ()=default |
| virtual | ~VoxelManipulator () |
| MapNode | getNode (const v3s16 &p) |
| MapNode | getNodeNoEx (const v3s16 &p) |
| MapNode | getNodeNoExNoEmerge (const v3s16 &p) const |
| MapNode & | getNodeRefUnsafe (const v3s16 &p) |
| const MapNode & | getNodeRefUnsafeCheckFlags (const v3s16 &p) const |
| u8 & | getFlagsRefUnsafe (const v3s16 &p) |
| bool | exists (const v3s16 &p) |
| void | setNode (const v3s16 &p, const MapNode &n) |
| bool | setNodeNoEmerge (const v3s16 &p, MapNode n) |
| void | clear () |
| void | print (std::ostream &o, const NodeDefManager *nodemgr, VoxelPrintMode mode=VOXELPRINT_MATERIAL) const |
| void | addArea (const VoxelArea &area) |
| void | setFlags (const VoxelArea &area, u8 flag) |
| void | clearFlags (const VoxelArea &area, u8 flag) |
| void | copyFrom (MapNode *src, bool is_mono_block, const VoxelArea &src_area, v3s16 from_pos, v3s16 to_pos, const v3s16 &size) |
| void | copyTo (MapNode *dst, const VoxelArea &dst_area, v3s16 dst_pos, v3s16 from_pos, const v3s16 &size) const |
◆ MMVManip() [1/2]
| MMVManip::MMVManip |
( |
Map * | map | ) |
|
◆ ~MMVManip()
| virtual MMVManip::~MMVManip |
( |
| ) |
|
|
virtualdefault |
◆ MMVManip() [2/2]
◆ blitBackAll()
| void MMVManip::blitBackAll |
( |
std::map< v3s16, MapBlock * > * | modified_blocks, |
|
|
bool | overwrite_generated = true ) const |
Writes data in VManip back to the map.
Blocks without any data in the VManip are skipped.
- Note
- VOXELFLAG_NO_DATA is checked per-block, not per-node. So you need to ensure that the relevant parts of m_data are initialized.
- Parameters
-
| modified_blocks | output array of touched blocks (optional) |
| overwrite_generated | if false, blocks marked as generate in the map are not changed |
References blockpos_over_max_limit(), MapBlock::copyFrom(), MapBlock::expireIsAirCache(), getCoveredBlocks(), MapBlock::isGenerated(), VoxelManipulator::m_area, m_map, MOD_REASON_VMANIP, MOD_STATE_WRITE_NEEDED, p(), MapBlock::raiseModified(), verbosestream, and warningstream.
Referenced by voxalgo::blit_back_with_light(), ServerMap::finishBlockMake(), LuaVoxelManip::l_write_to_map(), and TestVoxelManipulator::testBlitBack2().
◆ clone()
◆ getCoveredBlocks()
| std::map< v3s16, bool > MMVManip::getCoveredBlocks |
( |
| ) |
const |
Uses the flags array to determine which blocks the VManip covers, and for which of them we have any data.
- Warning
- requires VManip area to be block-aligned
- Returns
- map of blockpos -> any data?
References getNodeBlockPos(), VoxelManipulator::m_area, VoxelManipulator::m_flags, MAP_BLOCKSIZE, VOXELFLAG_NO_DATA, x, y, and z.
Referenced by blitBackAll(), initialEmerge(), and TestVoxelManipulator::testBlitBack2().
◆ initialEmerge()
| void MMVManip::initialEmerge |
( |
v3s16 | blockpos_min, |
|
|
v3s16 | blockpos_max, |
|
|
bool | load_if_inexistent = true ) |
References VoxelManipulator::addArea(), blockpos_over_max_limit(), MapBlock::copyTo(), emerge_time, getCoveredBlocks(), VoxelArea::getVolume(), infostream, VoxelManipulator::m_area, m_is_dirty, m_map, MAP_BLOCKSIZE, p(), VoxelArea::print(), VoxelManipulator::setFlags(), VOXELFLAG_NO_DATA, x, y, and z.
Referenced by Schematic::getSchematicFromMap(), ServerMap::initBlockMake(), Schematic::placeOnMap(), treegen::spawn_ltree(), TEST_CASE(), TestVoxelManipulator::testBlitBack(), TestVoxelManipulator::testEmerge(), and TestVoxelAlgorithms::testLighting().
◆ isOrphan()
| bool MMVManip::isOrphan |
( |
| ) |
const |
|
inline |
◆ reparent()
| void MMVManip::reparent |
( |
Map * | map | ) |
|
◆ m_is_dirty
| bool MMVManip::m_is_dirty = false |
◆ m_map
| Map* MMVManip::m_map = nullptr |
|
protected |
The documentation for this class was generated from the following files: