Minetest  5.4.0
mapblock.h
Go to the documentation of this file.
1 /*
2 Minetest
3 Copyright (C) 2013 celeron55, Perttu Ahola <celeron55@gmail.com>
4 
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as published by
7 the Free Software Foundation; either version 2.1 of the License, or
8 (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU Lesser General Public License for more details.
14 
15 You should have received a copy of the GNU Lesser General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18 */
19 
20 #pragma once
21 
22 #include <set>
23 #include "irr_v3d.h"
24 #include "mapnode.h"
25 #include "exceptions.h"
26 #include "constants.h"
27 #include "staticobject.h"
28 #include "nodemetadata.h"
29 #include "nodetimer.h"
30 #include "modifiedstate.h"
31 #include "util/numeric.h" // getContainerPos
32 #include "settings.h"
33 #include "mapgen/mapgen.h"
34 
35 class Map;
36 class NodeMetadataList;
37 class IGameDef;
38 class MapBlockMesh;
39 class VoxelManipulator;
40 
41 #define BLOCK_TIMESTAMP_UNDEFINED 0xffffffff
42 
46 
47 #define MOD_REASON_INITIAL (1 << 0)
48 #define MOD_REASON_REALLOCATE (1 << 1)
49 #define MOD_REASON_SET_IS_UNDERGROUND (1 << 2)
50 #define MOD_REASON_SET_LIGHTING_COMPLETE (1 << 3)
51 #define MOD_REASON_SET_GENERATED (1 << 4)
52 #define MOD_REASON_SET_NODE (1 << 5)
53 #define MOD_REASON_SET_NODE_NO_CHECK (1 << 6)
54 #define MOD_REASON_SET_TIMESTAMP (1 << 7)
55 #define MOD_REASON_REPORT_META_CHANGE (1 << 8)
56 #define MOD_REASON_CLEAR_ALL_OBJECTS (1 << 9)
57 #define MOD_REASON_BLOCK_EXPIRED (1 << 10)
58 #define MOD_REASON_ADD_ACTIVE_OBJECT_RAW (1 << 11)
59 #define MOD_REASON_REMOVE_OBJECTS_REMOVE (1 << 12)
60 #define MOD_REASON_REMOVE_OBJECTS_DEACTIVATE (1 << 13)
61 #define MOD_REASON_TOO_MANY_OBJECTS (1 << 14)
62 #define MOD_REASON_STATIC_DATA_ADDED (1 << 15)
63 #define MOD_REASON_STATIC_DATA_REMOVED (1 << 16)
64 #define MOD_REASON_STATIC_DATA_CHANGED (1 << 17)
65 #define MOD_REASON_EXPIRE_DAYNIGHTDIFF (1 << 18)
66 #define MOD_REASON_VMANIP (1 << 19)
67 #define MOD_REASON_UNKNOWN (1 << 20)
68 
72 
73 class MapBlock
74 {
75 public:
76  MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy=false);
77  ~MapBlock();
78 
79  /*virtual u16 nodeContainerId() const
80  {
81  return NODECONTAINER_ID_MAPBLOCK;
82  }*/
83 
85  {
86  return m_parent;
87  }
88 
89  void reallocate()
90  {
91  delete[] data;
92  data = new MapNode[nodecount];
93  for (u32 i = 0; i < nodecount; i++)
95 
97  }
98 
100  {
101  return data;
102  }
103 
107  void raiseModified(u32 mod, u32 reason=MOD_REASON_UNKNOWN)
108  {
109  if (mod > m_modified) {
110  m_modified = mod;
111  m_modified_reason = reason;
114  } else if (mod == m_modified) {
115  m_modified_reason |= reason;
116  }
117  if (mod == MOD_STATE_WRITE_NEEDED)
118  contents_cached = false;
119  }
120 
121  inline u32 getModified()
122  {
123  return m_modified;
124  }
125 
126  inline u32 getModifiedReason()
127  {
128  return m_modified_reason;
129  }
130 
131  std::string getModifiedReasonString();
132 
133  inline void resetModified()
134  {
136  m_modified_reason = 0;
137  }
138 
142 
143  inline bool isDummy()
144  {
145  return !data;
146  }
147 
148  inline void unDummify()
149  {
150  assert(isDummy()); // Pre-condition
151  reallocate();
152  }
153 
154  // is_underground getter/setter
155  inline bool getIsUnderground()
156  {
157  return is_underground;
158  }
159 
160  inline void setIsUnderground(bool a_is_underground)
161  {
162  is_underground = a_is_underground;
164  }
165 
166  inline void setLightingComplete(u16 newflags)
167  {
168  if (newflags != m_lighting_complete) {
169  m_lighting_complete = newflags;
171  }
172  }
173 
174  inline u16 getLightingComplete()
175  {
176  return m_lighting_complete;
177  }
178 
180  bool is_complete)
181  {
182  assert(direction >= 0 && direction <= 5);
183  if (bank == LIGHTBANK_NIGHT) {
184  direction += 6;
185  }
186  u16 newflags = m_lighting_complete;
187  if (is_complete) {
188  newflags |= 1 << direction;
189  } else {
190  newflags &= ~(1 << direction);
191  }
192  setLightingComplete(newflags);
193  }
194 
195  inline bool isLightingComplete(LightBank bank, u8 direction)
196  {
197  assert(direction >= 0 && direction <= 5);
198  if (bank == LIGHTBANK_NIGHT) {
199  direction += 6;
200  }
201  return (m_lighting_complete & (1 << direction)) != 0;
202  }
203 
204  inline bool isGenerated()
205  {
206  return m_generated;
207  }
208 
209  inline void setGenerated(bool b)
210  {
211  if (b != m_generated) {
213  m_generated = b;
214  }
215  }
216 
220 
221  inline v3s16 getPos()
222  {
223  return m_pos;
224  }
225 
227  {
228  return m_pos_relative;
229  }
230 
231  inline core::aabbox3d<s16> getBox()
232  {
233  return core::aabbox3d<s16>(getPosRelative(),
236  - v3s16(1,1,1));
237  }
238 
242 
243  inline bool isValidPosition(s16 x, s16 y, s16 z)
244  {
245  return data
246  && x >= 0 && x < MAP_BLOCKSIZE
247  && y >= 0 && y < MAP_BLOCKSIZE
248  && z >= 0 && z < MAP_BLOCKSIZE;
249  }
250 
251  inline bool isValidPosition(v3s16 p)
252  {
253  return isValidPosition(p.X, p.Y, p.Z);
254  }
255 
256  inline MapNode getNode(s16 x, s16 y, s16 z, bool *valid_position)
257  {
258  *valid_position = isValidPosition(x, y, z);
259 
260  if (!*valid_position)
261  return {CONTENT_IGNORE};
262 
263  return data[z * zstride + y * ystride + x];
264  }
265 
266  inline MapNode getNode(v3s16 p, bool *valid_position)
267  {
268  return getNode(p.X, p.Y, p.Z, valid_position);
269  }
270 
272  {
273  bool is_valid;
274  return getNode(p.X, p.Y, p.Z, &is_valid);
275  }
276 
277  inline void setNode(s16 x, s16 y, s16 z, MapNode & n)
278  {
279  if (!isValidPosition(x, y, z))
280  throw InvalidPositionException();
281 
282  data[z * zstride + y * ystride + x] = n;
284  }
285 
286  inline void setNode(v3s16 p, MapNode & n)
287  {
288  setNode(p.X, p.Y, p.Z, n);
289  }
290 
294 
295  inline MapNode getNodeNoCheck(s16 x, s16 y, s16 z, bool *valid_position)
296  {
297  *valid_position = data != nullptr;
298  if (!*valid_position)
299  return {CONTENT_IGNORE};
300 
301  return data[z * zstride + y * ystride + x];
302  }
303 
304  inline MapNode getNodeNoCheck(v3s16 p, bool *valid_position)
305  {
306  return getNodeNoCheck(p.X, p.Y, p.Z, valid_position);
307  }
308 
314 
315  inline const MapNode &getNodeUnsafe(s16 x, s16 y, s16 z)
316  {
317  return data[z * zstride + y * ystride + x];
318  }
319 
320  inline const MapNode &getNodeUnsafe(v3s16 &p)
321  {
322  return getNodeUnsafe(p.X, p.Y, p.Z);
323  }
324 
325  inline void setNodeNoCheck(s16 x, s16 y, s16 z, MapNode & n)
326  {
327  if (!data)
328  throw InvalidPositionException();
329 
330  data[z * zstride + y * ystride + x] = n;
332  }
333 
334  inline void setNodeNoCheck(v3s16 p, MapNode & n)
335  {
336  setNodeNoCheck(p.X, p.Y, p.Z, n);
337  }
338 
339  // These functions consult the parent container if the position
340  // is not valid on this MapBlock.
342  MapNode getNodeParent(v3s16 p, bool *is_valid_position = NULL);
343 
344  // Copies data to VoxelManipulator to getPosRelative()
345  void copyTo(VoxelManipulator &dst);
346 
347  // Copies data from VoxelManipulator getPosRelative()
348  void copyFrom(VoxelManipulator &dst);
349 
350  // Update day-night lighting difference flag.
351  // Sets m_day_night_differs to appropriate value.
352  // These methods don't care about neighboring blocks.
354 
355  // Call this to schedule what the previous function does to be done
356  // when the value is actually needed.
357  void expireDayNightDiff();
358 
359  inline bool getDayNightDiff()
360  {
363  return m_day_night_differs;
364  }
365 
369 
370  /*
371  Tries to measure ground level.
372  Return value:
373  -1 = only air
374  -2 = only ground
375  -3 = random fail
376  0...MAP_BLOCKSIZE-1 = ground level
377  */
378  s16 getGroundLevel(v2s16 p2d);
379 
383 
384  // NOTE: BLOCK_TIMESTAMP_UNDEFINED=0xffffffff means there is no timestamp.
385 
386  inline void setTimestamp(u32 time)
387  {
388  m_timestamp = time;
390  }
391 
392  inline void setTimestampNoChangedFlag(u32 time)
393  {
394  m_timestamp = time;
395  }
396 
397  inline u32 getTimestamp()
398  {
399  return m_timestamp;
400  }
401 
402  inline u32 getDiskTimestamp()
403  {
404  return m_disk_timestamp;
405  }
406 
410 
411  inline void resetUsageTimer()
412  {
413  m_usage_timer = 0;
414  }
415 
416  inline void incrementUsageTimer(float dtime)
417  {
418  m_usage_timer += dtime;
419  }
420 
421  inline float getUsageTimer()
422  {
423  return m_usage_timer;
424  }
425 
429 
430  inline void refGrab()
431  {
432  m_refcount++;
433  }
434 
435  inline void refDrop()
436  {
437  m_refcount--;
438  }
439 
440  inline int refGet()
441  {
442  return m_refcount;
443  }
444 
448 
449  inline NodeTimer getNodeTimer(const v3s16 &p)
450  {
451  return m_node_timers.get(p);
452  }
453 
454  inline void removeNodeTimer(const v3s16 &p)
455  {
457  }
458 
459  inline void setNodeTimer(const NodeTimer &t)
460  {
461  m_node_timers.set(t);
462  }
463 
464  inline void clearNodeTimers()
465  {
467  }
468 
472 
473  // These don't write or read version by itself
474  // Set disk to true for on-disk format, false for over-the-network format
475  // Precondition: version >= SER_FMT_VER_LOWEST_WRITE
476  void serialize(std::ostream &os, u8 version, bool disk, int compression_level);
477  // If disk == true: In addition to doing other things, will add
478  // unknown blocks from id-name mapping to wndef
479  void deSerialize(std::istream &is, u8 version, bool disk);
480 
481  void serializeNetworkSpecific(std::ostream &os);
482  void deSerializeNetworkSpecific(std::istream &is);
483 private:
484  /*
485  Private methods
486  */
487 
488  void deSerialize_pre22(std::istream &is, u8 version, bool disk);
489 
490  /*
491  Used only internally, because changes can't be tracked
492  */
493 
494  inline MapNode &getNodeRef(s16 x, s16 y, s16 z)
495  {
496  if (!isValidPosition(x, y, z))
497  throw InvalidPositionException();
498 
499  return data[z * zstride + y * ystride + x];
500  }
501 
503  {
504  return getNodeRef(p.X, p.Y, p.Z);
505  }
506 
507 public:
508  /*
509  Public member variables
510  */
511 
512 #ifndef SERVER // Only on client
513  MapBlockMesh *mesh = nullptr;
514 #endif
515 
519 
520  static const u32 ystride = MAP_BLOCKSIZE;
521  static const u32 zstride = MAP_BLOCKSIZE * MAP_BLOCKSIZE;
522 
524 
526  // Cache of content types
527  std::unordered_set<content_t> contents;
528  // True if content types are cached
529  bool contents_cached = false;
530  // True if we never want to cache content types for this block
531  bool do_not_cache_contents = false;
532 
533 private:
534  /*
535  Private member variables
536  */
537 
538  // NOTE: Lots of things rely on this being the Map
540  // Position in blocks on parent
542 
543  /* This is the precalculated m_pos_relative value
544  * This caches the value, improving performance by removing 3 s16 multiplications
545  * at runtime on each getPosRelative call
546  * For a 5 minutes runtime with valgrind this removes 3 * 19M s16 multiplications
547  * The gain can be estimated in Release Build to 3 * 100M multiply operations for 5 mins
548  */
550 
552 
553  /*
554  If NULL, block is a dummy block.
555  Dummy blocks are used for caching not-found-on-disk blocks.
556  */
557  MapNode *data = nullptr;
558 
559  /*
560  - On the server, this is used for telling whether the
561  block has been modified from the one on disk.
562  - On the client, this is used for nothing.
563  */
566 
567  /*
568  When propagating sunlight and the above block doesn't exist,
569  sunlight is assumed if this is false.
570 
571  In practice this is set to true if the block is completely
572  undeground with nothing visible above the ground except
573  caves.
574  */
575  bool is_underground = false;
576 
585  u16 m_lighting_complete = 0xFFFF;
586 
587  // Whether day and night lighting differs
588  bool m_day_night_differs = false;
590 
591  bool m_generated = false;
592 
593  /*
594  When block is removed from active blocks, this is set to gametime.
595  Value BLOCK_TIMESTAMP_UNDEFINED=0xffffffff means there is no timestamp.
596  */
598  // The on-disk (or to-be on-disk) timestamp value
600 
601  /*
602  When the block is accessed, this is set to 0.
603  Map will unload the block when this reaches a timeout.
604  */
605  float m_usage_timer = 0;
606 
607  /*
608  Reference count; currently used for determining if this block is in
609  the list of blocks to be drawn.
610  */
611  int m_refcount = 0;
612 };
613 
614 typedef std::vector<MapBlock*> MapBlockVect;
615 
617 {
618  const float max_limit_bs = MAX_MAP_GENERATION_LIMIT * BS;
619  return p.X < -max_limit_bs ||
620  p.X > max_limit_bs ||
621  p.Y < -max_limit_bs ||
622  p.Y > max_limit_bs ||
623  p.Z < -max_limit_bs ||
624  p.Z > max_limit_bs;
625 }
626 
628 {
629  const s16 max_limit_bp = MAX_MAP_GENERATION_LIMIT / MAP_BLOCKSIZE;
630  return p.X < -max_limit_bp ||
631  p.X > max_limit_bp ||
632  p.Y < -max_limit_bp ||
633  p.Y > max_limit_bp ||
634  p.Z < -max_limit_bp ||
635  p.Z > max_limit_bp;
636 }
637 
638 /*
639  Returns the position of the block where the node is located
640 */
641 inline v3s16 getNodeBlockPos(const v3s16 &p)
642 {
644 }
645 
646 inline void getNodeBlockPosWithOffset(const v3s16 &p, v3s16 &block, v3s16 &offset)
647 {
648  getContainerPosWithOffset(p, MAP_BLOCKSIZE, block, offset);
649 }
650 
651 /*
652  Get a quick string to describe what a block actually contains
653 */
654 std::string analyze_block(MapBlock *block);
Definition: gamedef.h:49
Definition: exceptions.h:118
Definition: mapblock_mesh.h:86
Definition: mapblock.h:74
bool is_underground
Definition: mapblock.h:575
Map * m_parent
Definition: mapblock.h:539
s16 getGroundLevel(v2s16 p2d)
Definition: mapblock.cpp:221
u16 getLightingComplete()
Definition: mapblock.h:174
bool getIsUnderground()
Definition: mapblock.h:155
MapNode getNodeNoCheck(v3s16 p, bool *valid_position)
Definition: mapblock.h:304
float m_usage_timer
Definition: mapblock.h:605
bool m_day_night_differs
Definition: mapblock.h:588
void incrementUsageTimer(float dtime)
Definition: mapblock.h:416
void raiseModified(u32 mod, u32 reason=MOD_REASON_UNKNOWN)
Definition: mapblock.h:107
u32 m_disk_timestamp
Definition: mapblock.h:599
bool isValidPosition(s16 x, s16 y, s16 z)
Definition: mapblock.h:243
MapBlockMesh * mesh
Definition: mapblock.h:513
MapNode * getData()
Definition: mapblock.h:99
void setTimestamp(u32 time)
Definition: mapblock.h:386
v3s16 getPos()
Definition: mapblock.h:221
static const u32 ystride
Definition: mapblock.h:520
void clearNodeTimers()
Definition: mapblock.h:464
void setTimestampNoChangedFlag(u32 time)
Definition: mapblock.h:392
u32 getModified()
Definition: mapblock.h:121
MapNode getNodeNoEx(v3s16 p)
Definition: mapblock.h:271
v3s16 m_pos_relative
Definition: mapblock.h:549
u32 m_timestamp
Definition: mapblock.h:597
v3s16 m_pos
Definition: mapblock.h:541
void reallocate()
Definition: mapblock.h:89
void setGenerated(bool b)
Definition: mapblock.h:209
NodeMetadataList m_node_metadata
Definition: mapblock.h:516
bool isLightingComplete(LightBank bank, u8 direction)
Definition: mapblock.h:195
MapBlock(Map *parent, v3s16 pos, IGameDef *gamedef, bool dummy=false)
Definition: mapblock.cpp:69
MapNode getNode(s16 x, s16 y, s16 z, bool *valid_position)
Definition: mapblock.h:256
u32 m_modified_reason
Definition: mapblock.h:565
v3s16 getPosRelative()
Definition: mapblock.h:226
float getUsageTimer()
Definition: mapblock.h:421
bool isGenerated()
Definition: mapblock.h:204
void setNodeNoCheck(s16 x, s16 y, s16 z, MapNode &n)
Definition: mapblock.h:325
Map * getParent()
Definition: mapblock.h:84
bool m_generated
Definition: mapblock.h:591
static const u32 nodecount
Definition: mapblock.h:523
NodeTimer getNodeTimer(const v3s16 &p)
Definition: mapblock.h:449
bool getDayNightDiff()
Definition: mapblock.h:359
u32 m_modified
Definition: mapblock.h:564
void resetModified()
Definition: mapblock.h:133
void setNode(v3s16 p, MapNode &n)
Definition: mapblock.h:286
void copyTo(VoxelManipulator &dst)
Definition: mapblock.cpp:137
static const u32 zstride
Definition: mapblock.h:521
void actuallyUpdateDayNightDiff()
Definition: mapblock.cpp:157
std::unordered_set< content_t > contents
Definition: mapblock.h:527
const MapNode & getNodeUnsafe(v3s16 &p)
Definition: mapblock.h:320
MapNode * data
Definition: mapblock.h:557
void serialize(std::ostream &os, u8 version, bool disk, int compression_level)
Serialization.
Definition: mapblock.cpp:358
void deSerialize_pre22(std::istream &is, u8 version, bool disk)
Definition: mapblock.cpp:575
void removeNodeTimer(const v3s16 &p)
Definition: mapblock.h:454
void refDrop()
Definition: mapblock.h:435
StaticObjectList m_static_objects
Definition: mapblock.h:518
bool isValidPositionParent(v3s16 p)
Definition: mapblock.cpp:91
MapNode getNode(v3s16 p, bool *valid_position)
Definition: mapblock.h:266
bool isValidPosition(v3s16 p)
Definition: mapblock.h:251
core::aabbox3d< s16 > getBox()
Definition: mapblock.h:231
bool contents_cached
Definition: mapblock.h:529
bool m_day_night_differs_expired
Definition: mapblock.h:589
u32 getDiskTimestamp()
Definition: mapblock.h:402
u16 m_lighting_complete
Definition: mapblock.h:585
u32 getTimestamp()
Definition: mapblock.h:397
std::string getModifiedReasonString()
Definition: mapblock.cpp:115
MapNode getNodeParent(v3s16 p, bool *is_valid_position=NULL)
Definition: mapblock.cpp:100
void setLightingComplete(u16 newflags)
Definition: mapblock.h:166
void setNodeNoCheck(v3s16 p, MapNode &n)
Definition: mapblock.h:334
void expireDayNightDiff()
Definition: mapblock.cpp:210
MapNode & getNodeRef(v3s16 &p)
Definition: mapblock.h:502
void deSerialize(std::istream &is, u8 version, bool disk)
Definition: mapblock.cpp:452
void resetUsageTimer()
Definition: mapblock.h:411
int m_refcount
Definition: mapblock.h:611
void setLightingComplete(LightBank bank, u8 direction, bool is_complete)
Definition: mapblock.h:179
MapNode getNodeNoCheck(s16 x, s16 y, s16 z, bool *valid_position)
Definition: mapblock.h:295
void setNode(s16 x, s16 y, s16 z, MapNode &n)
Definition: mapblock.h:277
void deSerializeNetworkSpecific(std::istream &is)
Definition: mapblock.cpp:557
const MapNode & getNodeUnsafe(s16 x, s16 y, s16 z)
Definition: mapblock.h:315
void copyFrom(VoxelManipulator &dst)
Definition: mapblock.cpp:147
void refGrab()
Definition: mapblock.h:430
void setIsUnderground(bool a_is_underground)
Definition: mapblock.h:160
int refGet()
Definition: mapblock.h:440
u32 getModifiedReason()
Definition: mapblock.h:126
void serializeNetworkSpecific(std::ostream &os)
Definition: mapblock.cpp:443
~MapBlock()
Definition: mapblock.cpp:79
void unDummify()
Definition: mapblock.h:148
bool do_not_cache_contents
Definition: mapblock.h:531
void setNodeTimer(const NodeTimer &t)
Definition: mapblock.h:459
bool isDummy()
Definition: mapblock.h:143
NodeTimerList m_node_timers
Definition: mapblock.h:517
MapNode & getNodeRef(s16 x, s16 y, s16 z)
Definition: mapblock.h:494
IGameDef * m_gamedef
Definition: mapblock.h:551
Definition: map.h:123
Definition: nodemetadata.h:76
Definition: nodetimer.h:58
void remove(v3s16 p)
Definition: nodetimer.h:77
void set(const NodeTimer &timer)
Definition: nodetimer.h:109
NodeTimer get(const v3s16 &p)
Definition: nodetimer.h:67
void clear()
Definition: nodetimer.h:114
Definition: nodetimer.h:36
Definition: staticobject.h:45
Definition: voxel.h:356
#define BS
Definition: constants.h:74
#define MAP_BLOCKSIZE
Definition: constants.h:77
#define MAX_MAP_GENERATION_LIMIT
Definition: constants.h:67
core::vector2d< s16 > v2s16
Definition: irr_v2d.h:27
core::vector3d< s16 > v3s16
Definition: irr_v3d.h:28
core::vector3df v3f
Definition: irr_v3d.h:26
#define MOD_REASON_UNKNOWN
Definition: mapblock.h:67
#define MOD_REASON_SET_GENERATED
Definition: mapblock.h:51
#define MOD_REASON_REALLOCATE
Definition: mapblock.h:48
std::vector< MapBlock * > MapBlockVect
Definition: mapblock.h:614
#define MOD_REASON_SET_LIGHTING_COMPLETE
Definition: mapblock.h:50
v3s16 getNodeBlockPos(const v3s16 &p)
Definition: mapblock.h:641
bool objectpos_over_limit(v3f p)
Definition: mapblock.h:616
std::string analyze_block(MapBlock *block)
Definition: mapblock.cpp:786
void getNodeBlockPosWithOffset(const v3s16 &p, v3s16 &block, v3s16 &offset)
Definition: mapblock.h:646
#define MOD_REASON_INITIAL
Definition: mapblock.h:47
#define MOD_REASON_SET_NODE
Definition: mapblock.h:52
#define BLOCK_TIMESTAMP_UNDEFINED
Definition: mapblock.h:41
#define MOD_REASON_SET_IS_UNDERGROUND
Definition: mapblock.h:49
#define MOD_REASON_SET_TIMESTAMP
Definition: mapblock.h:54
bool blockpos_over_max_limit(v3s16 p)
Definition: mapblock.h:627
#define MOD_REASON_SET_NODE_NO_CHECK
Definition: mapblock.h:53
#define CONTENT_IGNORE
Definition: mapnode.h:71
LightBank
Definition: mapnode.h:74
@ LIGHTBANK_NIGHT
Definition: mapnode.h:76
@ MOD_STATE_WRITE_AT_UNLOAD
Definition: modifiedstate.h:28
@ MOD_STATE_CLEAN
Definition: modifiedstate.h:25
@ MOD_STATE_WRITE_NEEDED
Definition: modifiedstate.h:31
u8 direction
Definition: voxelalgorithms.cpp:39
s16 getContainerPos(s16 p, s16 d)
Definition: numeric.h:40
void getContainerPosWithOffset(s16 p, s16 d, s16 &container, s16 &offset)
Definition: numeric.h:79
Definition: mapnode.h:118
std::string p(std::string path)
Definition: test_filepath.cpp:59