diff options
author | Tycho <work.tycho+git@gmail.com> | 2014-05-23 16:02:55 +0200 |
---|---|---|
committer | Tycho <work.tycho+git@gmail.com> | 2014-05-23 16:02:55 +0200 |
commit | 5a76eab4c0ff309886cb407ba6b9d84516db11ff (patch) | |
tree | 51997884fc6c7407b1737dee014f94cea977b57a /src/Chunk.h | |
parent | Added callback for stopping starvation mode (diff) | |
parent | Ignore CTest files (diff) | |
download | cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.tar cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.tar.gz cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.tar.bz2 cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.tar.lz cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.tar.xz cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.tar.zst cuberite-5a76eab4c0ff309886cb407ba6b9d84516db11ff.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Chunk.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/Chunk.h b/src/Chunk.h index 038be42de..2de45919e 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -3,7 +3,7 @@ #include "Entities/Entity.h" #include "ChunkDef.h" -#include "ChunkBuffer.h" +#include "ChunkData.h" #include "Simulator/FireSimulator.h" #include "Simulator/SandSimulator.h" @@ -324,21 +324,21 @@ public: inline NIBBLETYPE GetMeta(int a_RelX, int a_RelY, int a_RelZ) const { - return m_ChunkBuffer.GetMeta(a_RelX, a_RelY, a_RelZ); + return m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ); } inline void SetMeta(int a_RelX, int a_RelY, int a_RelZ, NIBBLETYPE a_Meta) { - if (!(GetMeta(a_RelX, a_RelY, a_RelZ) == a_Meta)) + bool hasChanged = m_ChunkData.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); + if (hasChanged) { MarkDirty(); - m_ChunkBuffer.SetMeta(a_RelX, a_RelY, a_RelZ, a_Meta); - + m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, GetBlock(a_RelX, a_RelY, a_RelZ), a_Meta)); } } - inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetBlockLight(a_RelX, a_RelY, a_RelZ); } - inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkBuffer.GetSkyLight(a_RelX, a_RelY, a_RelZ); } + inline NIBBLETYPE GetBlockLight(int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkData.GetBlockLight(a_RelX, a_RelY, a_RelZ); } + inline NIBBLETYPE GetSkyLight (int a_RelX, int a_RelY, int a_RelZ) const {return m_ChunkData.GetSkyLight(a_RelX, a_RelY, a_RelZ); } /** Same as GetBlock(), but relative coords needn't be in this chunk (uses m_Neighbor-s or m_ChunkMap in such a case); returns true on success */ bool UnboundedRelGetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const; @@ -430,7 +430,7 @@ private: cWorld * m_World; cChunkMap * m_ChunkMap; - cChunkBuffer m_ChunkBuffer; + cChunkData m_ChunkData; cChunkDef::HeightMap m_HeightMap; cChunkDef::BiomeMap m_BiomeMap; |