summaryrefslogtreecommitdiffstats
path: root/src/Generating
diff options
context:
space:
mode:
authorx12xx12x <44411062+12xx12@users.noreply.github.com>2024-11-10 00:07:11 +0100
committerGitHub <noreply@github.com>2024-11-10 00:07:11 +0100
commit44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26 (patch)
treed252e4cf7abc71dd860c118ba0aed33b806c4fe2 /src/Generating
parentfixes for api changes in embedtls (#5540) (diff)
downloadcuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.tar
cuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.tar.gz
cuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.tar.bz2
cuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.tar.lz
cuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.tar.xz
cuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.tar.zst
cuberite-44cb43f13cdd8f2b3efb9ae77daa3e994c62bc26.zip
Diffstat (limited to 'src/Generating')
-rw-r--r--src/Generating/ChunkDesc.cpp14
-rw-r--r--src/Generating/ChunkDesc.h4
-rw-r--r--src/Generating/MineShafts.cpp2
-rw-r--r--src/Generating/MineShafts.h2
4 files changed, 11 insertions, 11 deletions
diff --git a/src/Generating/ChunkDesc.cpp b/src/Generating/ChunkDesc.cpp
index b2a332489..397220f4f 100644
--- a/src/Generating/ChunkDesc.cpp
+++ b/src/Generating/ChunkDesc.cpp
@@ -573,12 +573,12 @@ void cChunkDesc::RandomFillRelCuboid(
cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
{
const auto Idx = cChunkDef::MakeIndex(a_RelX, a_RelY, a_RelZ);
- const auto itr = m_BlockEntities.find(Idx);
+ const auto Iterator = m_BlockArea.GetBlockEntities().find(Idx);
- if (itr != m_BlockEntities.end())
+ if (Iterator != m_BlockArea.GetBlockEntities().end())
{
// Already in the list:
- cBlockEntity * BlockEntity = itr->second.get();
+ cBlockEntity * BlockEntity = Iterator->second.get();
if (BlockEntity->GetBlockType() == GetBlockType(a_RelX, a_RelY, a_RelZ))
{
// Correct type, already present. Return it:
@@ -587,7 +587,7 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
else
{
// Wrong type, the block type has been overwritten. Erase and create new:
- m_BlockEntities.erase(itr);
+ m_BlockArea.GetBlockEntities().erase(Iterator);
}
}
@@ -595,13 +595,13 @@ cBlockEntity * cChunkDesc::GetBlockEntity(int a_RelX, int a_RelY, int a_RelZ)
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:
- auto be = cBlockEntity::CreateByBlockType(GetBlockType(a_RelX, a_RelY, a_RelZ), GetBlockMeta(a_RelX, a_RelY, a_RelZ), {AbsX, a_RelY, AbsZ});
- if (be == nullptr)
+ auto BlockEntity = cBlockEntity::CreateByBlockType(GetBlockType(a_RelX, a_RelY, a_RelZ), GetBlockMeta(a_RelX, a_RelY, a_RelZ), {AbsX, a_RelY, AbsZ});
+ if (BlockEntity == nullptr)
{
// No block entity for this block type
return nullptr;
}
- auto res = m_BlockEntities.emplace(Idx, std::move(be));
+ auto res = m_BlockArea.GetBlockEntities().emplace(Idx, std::move(BlockEntity));
return res.first->second.get();
}
diff --git a/src/Generating/ChunkDesc.h b/src/Generating/ChunkDesc.h
index d066660f1..519dbe81c 100644
--- a/src/Generating/ChunkDesc.h
+++ b/src/Generating/ChunkDesc.h
@@ -238,7 +238,8 @@ public:
inline BlockNibbleBytes & GetBlockMetasUncompressed(void) { return *(reinterpret_cast<BlockNibbleBytes *>(m_BlockArea.GetBlockMetas())); }
inline cChunkDef::HeightMap & GetHeightMap (void) { return m_HeightMap; }
inline cEntityList & GetEntities (void) { return m_Entities; }
- inline cBlockEntities & GetBlockEntities (void) { return m_BlockEntities; }
+ inline const cBlockEntities & GetBlockEntities (void) const { return m_BlockArea.GetBlockEntities(); }
+ inline cBlockEntities & GetBlockEntities (void) { return m_BlockArea.GetBlockEntities(); }
inline const cChunkDef::BiomeMap & GetBiomeMap() const { return m_BiomeMap; }
inline const cChunkDef::BlockTypes & GetBlockTypes() const { return *(reinterpret_cast<cChunkDef::BlockTypes *>(m_BlockArea.GetBlockTypes())); }
@@ -259,7 +260,6 @@ private:
cBlockArea m_BlockArea;
cChunkDef::HeightMap m_HeightMap;
cEntityList m_Entities;
- cBlockEntities m_BlockEntities; // Individual block entities are NOT owned by this object!
bool m_bUseDefaultBiomes;
bool m_bUseDefaultHeight;
diff --git a/src/Generating/MineShafts.cpp b/src/Generating/MineShafts.cpp
index 189b28095..beb1e24a1 100644
--- a/src/Generating/MineShafts.cpp
+++ b/src/Generating/MineShafts.cpp
@@ -26,7 +26,7 @@ in a depth-first processing. Each of the descendants will branch randomly, if no
-class cMineShaft abstract
+class cMineShaft
{
public:
enum eKind
diff --git a/src/Generating/MineShafts.h b/src/Generating/MineShafts.h
index 43eff2055..6c137fed8 100644
--- a/src/Generating/MineShafts.h
+++ b/src/Generating/MineShafts.h
@@ -35,7 +35,7 @@ protected:
class cMineShaftSystem; // fwd: MineShafts.cpp
int m_GridSize; ///< Average spacing of the systems
- int m_MaxSystemSize; ///< Maximum blcok size of a mineshaft system
+ int m_MaxSystemSize; ///< Maximum block size of a mineshaft system
int m_ProbLevelCorridor; ///< Probability level of a branch object being the corridor
int m_ProbLevelCrossing; ///< Probability level of a branch object being the crossing, minus Corridor
int m_ProbLevelStaircase; ///< Probability level of a branch object being the staircase, minus Crossing