#include <mapblock.h>
Collaboration diagram for MapBlock:Public Member Functions | |
| MapBlock (v3s16 pos, IGameDef *gamedef) | |
| ~MapBlock () | |
| bool | isOrphan () const |
| void | makeOrphan () |
| void | reallocate () |
| MapNode * | getData () |
| void | raiseModified (u32 mod, u32 reason=MOD_REASON_UNKNOWN) |
| u32 | getModified () |
| u32 | getModifiedReason () |
| std::string | getModifiedReasonString () |
| void | resetModified () |
| bool | getIsUnderground () |
| void | setIsUnderground (bool a_is_underground) |
| void | setLightingComplete (u16 newflags) |
| u16 | getLightingComplete () |
| void | setLightingComplete (LightBank bank, u8 direction, bool is_complete) |
| bool | isLightingComplete (LightBank bank, u8 direction) |
| bool | isGenerated () |
| void | setGenerated (bool b) |
| v3s16 | getPos () |
| v3s16 | getPosRelative () |
| core::aabbox3d< s16 > | getBox () |
| bool | isValidPosition (s16 x, s16 y, s16 z) |
| bool | isValidPosition (v3s16 p) |
| MapNode | getNode (s16 x, s16 y, s16 z, bool *valid_position) |
| MapNode | getNode (v3s16 p, bool *valid_position) |
| MapNode | getNodeNoEx (v3s16 p) |
| void | setNode (s16 x, s16 y, s16 z, MapNode n) |
| void | setNode (v3s16 p, MapNode n) |
| MapNode | getNodeNoCheck (s16 x, s16 y, s16 z) |
| MapNode | getNodeNoCheck (v3s16 p) |
| void | setNodeNoCheck (s16 x, s16 y, s16 z, MapNode n) |
| void | setNodeNoCheck (v3s16 p, MapNode n) |
| void | copyTo (VoxelManipulator &dst) |
| void | copyFrom (const VoxelManipulator &src) |
| void | actuallyUpdateIsAir () |
| void | expireIsAirCache () |
| bool | isAir () |
| bool | onObjectsActivation () |
| bool | saveStaticObject (u16 id, const StaticObject &obj, u32 reason) |
| void | step (float dtime, const std::function< bool(v3s16, MapNode, f32)> &on_timer_cb) |
| void | setTimestamp (u32 time) |
| void | setTimestampNoChangedFlag (u32 time) |
| u32 | getTimestamp () |
| u32 | getDiskTimestamp () |
| void | resetUsageTimer () |
| void | incrementUsageTimer (float dtime) |
| float | getUsageTimer () |
| void | refGrab () |
| void | refDrop () |
| short | refGet () |
| NodeTimer | getNodeTimer (v3s16 p) |
| void | removeNodeTimer (v3s16 p) |
| void | setNodeTimer (const NodeTimer &t) |
| void | clearNodeTimers () |
| void | serialize (std::ostream &result, u8 version, bool disk, int compression_level) |
| Serialization. | |
| void | deSerialize (std::istream &is, u8 version, bool disk) |
| void | serializeNetworkSpecific (std::ostream &os) |
| void | deSerializeNetworkSpecific (std::istream &is) |
| bool | storeActiveObject (u16 id) |
| u32 | clearObjects () |
Static Public Member Functions | |
| static core::aabbox3d< s16 > | getBox (const v3s16 &pos_relative) |
Public Attributes | |
| bool | do_not_cache_contents = false |
| std::vector< content_t > | contents |
| NodeMetadataList | m_node_metadata |
| StaticObjectList | m_static_objects |
Static Public Attributes | |
| static const u32 | ystride = MAP_BLOCKSIZE |
| static const u32 | zstride = MAP_BLOCKSIZE * MAP_BLOCKSIZE |
| static const u32 | nodecount = MAP_BLOCKSIZE * MAP_BLOCKSIZE * MAP_BLOCKSIZE |
Private Member Functions | |
| void | deSerialize_pre22 (std::istream &is, u8 version, bool disk) |
Private Attributes | |
| bool | m_orphan = false |
| v3s16 | m_pos |
| v3s16 | m_pos_relative |
| short | m_refcount = 0 |
| MapNode *const | data |
| IGameDef * | m_gamedef |
| float | m_usage_timer = 0 |
| bool | m_is_air = false |
| bool | m_is_air_expired = true |
| u16 | m_modified = MOD_STATE_CLEAN |
| u32 | m_modified_reason = 0 |
| u32 | m_timestamp = BLOCK_TIMESTAMP_UNDEFINED |
| u32 | m_disk_timestamp = BLOCK_TIMESTAMP_UNDEFINED |
| u16 | m_lighting_complete = 0xFFFF |
| bool | m_generated = false |
| bool | is_underground = false |
| NodeTimerList | m_node_timers |
| MapBlock::~MapBlock | ( | ) |
References data, nodecount, and porting::TrackFreedMemory().
Here is the call graph for this function:| void MapBlock::actuallyUpdateIsAir | ( | ) |
References CONTENT_AIR, data, MapNode::getContent(), m_is_air, m_is_air_expired, and nodecount.
Referenced by isAir().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
| u32 MapBlock::clearObjects | ( | ) |
References StaticObjectList::clear(), m_static_objects, MOD_REASON_CLEAR_ALL_OBJECTS, MOD_STATE_WRITE_NEEDED, raiseModified(), and StaticObjectList::size().
Referenced by ServerEnvironment::clearObjects().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::copyFrom | ( | const VoxelManipulator & | src | ) |
References VoxelManipulator::copyTo(), data, getPosRelative(), and MAP_BLOCKSIZE.
Referenced by MMVManip::blitBackAll().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::copyTo | ( | VoxelManipulator & | dst | ) |
References VoxelManipulator::copyFrom(), data, getPosRelative(), and MAP_BLOCKSIZE.
Referenced by MMVManip::initialEmerge().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::deSerialize | ( | std::istream & | is, |
| u8 | version, | ||
| bool | disk ) |
References content_nodemeta_deserialize_legacy(), correctBlockNodeIds(), data, decompress(), NameIdMapping::deSerialize(), NodeMetadataList::deSerialize(), NodeTimerList::deSerialize(), StaticObjectList::deSerialize(), deSerialize_pre22(), MapNode::deSerializeBulk(), NameIdMapping::getId(), getPos(), IGameDef::idef(), is_underground, m_disk_timestamp, m_gamedef, m_generated, m_is_air, m_is_air_expired, m_lighting_complete, m_node_metadata, m_node_timers, m_static_objects, m_timestamp, nodecount, readU16(), readU32(), readU8(), ser_ver_supported_read(), setTimestampNoChangedFlag(), NameIdMapping::size(), TRACESTREAM, warningstream, and BaseException::what().
Referenced by ServerMap::deSerializeBlock(), Client::handleCommand_BlockData(), TestMapBlock::testLoad20(), TestMapBlock::testLoad29(), TestMapBlock::testLoadNonStd(), and TestMapBlock::testSaveLoad().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
References BLOCK_TIMESTAMP_UNDEFINED, content_mapnode_get_name_id_mapping(), content_nodemeta_deserialize_legacy(), correctBlockNodeIds(), data, decompress(), decompressZlib(), MapNode::deSerialize(), NameIdMapping::deSerialize(), StaticObjectList::deSerialize(), deSerializeString16(), FUNCTION_NAME, NodeDefManager::get(), MapNode::getContent(), NameIdMapping::getId(), NodeDefManager::getId(), MapNode::getParam1(), MapNode::getParam2(), IGameDef::idef(), is_underground, ContentFeatures::legacy_facedir_simple, ContentFeatures::legacy_wallmounted, m_disk_timestamp, m_gamedef, m_generated, m_is_air, m_is_air_expired, m_lighting_complete, m_node_metadata, m_node_timers, m_static_objects, m_timestamp, IGameDef::ndef(), nodecount, readU16(), readU32(), MapNode::serializedLength(), MapNode::setContent(), MapNode::setParam1(), MapNode::setParam2(), setTimestampNoChangedFlag(), NameIdMapping::size(), and warningstream.
Referenced by deSerialize().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::deSerializeNetworkSpecific | ( | std::istream & | is | ) |
References readU8(), warningstream, and BaseException::what().
Referenced by Client::handleCommand_BlockData().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::expireIsAirCache | ( | ) |
References m_is_air_expired.
Referenced by Map::addNodeAndUpdate(), MMVManip::blitBackAll(), DummyMap::fill(), and ServerMap::finishBlockMake().
Here is the caller graph for this function:
|
inline |
References getBox(), and getPosRelative().
Referenced by getBox(), and Map::isBlockOccluded().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inlinestatic |
References MAP_BLOCKSIZE.
|
inline |
References data.
Referenced by DummyMap::fill(), MeshUpdateQueue::fillDataFromMapBlocks(), and TestMapBlock::testSave29().
Here is the caller graph for this function:
|
inline |
References m_disk_timestamp.
Referenced by ServerEnvironment::step().
Here is the caller graph for this function:
|
inline |
References is_underground.
Referenced by analyze_block(), voxalgo::is_sunlight_above(), and voxalgo::is_sunlight_above_block().
Here is the caller graph for this function:
|
inline |
References m_lighting_complete.
Referenced by analyze_block().
Here is the caller graph for this function:
|
inline |
References m_modified.
Referenced by analyze_block(), and Map::timerUpdate().
Here is the caller graph for this function:
|
inline |
References m_modified_reason.
| std::string MapBlock::getModifiedReasonString | ( | ) |
References ARRLEN, m_modified_reason, modified_reason_strings, and MYMIN.
Referenced by Map::timerUpdate().
Here is the caller graph for this function:
|
inline |
References CONTENT_IGNORE, data, isValidPosition(), x, y, ystride, z, and zstride.
Referenced by getNode(), and getNodeNoEx().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References data, x, y, ystride, z, and zstride.
Referenced by Map::addNodeAndUpdate(), ABMHandler::apply(), LBMManager::applyLBMs(), voxalgo::blit_back_with_light(), voxalgo::fill_with_sunlight(), voxalgo::finish_bulk_light_update(), Map::forEachNodeInArea(), Map::getNode(), getNodeNoCheck(), voxalgo::is_sunlight_above(), voxalgo::is_sunlight_above_block(), ReflowScan::isLiquidFlowableTo(), voxalgo::propagate_block_sunlight(), voxalgo::repair_block_light(), ReflowScan::scanColumn(), set_node_in_block(), voxalgo::spread_light(), voxalgo::unspread_light(), voxalgo::update_block_border_lighting(), and voxalgo::update_lighting_nodes().
Here is the caller graph for this function:References getNode(), and p().
Referenced by analyze_block(), and step().
Here is the call graph for this function:
Here is the caller graph for this function:References NodeTimerList::get(), m_node_timers, and p().
Referenced by Map::getNodeTimer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_pos.
Referenced by ServerEnvironment::activateObjects(), analyze_block(), ABMHandler::countObjects(), deSerialize(), MapSector::detachBlock(), ClientMap::isMeshOccluded(), onObjectsActivation(), voxalgo::repair_block_light(), ServerMap::saveBlock(), saveStaticObject(), ReflowScan::scan(), Server::SendBlockNoLock(), set_node_in_block(), Map::timerUpdate(), voxalgo::update_block_border_lighting(), ClientMap::updateDrawList(), ClientMap::updateDrawListShadow(), and ClientMap::updateTransparentMeshBuffers().
Here is the caller graph for this function:
|
inline |
References m_pos_relative.
Referenced by ABMHandler::apply(), voxalgo::blit_back_with_light(), copyFrom(), copyTo(), getBox(), Map::isBlockOccluded(), ClientMap::isMeshOccluded(), ClientMap::renderMap(), ReflowScan::scan(), step(), ClientMap::touchMapBlocks(), ScriptApiEnv::triggerLBM(), voxalgo::update_block_border_lighting(), ClientMap::updateDrawList(), ClientMap::updateDrawListShadow(), and ClientMap::updateTransparentMeshBuffers().
Here is the caller graph for this function:
|
inline |
References m_timestamp.
Referenced by ServerEnvironment::activateBlock(), serialize(), and ServerEnvironment::step().
Here is the caller graph for this function:
|
inline |
References m_usage_timer.
Referenced by TimeOrderedMapBlock::operator<().
Here is the caller graph for this function:
|
inline |
References m_usage_timer.
|
inline |
References actuallyUpdateIsAir(), m_is_air, and m_is_air_expired.
Referenced by RemoteClient::GetNextBlocks(), and serialize().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_generated.
Referenced by analyze_block(), MMVManip::blitBackAll(), RemoteClient::GetNextBlocks(), voxalgo::is_sunlight_above_block(), and ServerMap::repairBlockLight().
Here is the caller graph for this function:
|
inline |
References LIGHTBANK_NIGHT, and m_lighting_complete.
Referenced by voxalgo::update_block_border_lighting().
Here is the caller graph for this function:
|
inline |
References m_orphan.
Referenced by ServerEnvironment::activateBlock(), ServerEnvironment::activateObjects(), ABMHandler::apply(), and LBMManager::applyLBMs().
Here is the caller graph for this function:
|
inline |
References MAP_BLOCKSIZE, x, y, and z.
Referenced by ABMHandler::apply(), getNode(), isValidPosition(), and setNode().
Here is the caller graph for this function:
|
inline |
|
inline |
References m_orphan.
Referenced by MapSector::detachBlock().
Here is the caller graph for this function:| bool MapBlock::onObjectsActivation | ( | ) |
References StaticObjectList::clearStored(), errorstream, get_max_objects_per_block(), StaticObjectList::getAllStored(), getPos(), StaticObjectList::getStoredSize(), m_static_objects, MOD_REASON_TOO_MANY_OBJECTS, MOD_STATE_WRITE_NEEDED, raiseModified(), and verbosestream.
Referenced by ServerEnvironment::activateObjects().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References contents, m_disk_timestamp, m_modified, m_modified_reason, m_timestamp, MOD_STATE_WRITE_AT_UNLOAD, and MOD_STATE_WRITE_NEEDED.
Referenced by ServerEnvironment::addActiveObjectRaw(), MMVManip::blitBackAll(), clearObjects(), ServerEnvironment::deleteStaticFromBlock(), ServerMap::finishBlockMake(), onObjectsActivation(), reallocate(), saveStaticObject(), setGenerated(), setIsUnderground(), setLightingComplete(), setNode(), setNodeNoCheck(), setTimestamp(), ServerEnvironment::step(), and storeActiveObject().
Here is the caller graph for this function:
|
inline |
References CONTENT_IGNORE, data, MOD_REASON_REALLOCATE, MOD_STATE_WRITE_NEEDED, nodecount, and raiseModified().
Referenced by MapBlock().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_refcount.
Referenced by ServerEnvironment::clearObjects(), Client::step(), ClientMap::updateDrawList(), and ClientMap::updateDrawListShadow().
Here is the caller graph for this function:
|
inline |
References m_refcount.
Referenced by Map::timerUpdate().
Here is the caller graph for this function:
|
inline |
References m_refcount.
Referenced by MeshUpdateQueue::addBlock(), ServerEnvironment::clearObjects(), ClientMap::updateDrawList(), and ClientMap::updateDrawListShadow().
Here is the caller graph for this function:
|
inline |
References m_node_timers, p(), and NodeTimerList::remove().
Referenced by Map::removeNodeTimer().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_modified, m_modified_reason, and MOD_STATE_CLEAN.
Referenced by ServerMap::loadBlock(), and ServerMap::saveBlock().
Here is the caller graph for this function:
|
inline |
References m_usage_timer.
Referenced by ServerEnvironment::activateBlock(), RemoteClient::GetNextBlocks(), ServerEnvironment::step(), ClientMap::touchMapBlocks(), ClientMap::updateDrawList(), and ClientMap::updateDrawListShadow().
Here is the caller graph for this function:| bool MapBlock::saveStaticObject | ( | u16 | id, |
| const StaticObject & | obj, | ||
| u32 | reason ) |
References get_max_objects_per_block(), getPos(), StaticObjectList::getStoredSize(), StaticObjectList::insert(), m_static_objects, MOD_REASON_UNKNOWN, MOD_STATE_WRITE_NEEDED, raiseModified(), and warningstream.
Referenced by ServerEnvironment::saveStaticToBlock().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::serialize | ( | std::ostream & | result, |
| u8 | version, | ||
| bool | disk, | ||
| int | compression_level ) |
Serialization.
References compress(), data, getBlockNodeIdMapping(), Buffer< T >::getSize(), getTimestamp(), is_underground, isAir(), m_gamedef, m_generated, m_lighting_complete, m_node_metadata, m_node_timers, m_static_objects, IGameDef::ndef(), nodecount, ser_ver_supported_write(), NameIdMapping::serialize(), NodeMetadataList::serialize(), NodeTimerList::serialize(), StaticObjectList::serialize(), MapNode::serializeBulk(), writeU16(), writeU32(), and writeU8().
Referenced by recompress_map_database(), ServerMap::saveBlock(), and Server::SendBlockNoLock().
Here is the call graph for this function:
Here is the caller graph for this function:| void MapBlock::serializeNetworkSpecific | ( | std::ostream & | os | ) |
References writeU8().
Referenced by Server::SendBlockNoLock().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_generated, MOD_REASON_SET_GENERATED, MOD_STATE_WRITE_NEEDED, and raiseModified().
Referenced by ServerMap::finishBlockMake().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References is_underground, MOD_REASON_SET_IS_UNDERGROUND, MOD_STATE_WRITE_NEEDED, and raiseModified().
Referenced by ServerMap::initBlockMake().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References LIGHTBANK_NIGHT, m_lighting_complete, and setLightingComplete().
Here is the call graph for this function:
|
inline |
References m_lighting_complete, MOD_REASON_SET_LIGHTING_COMPLETE, MOD_STATE_WRITE_AT_UNLOAD, and raiseModified().
Referenced by setLightingComplete(), voxalgo::spread_light(), voxalgo::unspread_light(), and voxalgo::update_block_border_lighting().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References data, isValidPosition(), MOD_REASON_SET_NODE, MOD_STATE_WRITE_NEEDED, raiseModified(), x, y, ystride, z, and zstride.
Referenced by setNode().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References data, MOD_REASON_SET_NODE, MOD_STATE_WRITE_NEEDED, raiseModified(), x, y, ystride, z, and zstride.
Referenced by voxalgo::fill_with_sunlight(), voxalgo::propagate_block_sunlight(), set_node_in_block(), setNodeNoCheck(), voxalgo::spread_light(), voxalgo::unspread_light(), voxalgo::update_block_border_lighting(), and voxalgo::update_lighting_nodes().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_node_timers, and NodeTimerList::set().
Referenced by Map::setNodeTimer(), and step().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_timestamp, MOD_REASON_SET_TIMESTAMP, MOD_STATE_WRITE_AT_UNLOAD, and raiseModified().
Referenced by ServerEnvironment::step().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
References m_timestamp.
Referenced by ServerEnvironment::activateBlock(), deSerialize(), deSerialize_pre22(), and ServerEnvironment::step().
Here is the caller graph for this function:References getNodeNoEx(), getPosRelative(), m_node_timers, p(), setNodeTimer(), and NodeTimerList::step().
Referenced by ServerEnvironment::activateBlock(), and ServerEnvironment::step().
Here is the call graph for this function:
Here is the caller graph for this function:| bool MapBlock::storeActiveObject | ( | u16 | id | ) |
References m_static_objects, MOD_REASON_REMOVE_OBJECTS_DEACTIVATE, MOD_STATE_WRITE_NEEDED, raiseModified(), and StaticObjectList::storeActiveObject().
Here is the call graph for this function:| std::vector<content_t> MapBlock::contents |
Referenced by ABMHandler::apply(), and raiseModified().
|
private |
Referenced by ~MapBlock(), actuallyUpdateIsAir(), copyFrom(), copyTo(), deSerialize(), deSerialize_pre22(), getData(), getNode(), getNodeNoCheck(), reallocate(), serialize(), setNode(), and setNodeNoCheck().
| bool MapBlock::do_not_cache_contents = false |
Referenced by ABMHandler::apply().
|
private |
Referenced by deSerialize(), deSerialize_pre22(), getIsUnderground(), serialize(), and setIsUnderground().
|
private |
Referenced by deSerialize(), deSerialize_pre22(), getDiskTimestamp(), and raiseModified().
|
private |
Referenced by deSerialize(), deSerialize_pre22(), and serialize().
|
private |
Referenced by deSerialize(), deSerialize_pre22(), isGenerated(), serialize(), and setGenerated().
|
private |
Referenced by actuallyUpdateIsAir(), deSerialize(), deSerialize_pre22(), and isAir().
|
private |
Referenced by actuallyUpdateIsAir(), deSerialize(), deSerialize_pre22(), expireIsAirCache(), and isAir().
|
private |
Each bit indicates if light spreading was finished in a direction. (Because the neighbor could also be unloaded.) Bits (most significant first): nothing, nothing, nothing, nothing, night X-, night Y-, night Z-, night Z+, night Y+, night X+, day X-, day Y-, day Z-, day Z+, day Y+, day X+.
Referenced by deSerialize(), deSerialize_pre22(), getLightingComplete(), isLightingComplete(), serialize(), setLightingComplete(), and setLightingComplete().
|
private |
Referenced by MapBlock(), getModified(), raiseModified(), and resetModified().
|
private |
Referenced by getModifiedReason(), getModifiedReasonString(), raiseModified(), and resetModified().
| NodeMetadataList MapBlock::m_node_metadata |
|
private |
Referenced by clearNodeTimers(), deSerialize(), deSerialize_pre22(), getNodeTimer(), removeNodeTimer(), serialize(), setNodeTimer(), and step().
|
private |
Referenced by isOrphan(), and makeOrphan().
|
private |
Referenced by getPosRelative().
| StaticObjectList MapBlock::m_static_objects |
Referenced by ServerEnvironment::activateBlock(), ServerEnvironment::activateObjects(), ServerEnvironment::addActiveObjectRaw(), assert_active_in_block(), clearObjects(), ABMHandler::countObjects(), ServerEnvironment::deleteStaticFromBlock(), deSerialize(), deSerialize_pre22(), onObjectsActivation(), saveStaticObject(), serialize(), ServerEnvironment::setStaticForActiveObjectsInBlock(), and storeActiveObject().
|
private |
Referenced by deSerialize(), deSerialize_pre22(), getTimestamp(), raiseModified(), setTimestamp(), and setTimestampNoChangedFlag().
|
private |
Referenced by getUsageTimer(), incrementUsageTimer(), and resetUsageTimer().
|
static |
Referenced by BlockPlaceholder::BlockPlaceholder(), ~MapBlock(), actuallyUpdateIsAir(), correctBlockNodeIds(), deSerialize(), deSerialize_pre22(), DummyMap::fill(), getBlockNodeIdMapping(), reallocate(), serialize(), TestMapBlock::testLoad20(), TestMapBlock::testSave29(), and TestMapBlock::testSaveLoad().
|
static |
Referenced by getNode(), getNodeNoCheck(), setNode(), and setNodeNoCheck().
|
static |
Referenced by getNode(), getNodeNoCheck(), setNode(), and setNodeNoCheck().