summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorpeterbell10 <peterbell10@live.co.uk>2018-02-04 23:15:31 +0100
committerGitHub <noreply@github.com>2018-02-04 23:15:31 +0100
commit2df14a04962037b93352c2fc53349af54ab3b14d (patch)
tree8fe7096d0c5dd492fc98e9534f9fcd53c41f767a /src/Chunk.cpp
parentOcelots don't take fall damage (#4171) (diff)
downloadcuberite-2df14a04962037b93352c2fc53349af54ab3b14d.tar
cuberite-2df14a04962037b93352c2fc53349af54ab3b14d.tar.gz
cuberite-2df14a04962037b93352c2fc53349af54ab3b14d.tar.bz2
cuberite-2df14a04962037b93352c2fc53349af54ab3b14d.tar.lz
cuberite-2df14a04962037b93352c2fc53349af54ab3b14d.tar.xz
cuberite-2df14a04962037b93352c2fc53349af54ab3b14d.tar.zst
cuberite-2df14a04962037b93352c2fc53349af54ab3b14d.zip
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r--src/Chunk.cpp31
1 files changed, 11 insertions, 20 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 8d88ed3a4..ff3ff7243 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -1659,7 +1659,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT
ASSERT(IsValid());
const BLOCKTYPE OldBlockType = GetBlock(a_RelX, a_RelY, a_RelZ);
- const BLOCKTYPE OldBlockMeta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ);
+ const BLOCKTYPE OldBlockMeta = m_ChunkData.GetMeta({ a_RelX, a_RelY, a_RelZ });
if ((OldBlockType == a_BlockType) && (OldBlockMeta == a_BlockMeta))
{
return;
@@ -1677,7 +1677,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT
MarkDirty();
}
- m_ChunkData.SetBlock(a_RelX, a_RelY, a_RelZ, a_BlockType);
+ m_ChunkData.SetBlock({ a_RelX, a_RelY, a_RelZ }, a_BlockType);
// Queue block to be sent only if ...
if (
@@ -1696,7 +1696,7 @@ void cChunk::FastSetBlock(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockT
m_PendingSendBlocks.push_back(sSetBlock(m_PosX, m_PosZ, a_RelX, a_RelY, a_RelZ, a_BlockType, a_BlockMeta));
}
- m_ChunkData.SetMeta(a_RelX, a_RelY, a_RelZ, a_BlockMeta);
+ m_ChunkData.SetMeta({ a_RelX, a_RelY, a_RelZ }, a_BlockMeta);
// ONLY recalculate lighting if it's necessary!
if (
@@ -2471,31 +2471,22 @@ bool cChunk::GetSignLines(int a_BlockX, int a_BlockY, int a_BlockZ, AString & a_
-BLOCKTYPE cChunk::GetBlock(int a_RelX, int a_RelY, int a_RelZ) const
+void cChunk::GetBlockTypeMeta(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
{
- return m_ChunkData.GetBlock(a_RelX, a_RelY, a_RelZ);
+ a_BlockType = GetBlock(a_RelPos);
+ a_BlockMeta = GetMeta(a_RelPos);
}
-void cChunk::GetBlockTypeMeta(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta) const
+void cChunk::GetBlockInfo(Vector3i a_RelPos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight)
{
- a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ);
- a_BlockMeta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ);
-}
-
-
-
-
-
-void cChunk::GetBlockInfo(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_Meta, NIBBLETYPE & a_SkyLight, NIBBLETYPE & a_BlockLight)
-{
- a_BlockType = GetBlock(a_RelX, a_RelY, a_RelZ);
- a_Meta = m_ChunkData.GetMeta(a_RelX, a_RelY, a_RelZ);
- a_SkyLight = m_ChunkData.GetSkyLight(a_RelX, a_RelY, a_RelZ);
- a_BlockLight = m_ChunkData.GetBlockLight(a_RelX, a_RelY, a_RelZ);
+ a_BlockType = GetBlock(a_RelPos);
+ a_Meta = m_ChunkData.GetMeta(a_RelPos);
+ a_SkyLight = m_ChunkData.GetSkyLight(a_RelPos);
+ a_BlockLight = m_ChunkData.GetBlockLight(a_RelPos);
}