Minetest  5.4.0
mapblock.cpp File Reference
#include "mapblock.h"
#include <sstream>
#include "map.h"
#include "light.h"
#include "nodedef.h"
#include "nodemetadata.h"
#include "gamedef.h"
#include "log.h"
#include "nameidmapping.h"
#include "content_mapnode.h"
#include "content_nodemeta.h"
#include "serialization.h"
#include "client/mapblock_mesh.h"
#include "porting.h"
#include "util/string.h"
#include "util/serialize.h"
#include "util/basic_macros.h"
+ Include dependency graph for mapblock.cpp:

Functions

static void getBlockNodeIdMapping (NameIdMapping *nimap, MapNode *nodes, const NodeDefManager *nodedef)
 
static void correctBlockNodeIds (const NameIdMapping *nimap, MapNode *nodes, IGameDef *gamedef)
 
std::string analyze_block (MapBlock *block)
 

Variables

static const char * modified_reason_strings []
 
static content_t getBlockNodeIdMapping_mapping [USHRT_MAX+1]
 

Function Documentation

◆ analyze_block()

std::string analyze_block ( MapBlock block)

References CONTENT_AIR, CONTENT_IGNORE, MapNode::getContent(), MapBlock::getIsUnderground(), MapBlock::getLightingComplete(), MapBlock::getModified(), MapBlock::getNodeNoEx(), MapBlock::getPos(), MapBlock::isDummy(), MapBlock::isGenerated(), itos(), MAP_BLOCKSIZE, MOD_STATE_CLEAN, MOD_STATE_WRITE_AT_UNLOAD, MOD_STATE_WRITE_NEEDED, porting::mt_snprintf(), and p().

Referenced by EmergeThread::finishGen(), and ClientMap::renderMap().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ correctBlockNodeIds()

static void correctBlockNodeIds ( const NameIdMapping nimap,
MapNode nodes,
IGameDef gamedef 
)
static

References IGameDef::allocateUnknownNodeId(), CONTENT_IGNORE, errorstream, MapNode::getContent(), NodeDefManager::getId(), NameIdMapping::getName(), IGameDef::ndef(), MapBlock::nodecount, and MapNode::setContent().

Referenced by MapBlock::deSerialize(), and MapBlock::deSerialize_pre22().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getBlockNodeIdMapping()

static void getBlockNodeIdMapping ( NameIdMapping nimap,
MapNode nodes,
const NodeDefManager nodedef 
)
static

References CONTENT_IGNORE, errorstream, NodeDefManager::get(), getBlockNodeIdMapping_mapping, MapNode::getContent(), ContentFeatures::name, MapBlock::nodecount, NameIdMapping::set(), and MapNode::setContent().

Referenced by MapBlock::serialize().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ getBlockNodeIdMapping_mapping

content_t getBlockNodeIdMapping_mapping[USHRT_MAX+1]
static

Referenced by getBlockNodeIdMapping().

◆ modified_reason_strings

const char* modified_reason_strings[]
static
Initial value:
= {
"initial",
"reallocate",
"setIsUnderground",
"setLightingExpired",
"setGenerated",
"setNode",
"setNodeNoCheck",
"setTimestamp",
"NodeMetaRef::reportMetadataChange",
"clearAllObjects",
"Timestamp expired (step)",
"addActiveObjectRaw",
"removeRemovedObjects/remove",
"removeRemovedObjects/deactivate",
"Stored list cleared in activateObjects due to overflow",
"deactivateFarObjects: Static data moved in",
"deactivateFarObjects: Static data moved out",
"deactivateFarObjects: Static data changed considerably",
"finishBlockMake: expireDayNightDiff",
"unknown",
}

Referenced by MapBlock::getModifiedReasonString().