-/*// Named by looking towards z+
-enum{
- FACE_BACK=0,
- FACE_TOP,
- FACE_RIGHT,
- FACE_FRONT,
- FACE_BOTTOM,
- FACE_LEFT
-};*/
-
-// NOTE: If this is enabled, set MapBlock to be initialized with
-// CONTENT_IGNORE.
-/*enum BlockGenerationStatus
-{
- // Completely non-generated (filled with CONTENT_IGNORE).
- BLOCKGEN_UNTOUCHED=0,
- // Trees or similar might have been blitted from other blocks to here.
- // Otherwise, the block contains CONTENT_IGNORE
- BLOCKGEN_FROM_NEIGHBORS=2,
- // Has been generated, but some neighbors might put some stuff in here
- // when they are generated.
- // Does not contain any CONTENT_IGNORE
- BLOCKGEN_SELF_GENERATED=4,
- // The block and all its neighbors have been generated
- BLOCKGEN_FULLY_GENERATED=6
-};*/
-
-#if 0
-enum
-{
- NODECONTAINER_ID_MAPBLOCK,
- NODECONTAINER_ID_MAPSECTOR,
- NODECONTAINER_ID_MAP,
- NODECONTAINER_ID_MAPBLOCKCACHE,
- NODECONTAINER_ID_VOXELMANIPULATOR,
-};
-
-class NodeContainer
-{
-public:
- virtual bool isValidPosition(v3s16 p) = 0;
- virtual MapNode getNode(v3s16 p) = 0;
- virtual void setNode(v3s16 p, MapNode & n) = 0;
- virtual u16 nodeContainerId() const = 0;
-
- MapNode getNodeNoEx(v3s16 p)
- {
- try{
- return getNode(p);
- }
- catch(InvalidPositionException &e){
- return MapNode(CONTENT_IGNORE);
- }
- }
-};
-#endif
-
-/*
- MapBlock itself
-*/
-
-class MapBlock /*: public NodeContainer*/
+////
+//// MapBlock modified reason flags
+////
+
+#define MOD_REASON_INITIAL (1 << 0)
+#define MOD_REASON_REALLOCATE (1 << 1)
+#define MOD_REASON_SET_IS_UNDERGROUND (1 << 2)
+#define MOD_REASON_SET_LIGHTING_COMPLETE (1 << 3)
+#define MOD_REASON_SET_GENERATED (1 << 4)
+#define MOD_REASON_SET_NODE (1 << 5)
+#define MOD_REASON_SET_NODE_NO_CHECK (1 << 6)
+#define MOD_REASON_SET_TIMESTAMP (1 << 7)
+#define MOD_REASON_REPORT_META_CHANGE (1 << 8)
+#define MOD_REASON_CLEAR_ALL_OBJECTS (1 << 9)
+#define MOD_REASON_BLOCK_EXPIRED (1 << 10)
+#define MOD_REASON_ADD_ACTIVE_OBJECT_RAW (1 << 11)
+#define MOD_REASON_REMOVE_OBJECTS_REMOVE (1 << 12)
+#define MOD_REASON_REMOVE_OBJECTS_DEACTIVATE (1 << 13)
+#define MOD_REASON_TOO_MANY_OBJECTS (1 << 14)
+#define MOD_REASON_STATIC_DATA_ADDED (1 << 15)
+#define MOD_REASON_STATIC_DATA_REMOVED (1 << 16)
+#define MOD_REASON_STATIC_DATA_CHANGED (1 << 17)
+#define MOD_REASON_EXPIRE_DAYNIGHTDIFF (1 << 18)
+#define MOD_REASON_UNKNOWN (1 << 19)
+
+////
+//// MapBlock itself
+////
+
+class MapBlock