} else if (mod == m_modified) {
m_modified_reason |= reason;
}
+ if (mod == MOD_STATE_WRITE_NEEDED)
+ contents_cached = false;
}
inline u32 getModified()
// is not valid on this MapBlock.
bool isValidPositionParent(v3s16 p);
MapNode getNodeParent(v3s16 p, bool *is_valid_position = NULL);
- void setNodeParent(v3s16 p, MapNode & n);
-
- inline void drawbox(s16 x0, s16 y0, s16 z0, s16 w, s16 h, s16 d, MapNode node)
- {
- for (u16 z = 0; z < d; z++)
- for (u16 y = 0; y < h; y++)
- for (u16 x = 0; x < w; x++)
- setNode(x0 + x, y0 + y, z0 + z, node);
- }
-
- // See comments in mapblock.cpp
- bool propagateSunlight(std::set<v3s16> &light_sources,
- bool remove_light=false, bool *black_air_left=NULL);
// Copies data to VoxelManipulator to getPosRelative()
void copyTo(VoxelManipulator &dst);
// These don't write or read version by itself
// Set disk to true for on-disk format, false for over-the-network format
// Precondition: version >= SER_FMT_VER_LOWEST_WRITE
- void serialize(std::ostream &os, u8 version, bool disk);
+ void serialize(std::ostream &os, u8 version, bool disk, int compression_level);
// If disk == true: In addition to doing other things, will add
// unknown blocks from id-name mapping to wndef
void deSerialize(std::istream &is, u8 version, bool disk);
static const u32 nodecount = MAP_BLOCKSIZE * MAP_BLOCKSIZE * MAP_BLOCKSIZE;
+ //// ABM optimizations ////
+ // Cache of content types
+ std::unordered_set<content_t> contents;
+ // True if content types are cached
+ bool contents_cached = false;
+ // True if we never want to cache content types for this block
+ bool do_not_cache_contents = false;
+
private:
/*
Private member variables