diff options
Diffstat (limited to 'src/map.h')
-rw-r--r-- | src/map.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -61,6 +61,8 @@ enum MapEditEventType{ MEET_ADDNODE, // Node removed (changed to air) MEET_REMOVENODE, + // Node swapped (changed without metadata change) + MEET_SWAPNODE, // Node metadata of block changed (not knowing which node exactly) // p stores block coordinate MEET_BLOCK_NODE_METADATA_CHANGED, @@ -99,6 +101,8 @@ struct MapEditEvent return VoxelArea(p); case MEET_REMOVENODE: return VoxelArea(p); + case MEET_SWAPNODE: + return VoxelArea(p); case MEET_BLOCK_NODE_METADATA_CHANGED: { v3s16 np1 = p*MAP_BLOCKSIZE; @@ -236,7 +240,8 @@ public: These handle lighting but not faces. */ void addNodeAndUpdate(v3s16 p, MapNode n, - std::map<v3s16, MapBlock*> &modified_blocks); + std::map<v3s16, MapBlock*> &modified_blocks, + bool remove_metadata = true); void removeNodeAndUpdate(v3s16 p, std::map<v3s16, MapBlock*> &modified_blocks); @@ -245,7 +250,7 @@ public: These emit events. Return true if succeeded, false if not. */ - bool addNodeWithEvent(v3s16 p, MapNode n); + bool addNodeWithEvent(v3s16 p, MapNode n, bool remove_metadata = true); bool removeNodeWithEvent(v3s16 p); /* |