summaryrefslogtreecommitdiffstats
path: root/src/Generating/ChunkDesc.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2019-09-01 09:30:00 +0200
committerMattes D <github@xoft.cz>2019-09-06 16:12:33 +0200
commita2ffa432b31096f2533ecb50f49ba450b29a2989 (patch)
tree5bdd754cad5e7b49e279ee0e21b9fa15c7c35d7b /src/Generating/ChunkDesc.cpp
parentUpdated LibEvent to release 2.1.11-stable. (#4383) (diff)
downloadcuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar
cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.gz
cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.bz2
cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.lz
cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.xz
cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.tar.zst
cuberite-a2ffa432b31096f2533ecb50f49ba450b29a2989.zip
Diffstat (limited to 'src/Generating/ChunkDesc.cpp')
-rw-r--r--src/Generating/ChunkDesc.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp
index e5d213fe6..18947f401 100644
--- a/src/Generating/ChunkDesc.cpp
+++ b/src/Generating/ChunkDesc.cpp
@@ -13,9 +13,8 @@
-cChunkDesc::cChunkDesc(int a_ChunkX, int a_ChunkZ) :
- m_ChunkX(a_ChunkX),
- m_ChunkZ(a_ChunkZ),
+cChunkDesc::cChunkDesc(cChunkCoords a_Coords) :
+ m_Coords(a_Coords),
m_bUseDefaultBiomes(true),
m_bUseDefaultHeight(true),
m_bUseDefaultComposition(true),
@@ -43,10 +42,9 @@ cChunkDesc::~cChunkDesc()
-void cChunkDesc::SetChunkCoords(int a_ChunkX, int a_ChunkZ)
+void cChunkDesc::SetChunkCoords(cChunkCoords a_Coords)
{
- m_ChunkX = a_ChunkX;
- m_ChunkZ = a_ChunkZ;
+ m_Coords = a_Coords;
}
@@ -369,9 +367,9 @@ void cChunkDesc::ReadBlockArea(cBlockArea & a_Dest, int a_MinRelX, int a_MaxRelX
int SizeY = a_MaxRelY - a_MinRelY;
int SizeZ = a_MaxRelZ - a_MinRelZ;
a_Dest.Clear();
- a_Dest.m_Origin.x = m_ChunkX * cChunkDef::Width + a_MinRelX;
+ a_Dest.m_Origin.x = m_Coords.m_ChunkX * cChunkDef::Width + a_MinRelX;
a_Dest.m_Origin.y = a_MinRelY;
- a_Dest.m_Origin.z = m_ChunkZ * cChunkDef::Width + a_MinRelZ;
+ a_Dest.m_Origin.z = m_Coords.m_ChunkZ * cChunkDef::Width + a_MinRelZ;
a_Dest.SetSize(SizeX, SizeY, SizeZ, cBlockArea::baTypes | cBlockArea::baMetas);
for (int y = 0; y < SizeY; y++)
@@ -593,8 +591,8 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
}
}
- int AbsX = a_RelX + m_ChunkX * cChunkDef::Width;
- int AbsZ = a_RelZ + m_ChunkZ * cChunkDef::Width;
+ int AbsX = a_RelX + m_Coords.m_ChunkX * cChunkDef::Width;
+ int AbsZ = a_RelZ + m_Coords.m_ChunkZ * cChunkDef::Width;
// The block entity is not created yet, try to create it and add to list:
cBlockEntity * be = cBlockEntity::CreateByBlockType(GetBlockType(a_RelX, a_RelY, a_RelZ), GetBlockMeta(a_RelX, a_RelY, a_RelZ), AbsX, a_RelY, AbsZ);