65 for (
const auto &block : blocks)
149 std::map<v3s16, MapBlock*> &modified_blocks,
150 bool remove_metadata =
true);
152 std::map<v3s16, MapBlock*> &modified_blocks);
182 void timerUpdate(
float dtime,
float unload_timeout, s32 max_loaded_blocks,
183 std::vector<v3s16> *unloaded_blocks=NULL);
197 virtual void PrintInfo(std::ostream &out);
245 for (s16 bz = bpmin.Z; bz <= bpmax.Z; bz++)
246 for (s16 bx = bpmin.X; bx <= bpmax.X; bx++)
247 for (s16 by = bpmin.Y; by <= bpmax.Y; by++) {
249 v3s16 bp(bx, by, bz);
258 for (s16 z_block = minz_block; z_block <= maxz_block; z_block++)
259 for (s16 y_block = miny_block; y_block <= maxy_block; y_block++)
260 for (s16 x_block = minx_block; x_block <= maxx_block; x_block++) {
261 v3s16 p = basep +
v3s16(x_block, y_block, z_block);
292 virtual void reportMetrics(u64 save_time_us, u32 saved_blocks, u32 all_blocks) {}
295 const core::aabbox3d<s16> &block_bounds,
v3s16 &to_check);
297 float step,
float stepfac,
float start_offset,
float end_offset,
301#define VMANIP_BLOCK_DATA_INEXIST 1
302#define VMANIP_BLOCK_CONTAINS_CIGNORE 2
317 bool load_if_inexistent =
true);
320 void blitBackAll(std::map<v3s16, MapBlock*> * modified_blocks,
321 bool overwrite_generated =
true)
const;
Definition rollback_interface.h:97
Map * m_map
Definition map.h:341
virtual ~MMVManip()=default
MMVManip()
Definition map.h:338
std::map< v3s16, u8 > m_loaded_blocks
Definition map.h:346
MMVManip * clone() const
Definition map.cpp:854
virtual void clear()
Definition map.h:310
void initialEmerge(v3s16 blockpos_min, v3s16 blockpos_max, bool load_if_inexistent=true)
Definition map.cpp:755
bool isOrphan() const
Definition map.h:333
void reparent(Map *map)
Definition map.cpp:877
void blitBackAll(std::map< v3s16, MapBlock * > *modified_blocks, bool overwrite_generated=true) const
Definition map.cpp:827
bool m_is_dirty
Definition map.h:335
MapNode getNodeNoCheck(s16 x, s16 y, s16 z)
Definition mapblock.h:271
v3s16 getPosRelative()
Definition mapblock.h:199
virtual void onMapEditEvent(const MapEditEvent &event)=0
Definition mapsector.h:25
void removeNodeTimer(v3s16 p)
Definition map.cpp:574
std::set< MapEventReceiver * > m_event_receivers
Definition map.h:280
void unloadUnreferencedBlocks(std::vector< v3s16 > *unloaded_blocks=NULL)
Definition map.cpp:418
bool addNodeWithEvent(v3s16 p, MapNode n, bool remove_metadata=true)
Definition map.cpp:213
void setNodeTimer(const NodeTimer &t)
Definition map.cpp:554
bool removeNodeWithEvent(v3s16 p)
Definition map.cpp:236
virtual void endSave()
Definition map.h:164
void timerUpdate(float dtime, float unload_timeout, s32 max_loaded_blocks, std::vector< v3s16 > *unloaded_blocks=NULL)
Definition map.cpp:276
void addEventReceiver(MapEventReceiver *event_receiver)
Definition map.cpp:41
virtual bool saveBlock(MapBlock *block)
Definition map.h:175
Map(IGameDef *gamedef)
Definition map.cpp:25
MapBlock * getBlockNoCreate(v3s16 p)
Definition map.cpp:94
void setNode(v3s16 p, MapNode n)
Definition map.cpp:144
bool isOccluded(v3s16 pos_camera, v3s16 pos_target, float step, float stepfac, float start_offset, float end_offset, u32 needed_count)
Definition map.cpp:652
const NodeDefManager * m_nodedef
Definition map.h:289
virtual void addNodeAndUpdate(v3s16 p, MapNode n, std::map< v3s16, MapBlock * > &modified_blocks, bool remove_metadata=true)
Definition map.cpp:152
void forEachNodeInArea(v3s16 minp, v3s16 maxp, F func)
Definition map.h:241
const NodeDefManager * getNodeDefManager()
Definition map.h:133
std::vector< v3s16 > findNodesWithMetadata(v3s16 p1, v3s16 p2)
Definition map.cpp:441
virtual bool deleteBlock(v3s16 blockpos)
Definition map.h:176
MapSector * getSectorNoGenerate(v2s16 p2d)
Definition map.cpp:79
bool isBlockOccluded(MapBlock *block, v3s16 cam_pos_nodes)
Definition map.h:271
NodeTimer getNodeTimer(v3s16 p)
Definition map.cpp:534
NodeMetadata * getNodeMetadata(v3s16 p)
Definition map.cpp:482
void removeNodeMetadata(v3s16 p)
Definition map.cpp:520
MapSector * m_sector_cache
Definition map.h:285
virtual void save(ModifiedState save_level)
Definition map.h:166
void deleteSectors(std::vector< v2s16 > &list)
Definition map.cpp:423
bool determineAdditionalOcclusionCheck(v3s16 pos_camera, const core::aabbox3d< s16 > &block_bounds, v3s16 &to_check)
Definition map.cpp:588
virtual MapBlock * emergeBlock(v3s16 p, bool create_blank=true)
Definition map.h:130
void removeEventReceiver(MapEventReceiver *event_receiver)
Definition map.cpp:46
v2s16 m_sector_cache_p
Definition map.h:286
virtual ~Map()
Definition map.cpp:31
virtual void PrintInfo(std::ostream &out)
Definition map.cpp:436
void dispatchEvent(const MapEditEvent &event)
Definition map.cpp:51
void removeNodeAndUpdate(v3s16 p, std::map< v3s16, MapBlock * > &modified_blocks)
Definition map.cpp:207
MapNode getNode(v3s16 p, bool *is_valid_position=NULL)
Definition map.cpp:110
IGameDef * m_gamedef
Definition map.h:278
virtual bool maySaveBlocks()
Definition map.h:171
virtual void reportMetrics(u64 save_time_us, u32 saved_blocks, u32 all_blocks)
Definition map.h:292
MapSector * getSectorNoGenerateNoLock(v2s16 p2d)
Definition map.cpp:58
std::unordered_map< v2s16, MapSector * > m_sectors
Definition map.h:282
virtual MapSector * emergeSector(v2s16 p)
Definition map.h:122
bool isValidPosition(v3s16 p)
Definition map.cpp:102
virtual void beginSave()
Definition map.h:163
bool setNodeMetadata(v3s16 p, NodeMetadata *meta)
Sets metadata for a node.
Definition map.cpp:501
MapBlock * getBlockNoCreateNoEx(v3s16 p)
Definition map.cpp:84
This class is for getting the actual properties of nodes from their content ID.
Definition nodedef.h:540
Definition nodetimer.h:21
void addPoint(const v3s16 &p)
Definition voxel.h:83
virtual void clear()
Definition voxel.cpp:25
#define MAP_BLOCKSIZE
Definition constants.h:64
#define FATAL_ERROR(msg)
Definition debug.h:33
core::vector2d< s16 > v2s16
Definition irr_v2d.h:12
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
MapEditEventType
Definition map.h:30
@ MEET_ADDNODE
Definition map.h:32
@ MEET_OTHER
Definition map.h:40
@ MEET_REMOVENODE
Definition map.h:34
@ MEET_BLOCK_NODE_METADATA_CHANGED
Definition map.h:38
@ MEET_SWAPNODE
Definition map.h:36
v3s16 getNodeBlockPos(v3s16 p)
Definition mapblock.h:581
#define CONTENT_IGNORE
Definition mapnode.h:58
#define CONTENT_AIR
Definition mapnode.h:46
ModifiedState
Definition modifiedstate.h:10
#define rangelim(d, min, max)
Definition numeric.h:18
std::vector< v3s16 > modified_blocks
Definition map.h:48
MapEditEventType type
Definition map.h:45
void setPositionModified(v3s16 pos)
Definition map.h:54
MapNode n
Definition map.h:47
v3s16 p
Definition map.h:46
bool is_private_change
Definition map.h:49
VoxelArea getArea() const
Definition map.h:69
void setModifiedBlocks(const std::map< v3s16, MapBlock * > &blocks)
Definition map.h:61
static std::string p(std::string path)
Definition test_filesys.cpp:53