Luanti 5.11.0-dev
 
Loading...
Searching...
No Matches
MMVManip Class Reference

#include <map.h>

+ Inheritance diagram for MMVManip:
+ Collaboration diagram for MMVManip:

Public Member Functions

 MMVManip (Map *map)
 
virtual ~MMVManip ()=default
 
virtual void clear ()
 
void initialEmerge (v3s16 blockpos_min, v3s16 blockpos_max, bool load_if_inexistent=true)
 
void blitBackAll (std::map< v3s16, MapBlock * > *modified_blocks, bool overwrite_generated=true) const
 
MMVManipclone () const
 
void reparent (Map *map)
 
bool isOrphan () const
 
- Public Member Functions inherited from VoxelManipulator
 VoxelManipulator ()=default
 
virtual ~VoxelManipulator ()
 
MapNode getNode (const v3s16 &p)
 
MapNode getNodeNoEx (const v3s16 &p)
 
MapNode getNodeNoExNoEmerge (const v3s16 &p) const
 
MapNodegetNodeRefUnsafe (const v3s16 &p)
 
const MapNodegetNodeRefUnsafeCheckFlags (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 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, 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
 

Public Attributes

bool m_is_dirty = false
 
- Public Attributes inherited from VoxelManipulator
VoxelArea m_area
 
MapNodem_data = nullptr
 
u8 * m_flags = nullptr
 

Protected Member Functions

 MMVManip ()
 

Protected Attributes

Mapm_map = nullptr
 
std::map< v3s16, u8 > m_loaded_blocks
 

Additional Inherited Members

- Static Public Attributes inherited from VoxelManipulator
static const MapNode ContentIgnoreNode = MapNode(CONTENT_IGNORE)
 

Constructor & Destructor Documentation

◆ MMVManip() [1/2]

MMVManip::MMVManip ( Map * map)

◆ ~MMVManip()

virtual MMVManip::~MMVManip ( )
virtualdefault

◆ MMVManip() [2/2]

MMVManip::MMVManip ( )
inlineprotected

Referenced by clone().

+ Here is the caller graph for this function:

Member Function Documentation

◆ blitBackAll()

void MMVManip::blitBackAll ( std::map< v3s16, MapBlock * > * modified_blocks,
bool overwrite_generated = true ) const

References MapBlock::copyFrom(), MapBlock::expireIsAirCache(), Map::getBlockNoCreateNoEx(), VoxelArea::hasEmptyExtent(), MapBlock::isGenerated(), VoxelManipulator::m_area, m_loaded_blocks, m_map, MOD_REASON_VMANIP, MOD_STATE_WRITE_NEEDED, p(), MapBlock::raiseModified(), and VMANIP_BLOCK_DATA_INEXIST.

Referenced by voxalgo::blit_back_with_light(), ServerMap::finishBlockMake(), and LuaVoxelManip::l_write_to_map().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ clear()

virtual void MMVManip::clear ( )
inlinevirtual

Reimplemented from VoxelManipulator.

References VoxelManipulator::clear(), and m_loaded_blocks.

+ Here is the call graph for this function:

◆ clone()

MMVManip * MMVManip::clone ( ) const

References MMVManip(), VoxelArea::getVolume(), VoxelManipulator::m_area, VoxelManipulator::m_data, VoxelManipulator::m_flags, m_is_dirty, and m_loaded_blocks.

Referenced by LuaVoxelManip::packIn().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ 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_load_time, emerge_time, Map::emergeBlock(), Map::getBlockNoCreateNoEx(), VoxelArea::getVolume(), infostream, m_is_dirty, m_loaded_blocks, m_map, MAP_BLOCKSIZE, p(), VoxelArea::print(), VoxelManipulator::setFlags(), VMANIP_BLOCK_DATA_INEXIST, and VOXELFLAG_NO_DATA.

Referenced by Schematic::getSchematicFromMap(), ServerMap::initBlockMake(), LuaVoxelManip::l_read_from_map(), Schematic::placeOnMap(), treegen::spawn_ltree(), TEST_CASE(), and TestVoxelAlgorithms::testLighting().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isOrphan()

bool MMVManip::isOrphan ( ) const
inline

References m_map.

Referenced by LuaVoxelManip::l_read_from_map(), and LuaVoxelManip::l_write_to_map().

+ Here is the caller graph for this function:

◆ reparent()

void MMVManip::reparent ( Map * map)

References m_map.

Referenced by LuaVoxelManip::packOut().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_is_dirty

bool MMVManip::m_is_dirty = false

◆ m_loaded_blocks

std::map<v3s16, u8> MMVManip::m_loaded_blocks
protected

◆ m_map

Map* MMVManip::m_map = nullptr
protected

The documentation for this class was generated from the following files: