25#define BLOCK_TIMESTAMP_UNDEFINED 0xffffffff
155 assert(direction <= 5);
161 newflags |= 1 << direction;
163 newflags &= ~(1 << direction);
170 assert(direction <= 5);
208 static inline core::aabbox3d<s16>
getBox(
const v3s16 &pos_relative)
210 return core::aabbox3d<s16>(pos_relative,
236 if (!*valid_position)
244 return getNode(
p.X,
p.Y,
p.Z, valid_position);
316 void step(
float dtime,
const std::function<
bool(
v3s16,
MapNode, f32)> &on_timer_cb);
416 void serialize(std::ostream &result, u8 version,
bool disk,
int compression_level);
419 void deSerialize(std::istream &is, u8 version,
bool disk);
448#if CHECK_CLIENT_BUILD()
559 return p.X < -max_limit_bs ||
560 p.X > max_limit_bs ||
561 p.Y < -max_limit_bs ||
562 p.Y > max_limit_bs ||
563 p.Z < -max_limit_bs ||
570 return p.X < -max_limit_bp ||
571 p.X > max_limit_bp ||
572 p.Y < -max_limit_bp ||
573 p.Y > max_limit_bp ||
574 p.Z < -max_limit_bp ||
Definition exceptions.h:108
Definition mapblock_mesh.h:164
bool is_underground
Definition mapblock.h:544
bool m_orphan
Definition mapblock.h:457
u16 getLightingComplete()
Definition mapblock.h:147
bool getIsUnderground()
Definition mapblock.h:128
MapNode *const data
Definition mapblock.h:481
MapNode getNodeNoCheck(s16 x, s16 y, s16 z)
Definition mapblock.h:271
float m_usage_timer
Definition mapblock.h:490
void incrementUsageTimer(float dtime)
Definition mapblock.h:354
void raiseModified(u32 mod, u32 reason=MOD_REASON_UNKNOWN)
Definition mapblock.h:91
u32 m_disk_timestamp
Definition mapblock.h:521
bool isValidPosition(s16 x, s16 y, s16 z)
Definition mapblock.h:220
void removeNodeTimer(v3s16 p)
Definition mapblock.h:394
void setTimestamp(u32 time)
Definition mapblock.h:324
v3s16 getPos()
Definition mapblock.h:194
static const u32 ystride
Definition mapblock.h:428
short refGet()
Definition mapblock.h:380
void clearNodeTimers()
Definition mapblock.h:404
void setTimestampNoChangedFlag(u32 time)
Definition mapblock.h:330
u32 getModified()
Definition mapblock.h:105
MapNode getNodeNoEx(v3s16 p)
Definition mapblock.h:247
v3s16 m_pos_relative
Definition mapblock.h:468
u32 m_timestamp
Definition mapblock.h:519
v3s16 m_pos
Definition mapblock.h:460
void reallocate()
Definition mapblock.h:76
void setGenerated(bool b)
Definition mapblock.h:182
NodeMetadataList m_node_metadata
Definition mapblock.h:547
bool isLightingComplete(LightBank bank, u8 direction)
Definition mapblock.h:168
u32 clearObjects()
Definition mapblock.cpp:592
MapNode getNode(s16 x, s16 y, s16 z, bool *valid_position)
Definition mapblock.h:232
u32 m_modified_reason
Definition mapblock.h:513
bool m_is_air
Definition mapblock.h:504
u16 m_modified
Definition mapblock.h:512
void setNode(s16 x, s16 y, s16 z, MapNode n)
Definition mapblock.h:253
v3s16 getPosRelative()
Definition mapblock.h:199
float getUsageTimer()
Definition mapblock.h:359
bool isGenerated()
Definition mapblock.h:177
bool m_generated
Definition mapblock.h:534
void setNodeNoCheck(v3s16 p, MapNode n)
Definition mapblock.h:287
static const u32 nodecount
Definition mapblock.h:431
void resetModified()
Definition mapblock.h:117
void copyTo(VoxelManipulator &dst)
Definition mapblock.cpp:156
void makeOrphan()
Definition mapblock.h:71
static const u32 zstride
Definition mapblock.h:429
void deSerialize_pre22(std::istream &is, u8 version, bool disk)
Definition mapblock.cpp:605
void refDrop()
Definition mapblock.h:374
bool m_is_air_expired
Definition mapblock.h:505
StaticObjectList m_static_objects
Definition mapblock.h:548
bool saveStaticObject(u16 id, const StaticObject &obj, u32 reason)
Definition mapblock.cpp:100
MapNode getNode(v3s16 p, bool *valid_position)
Definition mapblock.h:242
bool isValidPosition(v3s16 p)
Definition mapblock.h:227
void setNodeNoCheck(s16 x, s16 y, s16 z, MapNode n)
Definition mapblock.h:281
void serialize(std::ostream &result, u8 version, bool disk, int compression_level)
Serialization.
Definition mapblock.cpp:308
bool isAir()
Definition mapblock.h:306
u32 getDiskTimestamp()
Definition mapblock.h:340
bool isOrphan() const
Definition mapblock.h:66
std::vector< content_t > contents
Definition mapblock.h:500
u16 m_lighting_complete
Definition mapblock.h:531
u32 getTimestamp()
Definition mapblock.h:335
std::string getModifiedReasonString()
Definition mapblock.cpp:134
void setLightingComplete(u16 newflags)
Definition mapblock.h:139
NodeTimer getNodeTimer(v3s16 p)
Definition mapblock.h:389
MapNode * getData()
Definition mapblock.h:83
void deSerialize(std::istream &is, u8 version, bool disk)
Definition mapblock.cpp:422
void resetUsageTimer()
Definition mapblock.h:349
void setLightingComplete(LightBank bank, u8 direction, bool is_complete)
Definition mapblock.h:152
void copyFrom(const VoxelManipulator &src)
Definition mapblock.cpp:166
void setNode(v3s16 p, MapNode n)
Definition mapblock.h:262
bool onObjectsActivation()
Definition mapblock.cpp:76
MapNode getNodeNoCheck(v3s16 p)
Definition mapblock.h:276
bool storeActiveObject(u16 id)
Definition mapblock.cpp:581
void deSerializeNetworkSpecific(std::istream &is)
Definition mapblock.cpp:567
MapBlock(v3s16 pos, IGameDef *gamedef)
Definition mapblock.cpp:53
void refGrab()
Definition mapblock.h:368
void setIsUnderground(bool a_is_underground)
Definition mapblock.h:133
u32 getModifiedReason()
Definition mapblock.h:110
void serializeNetworkSpecific(std::ostream &os)
Definition mapblock.cpp:417
~MapBlock()
Definition mapblock.cpp:63
void expireIsAirCache()
Definition mapblock.cpp:194
bool do_not_cache_contents
Definition mapblock.h:495
void setNodeTimer(const NodeTimer &t)
Definition mapblock.h:399
NodeTimerList m_node_timers
Definition mapblock.h:551
void actuallyUpdateIsAir()
Definition mapblock.cpp:176
IGameDef * m_gamedef
Definition mapblock.h:484
static core::aabbox3d< s16 > getBox(const v3s16 &pos_relative)
Definition mapblock.h:208
short m_refcount
Definition mapblock.h:474
core::aabbox3d< s16 > getBox()
Definition mapblock.h:204
void step(float dtime, const std::function< bool(v3s16, MapNode, f32)> &on_timer_cb)
Definition mapblock.cpp:118
Definition nodetimer.h:43
void remove(v3s16 p)
Definition nodetimer.h:62
void set(const NodeTimer &timer)
Definition nodetimer.h:90
NodeTimer get(const v3s16 &p)
Definition nodetimer.h:52
void clear()
Definition nodetimer.h:95
Definition nodetimer.h:21
Definition staticobject.h:30
#define BS
Definition constants.h:61
#define MAP_BLOCKSIZE
Definition constants.h:64
#define MAX_MAP_GENERATION_LIMIT
Definition constants.h:54
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
std::vector< MapBlock * > MapBlockVect
Definition mapblock.h:554
v3s16 getNodeBlockPos(v3s16 p)
Definition mapblock.h:581
bool objectpos_over_limit(v3f p)
Definition mapblock.h:556
std::string analyze_block(MapBlock *block)
Definition mapblock.cpp:812
#define BLOCK_TIMESTAMP_UNDEFINED
Definition mapblock.h:25
void getNodeBlockPosWithOffset(v3s16 p, v3s16 &block, v3s16 &offset)
Definition mapblock.h:586
bool blockpos_over_max_limit(v3s16 p)
Definition mapblock.h:567
ModReason
Definition mapblock.h:31
@ MOD_REASON_SET_TIMESTAMP
Definition mapblock.h:37
@ MOD_REASON_CLEAR_ALL_OBJECTS
Definition mapblock.h:39
@ MOD_REASON_UNKNOWN
Definition mapblock.h:50
@ MOD_REASON_STATIC_DATA_CHANGED
Definition mapblock.h:47
@ MOD_REASON_STATIC_DATA_REMOVED
Definition mapblock.h:46
@ MOD_REASON_SET_IS_UNDERGROUND
Definition mapblock.h:33
@ MOD_REASON_SET_NODE
Definition mapblock.h:36
@ MOD_REASON_TOO_MANY_OBJECTS
Definition mapblock.h:44
@ MOD_REASON_REMOVE_OBJECTS_REMOVE
Definition mapblock.h:42
@ MOD_REASON_REPORT_META_CHANGE
Definition mapblock.h:38
@ MOD_REASON_ADD_ACTIVE_OBJECT_RAW
Definition mapblock.h:41
@ MOD_REASON_REALLOCATE
Definition mapblock.h:32
@ MOD_REASON_EXPIRE_IS_AIR
Definition mapblock.h:48
@ MOD_REASON_BLOCK_EXPIRED
Definition mapblock.h:40
@ MOD_REASON_VMANIP
Definition mapblock.h:49
@ MOD_REASON_SET_GENERATED
Definition mapblock.h:35
@ MOD_REASON_REMOVE_OBJECTS_DEACTIVATE
Definition mapblock.h:43
@ MOD_REASON_STATIC_DATA_ADDED
Definition mapblock.h:45
@ MOD_REASON_SET_LIGHTING_COMPLETE
Definition mapblock.h:34
#define CONTENT_IGNORE
Definition mapnode.h:58
LightBank
Definition mapnode.h:80
@ LIGHTBANK_NIGHT
Definition mapnode.h:82
@ MOD_STATE_WRITE_AT_UNLOAD
Definition modifiedstate.h:15
@ MOD_STATE_CLEAN
Definition modifiedstate.h:12
@ MOD_STATE_WRITE_NEEDED
Definition modifiedstate.h:18
s16 getContainerPos(s16 p, s16 d)
Definition numeric.h:31
void getContainerPosWithOffset(s16 p, s16 d, s16 &container, s16 &offset)
Definition numeric.h:70
Definition staticobject.h:17
static std::string p(std::string path)
Definition test_filesys.cpp:53