MCPcopy Create free account
hub / github.com/Hopson97/HopsonCraft / getBlock

Method getBlock

Source/World/Chunk/Full_Chunk.cpp:86–101  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 }
85
86 CBlock Full_Chunk::getBlock(const Block::Position& position) const
87 {
88 int32_t yPositionSection = position.y / CHUNK_SIZE;
89 if (yPositionSection > static_cast<int>(m_chunkSections.size() - 1))
90 {
91 return Block::ID::Air;
92 }
93 else
94 {
95 auto blockPos = Maths::Convert::chunkBlockToSectionBlockPosition(position);
96
97 getSection(yPositionSection)
98 ->getBlock(blockPos);
99 }
100 return Block::ID::Air;
101 }
102
103 CBlock Full_Chunk::qGetBlock(const Block::Position& position) const
104 {

Callers

nothing calls this directly

Calls 2

getSectionFunction · 0.85

Tested by

no test coverage detected