summaryrefslogtreecommitdiff
path: root/src/map.h
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-11-23 15:35:49 +0100
committerNovatux <nathanael.courant@laposte.net>2013-11-30 18:37:56 +0100
commitd879a539cd19ddd1ee34afec2512fb2238de2822 (patch)
tree68105678426cb1a498bfe3ba4354506a9a560409 /src/map.h
parent752e11e11411d72868a406d35538adc5d1126655 (diff)
downloadminetest-d879a539cd19ddd1ee34afec2512fb2238de2822.tar.gz
minetest-d879a539cd19ddd1ee34afec2512fb2238de2822.tar.bz2
minetest-d879a539cd19ddd1ee34afec2512fb2238de2822.zip
Add minetest.swap_node
Diffstat (limited to 'src/map.h')
-rw-r--r--src/map.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/map.h b/src/map.h
index 8e55af437..8abea896e 100644
--- a/src/map.h
+++ b/src/map.h
@@ -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);
/*