Cuberite
A lightweight, fast and extensible game server for Minecraft
Chunk.h
Go to the documentation of this file.
1 
2 #pragma once
3 
5 #include "ChunkData.h"
6 
9 
10 #include "ChunkMap.h"
11 
12 
13 
14 
15 
16 class cWorld;
17 class cClientHandle;
18 class cPlayer;
19 class cChunkMap;
20 class cBoundingBox;
21 class cChunkDataCallback;
22 class cBlockArea;
23 class cBlockArea;
25 class cMobCensus;
26 class cMobSpawner;
28 
29 struct SetChunkData;
30 
31 // A convenience macro for calling GetChunkAndRelByAbsolute.
32 #define PREPARE_REL_AND_CHUNK(Position, OriginalChunk) cChunk * Chunk; Vector3i Rel; bool RelSuccess = (OriginalChunk).GetChunkAndRelByAbsolute(Position, &Chunk, Rel)
33 
34 
35 class cChunk
36 {
37 public:
38 
40  enum ePresence
41  {
45  };
46 
47  cChunk(
48  int a_ChunkX, int a_ChunkZ, // Chunk coords
49  cChunkMap * a_ChunkMap, cWorld * a_World // Parent objects
50  );
51  cChunk(const cChunk & Other) = delete;
52  ~cChunk();
53 
55  void BroadcastPendingChanges(void);
56 
58  bool IsValid(void) const {return (m_Presence == cpPresent); }
59 
61  bool IsQueued(void) const {return (m_Presence == cpQueued); }
62 
65  void SetPresence(ePresence a_Presence);
66 
68  void MarkRegenerating(void);
69 
71  bool IsDirty(void) const {return m_IsDirty; }
72 
73  bool CanUnload(void) const;
74 
76  bool CanUnloadAfterSaving(void) const;
77 
81  void OnUnload();
82 
83  bool IsLightValid(void) const {return m_IsLightValid; }
84 
85  /*
86  To save a chunk, the WSSchema must:
87  1. Mark the chunk as being saved (MarkSaving())
88  2. Get the chunk's data using GetAllData()
89  3. Mark the chunk as saved (MarkSaved())
90  If anywhere inside this sequence another thread mmodifies the chunk, the chunk will not get marked as saved in MarkSaved()
91  */
92  void MarkSaving(void); // Marks the chunk as being saved.
93  void MarkSaved(void); // Marks the chunk as saved, if it didn't change from the last call to MarkSaving()
94  void MarkLoaded(void); // Marks the chunk as freshly loaded. Fails if the chunk is already valid
95 
97  void MarkLoadFailed(void);
98 
100  void GetAllData(cChunkDataCallback & a_Callback) const;
101 
105  void SetAllData(SetChunkData && a_SetChunkData);
106 
107  void SetLight(
108  const cChunkDef::BlockNibbles & a_BlockLight,
109  const cChunkDef::BlockNibbles & a_SkyLight
110  );
111 
113  void WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes);
114 
118  void Stay(bool a_Stay = true);
119 
121  void CollectMobCensus(cMobCensus & toFill);
122 
124  void SpawnMobs(cMobSpawner & a_MobSpawner);
125 
126  void Tick(std::chrono::milliseconds a_Dt);
127 
129  void TickBlock(const Vector3i a_RelPos);
130 
131  int GetPosX(void) const { return m_PosX; }
132  int GetPosZ(void) const { return m_PosZ; }
133  cChunkCoords GetPos() const { return {m_PosX, m_PosZ}; }
134 
135  cWorld * GetWorld(void) const { return m_World; }
136 
137  void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
138  // SetBlock() does a lot of work (heightmap, tickblocks, blockentities) so a BlockIdx version doesn't make sense
139 
140  void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta); // Doesn't force block updates on neighbors, use for simple changes such as grass growing etc.
141  void FastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta)
142  {
143  FastSetBlock(a_RelPos.x, a_RelPos.y, a_RelPos.z, a_BlockType, a_BlockMeta);
144  }
145 
146  BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const { return m_BlockData.GetBlock({ a_RelX, a_RelY, a_RelZ }); }
147  BLOCKTYPE GetBlock(Vector3i a_RelCoords) const { return m_BlockData.GetBlock(a_RelCoords); }
148 
149  void GetBlockTypeMeta(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const;
150  void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
151  {
152  GetBlockTypeMeta({ a_RelX, a_RelY, a_RelZ }, a_BlockType, a_BlockMeta);
153  }
154 
155  void GetBlockInfo(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight) const;
156 
165  bool GetChunkAndRelByAbsolute(const Vector3d & a_Position, cChunk ** a_Chunk, Vector3i & a_Rel);
166 
175  bool GetChunkAndRelByAbsolute(const Vector3i & a_Position, cChunk ** a_Chunk, Vector3i & a_Rel);
176 
179  cChunk * GetNeighborChunk(int a_BlockX, int a_BlockZ);
180 
183  cChunk * GetRelNeighborChunk(int a_RelX, int a_RelZ);
184 
189  cChunk * GetRelNeighborChunkAdjustCoords(Vector3i & a_RelPos) const;
190 
191  EMCSBiome GetBiomeAt(int a_RelX, int a_RelZ) const {return cChunkDef::GetBiome(m_BiomeMap, a_RelX, a_RelZ); }
192 
195  void SetBiomeAt(int a_RelX, int a_RelZ, EMCSBiome a_Biome);
196 
199  void SetAreaBiome(int a_MinRelX, int a_MaxRelX, int a_MinRelZ, int a_MaxRelZ, EMCSBiome a_Biome);
200 
201  int GetHeight( int a_X, int a_Z) const;
202 
204  bool IsWeatherSunnyAt(int a_RelX, int a_RelZ) const;
205 
207  bool IsWeatherWetAt(int a_RelX, int a_RelZ) const;
208 
211  bool IsWeatherWetAt(Vector3i a_Position) const;
212 
213  void SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle * a_Client);
214 
216  bool AddClient(cClientHandle * a_Client);
217 
219  void RemoveClient(cClientHandle * a_Client);
220 
222  bool HasClient(cClientHandle * a_Client);
223 
225  bool HasAnyClients(void) const;
226 
227  void AddEntity(OwnedEntity a_Entity);
228 
231  OwnedEntity RemoveEntity(cEntity & a_Entity);
232 
233  bool HasEntity(UInt32 a_EntityID) const;
234 
236  bool ForEachEntity(cEntityCallback a_Callback) const; // Lua-accessible
237 
240  bool ForEachEntityInBox(const cBoundingBox & a_Box, cEntityCallback a_Callback) const; // Lua-accessible
241 
243  bool DoWithEntityByID(UInt32 a_EntityID, cEntityCallback a_Callback, bool & a_CallbackResult) const; // Lua-accessible
244 
246  bool ForEachBlockEntity(cBlockEntityCallback a_Callback); // Lua-accessible
247 
249  bool DoWithBlockEntityAt(Vector3i a_Position, cBlockEntityCallback a_Callback); // Lua-acessible
250 
253  bool UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z); // [x, y, z] in world block coords
254 
255  void SendBlockEntity (int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle & a_Client);
256 
258  {
259  return PositionToWorldPosition(a_RelPos.x, a_RelPos.y, a_RelPos.z);
260  }
261 
262  void PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ, int & a_BlockX, int & a_BlockY, int & a_BlockZ);
263  Vector3i PositionToWorldPosition(int a_RelX, int a_RelY, int a_RelZ);
264 
265  inline void MarkDirty(void)
266  {
267  m_IsDirty = true;
268  m_IsSaving = false;
269  }
270 
274  inline void SetNextBlockToTick(const Vector3i a_RelPos)
275  {
276  m_BlockToTick = a_RelPos;
277  }
278 
279  inline NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
280  {
281  return m_BlockData.GetMeta({ a_RelX, a_RelY, a_RelZ });
282  }
283 
284  NIBBLETYPE GetMeta(Vector3i a_RelPos) const { return m_BlockData.GetMeta(a_RelPos); }
285 
286  void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)
287  {
288  SetMeta({ a_RelX, a_RelY, a_RelZ }, a_Meta);
289  }
290 
291  inline void SetMeta(Vector3i a_RelPos, NIBBLETYPE a_Meta)
292  {
293  m_BlockData.SetMeta(a_RelPos, a_Meta);
294  MarkDirty();
295  m_PendingSendBlocks.emplace_back(m_PosX, m_PosZ, a_RelPos.x, a_RelPos.y, a_RelPos.z, GetBlock(a_RelPos), a_Meta);
296  }
297 
299  NIBBLETYPE GetTimeAlteredLight(NIBBLETYPE a_Skylight) const;
300 
302  inline NIBBLETYPE GetBlockLight(Vector3i a_RelPos) const { return m_LightData.GetBlockLight(a_RelPos); }
303  inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const { return m_LightData.GetBlockLight({ a_RelX, a_RelY, a_RelZ }); }
304 
306  inline NIBBLETYPE GetSkyLight(Vector3i a_RelPos) const { return m_LightData.GetSkyLight(a_RelPos); }
307  inline NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const { return m_LightData.GetSkyLight({ a_RelX, a_RelY, a_RelZ }); }
308 
310  inline NIBBLETYPE GetSkyLightAltered(Vector3i a_RelPos) const { return GetTimeAlteredLight(m_LightData.GetSkyLight(a_RelPos)); }
311  inline NIBBLETYPE GetSkyLightAltered(int a_RelX, int a_RelY, int a_RelZ) const { return GetSkyLightAltered({ a_RelX, a_RelY, a_RelZ }); }
312 
315  bool UnboundedRelGetBlock(Vector3i a_RelCoords, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const;
316 
320  bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
321  {
322  return UnboundedRelGetBlock({a_RelX, a_RelY, a_RelZ}, a_BlockType, a_BlockMeta);
323  }
324 
327  bool UnboundedRelGetBlockType(Vector3i a_RelCoords, BLOCKTYPE & a_BlockType) const;
328 
332  bool UnboundedRelGetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType) const
333  {
334  return UnboundedRelGetBlockType({a_RelX, a_RelY, a_RelZ}, a_BlockType);
335  }
336 
339  bool UnboundedRelGetBlockMeta(Vector3i a_RelPos, NIBBLETYPE & a_BlockMeta) const;
340 
344  bool UnboundedRelGetBlockMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockMeta) const
345  {
346  return UnboundedRelGetBlockMeta({a_RelX, a_RelY, a_RelZ}, a_BlockMeta);
347  }
348 
351  bool UnboundedRelGetBlockBlockLight(Vector3i a_RelPos, NIBBLETYPE & a_BlockLight) const;
352 
356  bool UnboundedRelGetBlockBlockLight(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockLight) const
357  {
358  return UnboundedRelGetBlockBlockLight({a_RelX, a_RelY, a_RelZ}, a_BlockLight);
359  }
360 
363  bool UnboundedRelGetBlockSkyLight(Vector3i a_RelPos, NIBBLETYPE & a_SkyLight) const;
364 
368  bool UnboundedRelGetBlockSkyLight(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_SkyLight) const
369  {
370  return UnboundedRelGetBlockSkyLight({a_RelX, a_RelY, a_RelZ}, a_SkyLight);
371  }
372 
375  bool UnboundedRelGetBlockLights(Vector3i a_RelPos, NIBBLETYPE & a_BlockLight, NIBBLETYPE & a_SkyLight) const;
376 
380  bool UnboundedRelGetBlockLights(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE & a_BlockLight, NIBBLETYPE & a_SkyLight) const
381  {
382  return UnboundedRelGetBlockLights({a_RelX, a_RelY, a_RelZ}, a_BlockLight, a_SkyLight);
383  }
384 
387  bool UnboundedRelSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
388 
392  bool UnboundedRelSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
393  {
394  return UnboundedRelSetBlock({a_RelX, a_RelY, a_RelZ}, a_BlockType, a_BlockMeta);
395  }
396 
399  bool UnboundedRelFastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta);
400 
404  bool UnboundedRelFastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
405  {
406  return UnboundedRelFastSetBlock({a_RelX, a_RelY, a_RelZ}, a_BlockType, a_BlockMeta);
407  }
408 
409 
410 
411  // Per-chunk simulator data:
417 
421 
425  cBlockEntity * GetBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ) { return GetBlockEntity({a_BlockX, a_BlockY, a_BlockZ}); }
426 
431 
434  bool ShouldBeTicked(void) const;
435 
441  void SetAlwaysTicked(bool a_AlwaysTicked);
442 
443  const auto & GetAllClients(void) const
444  {
445  return m_LoadedByClient;
446  }
447 
450  Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition) const
451  {
452  return cChunkDef::RelativeToAbsolute(a_RelBlockPosition, {m_PosX, m_PosZ});
453  }
454 
455 
456 private:
457 
458  friend class cChunkMap;
459 
461  {
467 
468  sSetBlockQueueItem(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick, BLOCKTYPE a_PreviousBlockType) :
469  m_Tick(a_Tick), m_RelX(a_RelX), m_RelY(a_RelY), m_RelZ(a_RelZ), m_BlockType(a_BlockType), m_BlockMeta(a_BlockMeta), m_PreviousType(a_PreviousBlockType)
470  {
471  }
472  } ;
473 
474  typedef std::vector<sSetBlockQueueItem> sSetBlockQueueVector;
475 
476 
479 
480  bool m_IsLightValid; // True if the blocklight and skylight are calculated
481  bool m_IsDirty; // True if the chunk has changed since it was last saved
482  bool m_IsSaving; // True if the chunk is being saved
483 
488 
492  std::vector<cBlockEntity *> m_PendingSendBlockEntities;
493 
496  std::queue<Vector3i> m_BlocksToCheck;
497 
498  // A critical section is not needed, because all chunk access is protected by its parent ChunkMap's csLayers
499  std::vector<cClientHandle *> m_LoadedByClient;
500  std::vector<OwnedEntity> m_Entities;
502 
504  unsigned m_StayCount;
505 
509 
512 
515 
519 
520  cChunk * m_NeighborXM; // Neighbor at [X - 1, Z]
521  cChunk * m_NeighborXP; // Neighbor at [X + 1, Z]
522  cChunk * m_NeighborZM; // Neighbor at [X, Z - 1]
523  cChunk * m_NeighborZP; // Neighbor at [X, Z + 1]
524 
525  // Per-chunk simulator data:
531 
535  unsigned m_AlwaysTicked;
536 
537  // Pick up a random block of this chunk
538  void GetRandomBlockCoords(int & a_X, int & a_Y, int & a_Z);
539  void GetThreeRandomNumbers(int & a_X, int & a_Y, int & a_Z, int a_MaxX, int a_MaxY, int a_MaxZ);
540 
542  void AddBlockEntity(OwnedBlockEntity a_BlockEntity);
543 
545  void WakeUpSimulators(void);
546 
548  void CheckBlocks();
549 
551  void TickBlocks(void);
552 
554  void ApplyWeatherToTop(void);
555 
558  cItems PickupsFromBlock(Vector3i a_RelPos, const cEntity * a_Digger, const cItem * a_Tool);
559 
563  int GrowPlantAt(Vector3i a_RelPos, int a_NumStages = 1);
564 
566  void MoveEntityToNewChunk(OwnedEntity a_Entity);
567 
569  bool HasPlayerEntities() const;
570 };
cChunk::MarkDirty
void MarkDirty(void)
Definition: Chunk.h:265
cChunk::GetLavaSimulatorData
cFluidSimulatorData * GetLavaSimulatorData(void) const
Definition: Chunk.h:414
cChunk::GetRandomBlockCoords
void GetRandomBlockCoords(int &a_X, int &a_Y, int &a_Z)
Definition: Chunk.cpp:598
cClientHandle
Definition: ClientHandle.h:49
cChunk::GetPosX
int GetPosX(void) const
Definition: Chunk.h:131
cChunk::sSetBlockQueueItem
Definition: Chunk.h:460
cChunk::UnboundedRelGetBlockSkyLight
bool UnboundedRelGetBlockSkyLight(Vector3i a_RelPos, NIBBLETYPE &a_SkyLight) const
Same as GetBlockSkyLight(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_Chun...
Definition: Chunk.cpp:1107
cChunk::GetBlockTypeMeta
void GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Definition: Chunk.h:150
cChunk::SetMeta
void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta)
Definition: Chunk.h:286
cChunk::cpQueued
@ cpQueued
The chunk is not present, but is queued for loading / generation.
Definition: Chunk.h:43
cChunk::AddClient
bool AddClient(cClientHandle *a_Client)
Adds a client to the chunk; returns true if added, false if already there.
Definition: Chunk.cpp:1535
cChunk::m_Entities
std::vector< OwnedEntity > m_Entities
Definition: Chunk.h:500
cChunk::sSetBlockQueueItem::m_PreviousType
BLOCKTYPE m_PreviousType
Definition: Chunk.h:466
SandSimulator.h
Vector3::x
T x
Definition: Vector3.h:17
sSetBlockVector
std::vector< sSetBlock > sSetBlockVector
Definition: ChunkDef.h:424
cChunk::UnboundedRelFastSetBlock
bool UnboundedRelFastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:404
cChunk::ForEachEntity
bool ForEachEntity(cEntityCallback a_Callback) const
Calls the callback for each entity; returns true if all entities processed, false if the callback abo...
Definition: Chunk.cpp:1672
cChunk::AddEntity
void AddEntity(OwnedEntity a_Entity)
Definition: Chunk.cpp:1597
cChunk::SetBiomeAt
void SetBiomeAt(int a_RelX, int a_RelZ, EMCSBiome a_Biome)
Sets the biome at the specified relative coords.
Definition: Chunk.cpp:1503
cChunk::BroadcastPendingChanges
void BroadcastPendingChanges(void)
Flushes the pending block (entity) queue, and clients' outgoing data buffers.
Definition: Chunk.cpp:120
ChunkLightData::GetSkyLight
NIBBLETYPE GetSkyLight(Vector3i a_Position) const
Definition: ChunkData.h:120
cChunk::IsWeatherWetAt
bool IsWeatherWetAt(int a_RelX, int a_RelZ) const
Returns true if it is raining or storming at the specified location, taking into account biomes.
Definition: Chunk.cpp:1211
cChunk::m_BiomeMap
cChunkDef::BiomeMap m_BiomeMap
Definition: Chunk.h:514
cChunk::GetChunkAndRelByAbsolute
bool GetChunkAndRelByAbsolute(const Vector3d &a_Position, cChunk **a_Chunk, Vector3i &a_Rel)
Convert absolute coordinates into relative coordinates.
Definition: Chunk.cpp:1794
cChunk::UnboundedRelGetBlockMeta
bool UnboundedRelGetBlockMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE &a_BlockMeta) const
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:344
cChunk::m_Presence
ePresence m_Presence
Holds the presence status of the chunk - if it is present, or in the loader / generator queue,...
Definition: Chunk.h:478
cChunk::UnboundedRelGetBlockLights
bool UnboundedRelGetBlockLights(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE &a_BlockLight, NIBBLETYPE &a_SkyLight) const
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:380
cChunk::CanUnloadAfterSaving
bool CanUnloadAfterSaving(void) const
Returns true if the chunk could have been unloaded if it weren't dirty.
Definition: Chunk.cpp:221
cChunk::sSetBlockQueueItem::m_RelX
int m_RelX
Definition: Chunk.h:463
cChunk::GetFireSimulatorData
cFireSimulatorChunkData & GetFireSimulatorData(void)
Definition: Chunk.h:412
cChunk::sSetBlockQueueItem::m_Tick
Int64 m_Tick
Definition: Chunk.h:462
cChunk::m_IsSaving
bool m_IsSaving
Definition: Chunk.h:482
cChunk::UnboundedRelSetBlock
bool UnboundedRelSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Same as SetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in ...
Definition: Chunk.cpp:1150
cChunk::GrowPlantAt
int GrowPlantAt(Vector3i a_RelPos, int a_NumStages=1)
Grows the plant at the specified position by at most a_NumStages.
Definition: Chunk.cpp:1014
cChunk::sSetBlockQueueVector
std::vector< sSetBlockQueueItem > sSetBlockQueueVector
Definition: Chunk.h:474
cChunk::m_IsDirty
bool m_IsDirty
Definition: Chunk.h:481
cBoundingBox
Represents two sets of coords, minimum and maximum for each direction.
Definition: BoundingBox.h:23
cChunkDef::BiomeMap
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
Definition: ChunkDef.h:120
cFireSimulatorChunkData
cCoordWithIntList cFireSimulatorChunkData
Stores individual fire blocks in the chunk; the int data is used as the time [msec] the fire takes to...
Definition: FireSimulator.h:69
cChunk::m_NeighborXM
cChunk * m_NeighborXM
Definition: Chunk.h:520
OwnedEntity
std::unique_ptr< cEntity > OwnedEntity
Definition: ChunkDef.h:32
cChunk::RemoveClient
void RemoveClient(cClientHandle *a_Client)
Removes the specified client from the chunk; ignored if client not in chunk.
Definition: Chunk.cpp:1551
cChunk::UnboundedRelGetBlockType
bool UnboundedRelGetBlockType(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE &a_BlockType) const
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:332
cChunk::Stay
void Stay(bool a_Stay=true)
Sets or resets the internal flag that prevents chunk from being unloaded.
Definition: Chunk.cpp:529
cChunk::UnboundedRelGetBlockBlockLight
bool UnboundedRelGetBlockBlockLight(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE &a_BlockLight) const
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:356
cChunk::GetBlockEntityRel
cBlockEntity * GetBlockEntityRel(Vector3i a_RelPos)
Returns the block entity at the specified (relative) coords.
Definition: Chunk.cpp:1451
cChunk::HasPlayerEntities
bool HasPlayerEntities() const
Check m_Entities for cPlayer objects.
Definition: Chunk.cpp:192
cChunk::sSetBlockQueueItem::m_RelY
int m_RelY
Definition: Chunk.h:463
cChunk::GetPos
cChunkCoords GetPos() const
Definition: Chunk.h:133
cMobCensus
This class is used to collect information, for each Mob, what is the distance of the closest player i...
Definition: MobCensus.h:25
cChunk::SetLight
void SetLight(const cChunkDef::BlockNibbles &a_BlockLight, const cChunkDef::BlockNibbles &a_SkyLight)
Definition: Chunk.cpp:402
cChunk::HasEntity
bool HasEntity(UInt32 a_EntityID) const
Definition: Chunk.cpp:1656
cChunk::ForEachBlockEntity
bool ForEachBlockEntity(cBlockEntityCallback a_Callback)
Calls the callback for each block entity; returns true if all block entities processed,...
Definition: Chunk.cpp:1733
cChunk::HasClient
bool HasClient(cClientHandle *a_Client)
Returns true if the specified client is present in this chunk.
Definition: Chunk.cpp:1579
cChunk::m_PosZ
int m_PosZ
Definition: Chunk.h:506
cChunk::cChunk
cChunk(int a_ChunkX, int a_ChunkZ, cChunkMap *a_ChunkMap, cWorld *a_World)
Definition: Chunk.cpp:41
UInt32
unsigned int UInt32
Definition: Globals.h:154
cChunk::GetBlockInfo
void GetBlockInfo(Vector3i a_RelPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_Meta, NIBBLETYPE &a_SkyLight, NIBBLETYPE &a_BlockLight) const
Definition: Chunk.cpp:1782
cChunk::m_BlocksToCheck
std::queue< Vector3i > m_BlocksToCheck
A queue of relative positions to call cBlockHandler::Check on.
Definition: Chunk.h:496
cChunk::SendBlockTo
void SendBlockTo(int a_RelX, int a_RelY, int a_RelZ, cClientHandle *a_Client)
Definition: Chunk.cpp:1388
cChunk::UnboundedRelGetBlockMeta
bool UnboundedRelGetBlockMeta(Vector3i a_RelPos, NIBBLETYPE &a_BlockMeta) const
Same as GetBlockMeta(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap...
Definition: Chunk.cpp:1065
cChunk::ApplyWeatherToTop
void ApplyWeatherToTop(void)
Adds snow to the top of snowy biomes and hydrates farmland / fills cauldrons in rainy biomes.
Definition: Chunk.cpp:886
cChunk::UseBlockEntity
bool UseBlockEntity(cPlayer *a_Player, int a_X, int a_Y, int a_Z)
Use block entity on coordinate.
Definition: Chunk.cpp:1489
cChunk::MoveEntityToNewChunk
void MoveEntityToNewChunk(OwnedEntity a_Entity)
Called by Tick() when an entity moves out of this chunk into a neighbor; moves the entity and sends s...
Definition: Chunk.cpp:783
cChunk::MarkLoaded
void MarkLoaded(void)
Definition: Chunk.cpp:282
cChunk::UnboundedRelGetBlockBlockLight
bool UnboundedRelGetBlockBlockLight(Vector3i a_RelPos, NIBBLETYPE &a_BlockLight) const
Same as GetBlockBlockLight(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_Ch...
Definition: Chunk.cpp:1086
cChunk::m_PendingSendBlockEntities
std::vector< cBlockEntity * > m_PendingSendBlockEntities
Block entities that have been touched and need to be sent to all clients.
Definition: Chunk.h:492
NIBBLETYPE
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
cChunk::GetNeighborChunk
cChunk * GetNeighborChunk(int a_BlockX, int a_BlockZ)
Returns the chunk into which the specified block belongs, by walking the neighbors.
Definition: Chunk.cpp:1821
cChunk::GetSkyLight
NIBBLETYPE GetSkyLight(int a_RelX, int a_RelY, int a_RelZ) const
Definition: Chunk.h:307
cChunk::m_LightData
ChunkLightData m_LightData
Definition: Chunk.h:511
Vector3::z
T z
Definition: Vector3.h:17
cBlockArea
Definition: BlockArea.h:37
cChunk::ShouldBeTicked
bool ShouldBeTicked(void) const
Returns true if the chunk should be ticked in the tick-thread.
Definition: Chunk.cpp:1462
cChunk::UnboundedRelGetBlockType
bool UnboundedRelGetBlockType(Vector3i a_RelCoords, BLOCKTYPE &a_BlockType) const
Same as GetBlockType(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap...
Definition: Chunk.cpp:1044
cChunk::MarkSaving
void MarkSaving(void)
Definition: Chunk.cpp:260
cChunk::IsQueued
bool IsQueued(void) const
Returns true iff the chunk is in the queue for loading / generating.
Definition: Chunk.h:61
cChunk::cpInvalid
@ cpInvalid
The chunk is not present at all and is not queued in the loader / generator.
Definition: Chunk.h:42
cChunk::m_PosX
int m_PosX
Definition: Chunk.h:506
cChunk::GetSkyLightAltered
NIBBLETYPE GetSkyLightAltered(Vector3i a_RelPos) const
Get the level of sky light illuminating the block (0 - 15), taking daytime into a account.
Definition: Chunk.h:310
cChunk::DoWithBlockEntityAt
bool DoWithBlockEntityAt(Vector3i a_Position, cBlockEntityCallback a_Callback)
Calls the callback for the block entity at the specified coords; returns false if there's no block en...
Definition: Chunk.cpp:1752
cChunk::GetThreeRandomNumbers
void GetThreeRandomNumbers(int &a_X, int &a_Y, int &a_Z, int a_MaxX, int a_MaxY, int a_MaxZ)
Definition: Chunk.cpp:577
cChunk::m_NeighborXP
cChunk * m_NeighborXP
Definition: Chunk.h:521
cChunk::FastSetBlock
void FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta)
Definition: Chunk.cpp:1311
cChunk::ePresence
ePresence
Represents the presence state of the chunk.
Definition: Chunk.h:40
ChunkLightData::GetBlockLight
NIBBLETYPE GetBlockLight(Vector3i a_Position) const
Definition: ChunkData.h:119
cChunk::WakeUpSimulators
void WakeUpSimulators(void)
Wakes up each simulator for its specific blocks; through all the blocks in the chunk.
Definition: Chunk.cpp:1248
cChunk::OnUnload
void OnUnload()
Called when the chunkmap unloads unused chunks.
Definition: Chunk.cpp:235
cChunk::m_AlwaysTicked
unsigned m_AlwaysTicked
If greater than zero, the chunk is ticked even if it has no clients.
Definition: Chunk.h:535
cChunk::GetHeight
int GetHeight(int a_X, int a_Z) const
Definition: Chunk.cpp:1192
cWorld
Definition: World.h:47
cChunk::sSetBlockQueueItem::m_BlockType
BLOCKTYPE m_BlockType
Definition: Chunk.h:464
cChunk::m_ChunkMap
cChunkMap * m_ChunkMap
Definition: Chunk.h:508
cChunk::MarkRegenerating
void MarkRegenerating(void)
Marks all clients attached to this chunk as wanting this chunk.
Definition: Chunk.cpp:176
cChunk::GetWaterSimulatorData
cFluidSimulatorData * GetWaterSimulatorData(void) const
Definition: Chunk.h:413
cChunk::AddBlockEntity
void AddBlockEntity(OwnedBlockEntity a_BlockEntity)
Takes ownership of a block entity, which MUST actually reside in this chunk.
Definition: Chunk.cpp:1417
cSandSimulatorChunkData
cCoordWithIntList cSandSimulatorChunkData
Per-chunk data for the simulator, specified individual chunks to simulate; Data is not used.
Definition: SandSimulator.h:12
cChunk::m_RedstoneSimulatorData
cRedstoneSimulatorChunkData * m_RedstoneSimulatorData
Definition: Chunk.h:530
ChunkBlockData::SetMeta
void SetMeta(Vector3i a_Position, NIBBLETYPE a_Meta)
Definition: ChunkData.h:87
cChunk::GetSandSimulatorData
cSandSimulatorChunkData & GetSandSimulatorData(void)
Definition: Chunk.h:415
cChunk::CheckBlocks
void CheckBlocks()
Checks the block scheduled for checking in m_ToTickBlocks[].
Definition: Chunk.cpp:827
cChunk::SetAllData
void SetAllData(SetChunkData &&a_SetChunkData)
Sets all chunk data as either loaded from the storage or generated.
Definition: Chunk.cpp:331
ChunkBlockData::GetBlock
BLOCKTYPE GetBlock(Vector3i a_Position) const
Definition: ChunkData.h:80
cChunk::SetBlock
void SetBlock(Vector3i a_RelBlockPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Definition: Chunk.cpp:1278
cChunk::GetBlock
BLOCKTYPE GetBlock(Vector3i a_RelCoords) const
Definition: Chunk.h:147
cChunk::UnboundedRelGetBlockLights
bool UnboundedRelGetBlockLights(Vector3i a_RelPos, NIBBLETYPE &a_BlockLight, NIBBLETYPE &a_SkyLight) const
Queries both BlockLight and SkyLight, relative coords needn't be in this chunk (uses m_Neighbor-s or ...
Definition: Chunk.cpp:1128
cChunk::GetSkyLightAltered
NIBBLETYPE GetSkyLightAltered(int a_RelX, int a_RelY, int a_RelZ) const
Definition: Chunk.h:311
cChunk::SetAreaBiome
void SetAreaBiome(int a_MinRelX, int a_MaxRelX, int a_MinRelZ, int a_MaxRelZ, EMCSBiome a_Biome)
Sets the biome in the specified relative coords area.
Definition: Chunk.cpp:1513
cItem
Definition: Item.h:36
cChunk::DoWithEntityByID
bool DoWithEntityByID(UInt32 a_EntityID, cEntityCallback a_Callback, bool &a_CallbackResult) const
Calls the callback if the entity with the specified ID is found, with the entity object as the callba...
Definition: Chunk.cpp:1715
cChunk::MarkSaved
void MarkSaved(void)
Definition: Chunk.cpp:269
cChunk::UnboundedRelGetBlock
bool UnboundedRelGetBlock(Vector3i a_RelCoords, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in ...
Definition: Chunk.cpp:1023
cChunk::GetBlockTypeMeta
void GetBlockTypeMeta(Vector3i a_RelPos, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
Definition: Chunk.cpp:1772
SetChunkData
Definition: SetChunkData.h:15
cChunk::GetRedstoneSimulatorData
cRedstoneSimulatorChunkData * GetRedstoneSimulatorData(void) const
Definition: Chunk.h:416
cFluidSimulatorData
This is a base class for all fluid simulator data classes.
Definition: FluidSimulator.h:27
cChunk::m_FireSimulatorData
cFireSimulatorChunkData m_FireSimulatorData
Definition: Chunk.h:526
EMCSBiome
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
Definition: BiomeDef.h:17
cChunk::m_SandSimulatorData
cSandSimulatorChunkData m_SandSimulatorData
Definition: Chunk.h:529
OwnedBlockEntity
std::unique_ptr< cBlockEntity > OwnedBlockEntity
Definition: BlockEntity.h:16
cChunk::sSetBlockQueueItem::m_BlockMeta
NIBBLETYPE m_BlockMeta
Definition: Chunk.h:465
cChunk::GetTimeAlteredLight
NIBBLETYPE GetTimeAlteredLight(NIBBLETYPE a_Skylight) const
Light alterations based on time.
Definition: Chunk.cpp:1992
cRedstoneSimulatorChunkData
Definition: RedstoneSimulator.h:10
FireSimulator.h
cBlockEntities
std::unordered_map< size_t, OwnedBlockEntity > cBlockEntities
Definition: BlockEntity.h:17
cItems
This class bridges a vector of cItem for safe access via Lua.
Definition: Item.h:213
cChunkDef::HeightMap
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
Definition: ChunkDef.h:115
cChunk::GetPosZ
int GetPosZ(void) const
Definition: Chunk.h:132
cChunk::PositionToWorldPosition
Vector3i PositionToWorldPosition(Vector3i a_RelPos)
Definition: Chunk.h:257
BlockEntity.h
ChunkLightData
Definition: ChunkData.h:97
BLOCKTYPE
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
cChunk::m_World
cWorld * m_World
Definition: Chunk.h:507
cChunk::m_WaterSimulatorData
cFluidSimulatorData * m_WaterSimulatorData
Definition: Chunk.h:527
cChunk::UnboundedRelFastSetBlock
bool UnboundedRelFastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
Same as FastSetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap...
Definition: Chunk.cpp:1171
cChunk::GetBlockLight
NIBBLETYPE GetBlockLight(Vector3i a_RelPos) const
Get the level of artificial light illuminating the block (0 - 15)
Definition: Chunk.h:302
cChunk::UnboundedRelGetBlock
bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE &a_BlockType, NIBBLETYPE &a_BlockMeta) const
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:320
cChunk::IsWeatherSunnyAt
bool IsWeatherSunnyAt(int a_RelX, int a_RelZ) const
Returns true if it is sunny at the specified location.
Definition: Chunk.cpp:1202
cChunk::m_NeighborZP
cChunk * m_NeighborZP
Definition: Chunk.h:523
ChunkData.h
cChunk::m_LoadedByClient
std::vector< cClientHandle * > m_LoadedByClient
Definition: Chunk.h:499
cChunk::PickupsFromBlock
cItems PickupsFromBlock(Vector3i a_RelPos, const cEntity *a_Digger, const cItem *a_Tool)
Returns the pickups that would be produced, if the specified block was dug up by a_Digger using a_Too...
Definition: Chunk.cpp:979
cChunk::GetRelNeighborChunk
cChunk * GetRelNeighborChunk(int a_RelX, int a_RelZ)
Returns the chunk into which the relatively-specified block belongs, by walking the neighbors.
Definition: Chunk.cpp:1833
cChunk::GetBlockLight
NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const
Definition: Chunk.h:303
cChunk::m_BlockData
ChunkBlockData m_BlockData
Definition: Chunk.h:510
cChunk::MarkLoadFailed
void MarkLoadFailed(void)
Queues the chunk for generating.
Definition: Chunk.cpp:292
cChunk::sSetBlockQueueItem::m_RelZ
int m_RelZ
Definition: Chunk.h:463
cChunk::GetAllClients
const auto & GetAllClients(void) const
Definition: Chunk.h:443
Int64
signed long long Int64
Definition: Globals.h:148
cChunk::HasAnyClients
bool HasAnyClients(void) const
Returns true if theres any client in the chunk; false otherwise.
Definition: Chunk.cpp:1588
cChunk::CanUnload
bool CanUnload(void) const
Definition: Chunk.cpp:207
cChunk
Definition: Chunk.h:35
cChunk::SetNextBlockToTick
void SetNextBlockToTick(const Vector3i a_RelPos)
Causes the specified block to be ticked on the next Tick() call.
Definition: Chunk.h:274
cChunk::sSetBlockQueueItem::sSetBlockQueueItem
sSetBlockQueueItem(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, Int64 a_Tick, BLOCKTYPE a_PreviousBlockType)
Definition: Chunk.h:468
cChunk::UnboundedRelGetBlockSkyLight
bool UnboundedRelGetBlockSkyLight(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE &a_SkyLight) const
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:368
cChunk::m_PendingSendBlocks
sSetBlockVector m_PendingSendBlocks
Blocks that have changed and need to be sent to all clients.
Definition: Chunk.h:487
cEntity
Definition: Entity.h:75
cChunkCoords
Definition: ChunkDef.h:55
cChunk::GetSkyLight
NIBBLETYPE GetSkyLight(Vector3i a_RelPos) const
Get the level of sky light illuminating the block (0 - 15) independent of daytime.
Definition: Chunk.h:306
cPlayer
Definition: Player.h:27
cChunk::FastSetBlock
void FastSetBlock(Vector3i a_RelPos, BLOCKTYPE a_BlockType, BLOCKTYPE a_BlockMeta)
Definition: Chunk.h:141
cChunk::RemoveEntity
OwnedEntity RemoveEntity(cEntity &a_Entity)
Releases ownership of the given entity if it was found in this chunk.
Definition: Chunk.cpp:1617
cChunk::m_IsLightValid
bool m_IsLightValid
Definition: Chunk.h:480
ChunkBlockData
Definition: ChunkData.h:55
cChunk::m_BlockEntities
cBlockEntities m_BlockEntities
Definition: Chunk.h:501
cMobSpawner
This class is used to determine which monster can be spawned in which place it is essentially static ...
Definition: MobSpawner.h:15
cChunk::SpawnMobs
void SpawnMobs(cMobSpawner &a_MobSpawner)
Try to Spawn Monsters inside chunk.
Definition: Chunk.cpp:611
cChunk::GetMeta
NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const
Definition: Chunk.h:279
cChunk::RelativeToAbsolute
Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition) const
Converts the coord relative to this chunk into an absolute coord.
Definition: Chunk.h:450
Vector3::y
T y
Definition: Vector3.h:17
cChunk::m_BlockToTick
Vector3i m_BlockToTick
Relative coords of the block to tick first in the next Tick() call.
Definition: Chunk.h:518
ChunkBlockData::GetMeta
NIBBLETYPE GetMeta(Vector3i a_Position) const
Definition: ChunkData.h:81
cChunk::m_HeightMap
cChunkDef::HeightMap m_HeightMap
Definition: Chunk.h:513
cChunk::SetPresence
void SetPresence(ePresence a_Presence)
Sets the chunk's presence.
Definition: Chunk.cpp:163
cChunk::IsLightValid
bool IsLightValid(void) const
Definition: Chunk.h:83
cChunk::~cChunk
~cChunk()
Definition: Chunk.cpp:86
cChunkMap
Definition: ChunkMap.h:37
cChunkDef::BlockNibbles
NIBBLETYPE BlockNibbles[NumBlocks/2]
The type used for block data in nibble format, AXIS_ORDER ordering.
Definition: ChunkDef.h:126
cChunk::m_NeighborZM
cChunk * m_NeighborZM
Definition: Chunk.h:522
cFunctionRef
Definition: FunctionRef.h:6
cChunkDef::RelativeToAbsolute
static Vector3i RelativeToAbsolute(Vector3i a_RelBlockPosition, cChunkCoords a_ChunkCoords)
Converts relative block coordinates into absolute coordinates with a known chunk location.
Definition: ChunkDef.h:157
cChunk::TickBlocks
void TickBlocks(void)
Ticks several random blocks in the chunk.
Definition: Chunk.cpp:849
cChunk::cpPresent
@ cpPresent
The chunk is present.
Definition: Chunk.h:44
cChunk::GetBiomeAt
EMCSBiome GetBiomeAt(int a_RelX, int a_RelZ) const
Definition: Chunk.h:191
cChunk::GetBlockEntity
cBlockEntity * GetBlockEntity(Vector3i a_AbsPos)
Returns the block entity at the specified (absolute) coords.
Definition: Chunk.cpp:1433
Vector3
Definition: Vector3.h:10
cChunk::WriteBlockArea
void WriteBlockArea(cBlockArea &a_Area, int a_MinBlockX, int a_MinBlockY, int a_MinBlockZ, int a_DataTypes)
Writes the specified cBlockArea at the coords specified.
Definition: Chunk.cpp:420
cChunk::GetBlock
BLOCKTYPE GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
Definition: Chunk.h:146
cChunk::SendBlockEntity
void SendBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ, cClientHandle &a_Client)
Definition: Chunk.cpp:1958
cChunk::GetMeta
NIBBLETYPE GetMeta(Vector3i a_RelPos) const
Definition: Chunk.h:284
cChunk::GetAllData
void GetAllData(cChunkDataCallback &a_Callback) const
Gets all chunk data, calls the a_Callback's methods for each data type.
Definition: Chunk.cpp:307
cChunk::TickBlock
void TickBlock(const Vector3i a_RelPos)
Ticks a single block.
Definition: Chunk.cpp:772
cChunk::m_StayCount
unsigned m_StayCount
Number of times the chunk has been requested to stay (by various cChunkStay objects); if zero,...
Definition: Chunk.h:504
cChunk::GetRelNeighborChunkAdjustCoords
cChunk * GetRelNeighborChunkAdjustCoords(Vector3i &a_RelPos) const
Returns the chunk into which the relatively-specified block belongs.
Definition: Chunk.cpp:1900
cChunkDef::GetBiome
static EMCSBiome GetBiome(const BiomeMap &a_BiomeMap, int a_X, int a_Z)
Definition: ChunkDef.h:302
ChunkMap.h
cChunk::SetAlwaysTicked
void SetAlwaysTicked(bool a_AlwaysTicked)
Increments (a_AlwaysTicked == true) or decrements (false) the m_AlwaysTicked counter.
Definition: Chunk.cpp:1471
cChunk::Tick
void Tick(std::chrono::milliseconds a_Dt)
Definition: Chunk.cpp:685
cBlockEntity
Definition: BlockEntity.h:24
cChunk::IsDirty
bool IsDirty(void) const
Returns true iff the chunk has changed since it was last saved.
Definition: Chunk.h:71
cChunk::IsValid
bool IsValid(void) const
Returns true iff the chunk block data is valid (loaded / generated)
Definition: Chunk.h:58
cChunk::GetBlockEntity
cBlockEntity * GetBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ)
OBSOLETE, use the Vector3i-based overload instead.
Definition: Chunk.h:425
cChunk::UnboundedRelSetBlock
bool UnboundedRelSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
OBSOLETE, use the Vector3i-based overload.
Definition: Chunk.h:392
cChunk::CollectMobCensus
void CollectMobCensus(cMobCensus &toFill)
Recence all mobs proximities to players in order to know what to do with them.
Definition: Chunk.cpp:546
cChunk::ForEachEntityInBox
bool ForEachEntityInBox(const cBoundingBox &a_Box, cEntityCallback a_Callback) const
Calls the callback for each entity that has a nonempty intersection with the specified boundingbox.
Definition: Chunk.cpp:1689
cChunk::SetMeta
void SetMeta(Vector3i a_RelPos, NIBBLETYPE a_Meta)
Definition: Chunk.h:291
cChunk::m_LavaSimulatorData
cFluidSimulatorData * m_LavaSimulatorData
Definition: Chunk.h:528
cChunk::GetWorld
cWorld * GetWorld(void) const
Definition: Chunk.h:135