1
0

Moved growing from cWorld / cChunk to cBlockHandler descendants.

This commit is contained in:
Mattes D
2019-10-11 11:02:53 +02:00
parent f4bf025db9
commit 61904af626
42 changed files with 1527 additions and 1314 deletions

View File

@@ -299,7 +299,7 @@ bool cHopperEntity::MoveItemsOut(cChunk & a_Chunk, Int64 a_CurrentTick)
// Convert coords to relative:
auto relCoord = a_Chunk.AbsoluteToRelative(out.second);
auto destChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(relCoord.x, relCoord.z);
auto destChunk = a_Chunk.GetRelNeighborChunkAdjustCoords(relCoord);
if (destChunk == nullptr)
{
// The destination chunk has been unloaded, don't tick
@@ -379,7 +379,7 @@ bool cHopperEntity::MoveItemsFromChest(cChunk & a_Chunk)
for (const auto & ofs: neighborOfs)
{
auto neighborRelCoord = ofs.addedXZ(m_RelX, m_RelZ);
auto neighbor = a_Chunk.GetRelNeighborChunkAdjustCoords(neighborRelCoord.x, neighborRelCoord.z);
auto neighbor = a_Chunk.GetRelNeighborChunkAdjustCoords(neighborRelCoord);
if (neighbor == nullptr)
{
continue;
@@ -543,7 +543,7 @@ bool cHopperEntity::MoveItemsToChest(cChunk & a_Chunk, Vector3i a_Coords)
for (const auto & ofs: neighborOfs)
{
auto otherHalfRelCoord = relCoord + ofs;
auto neighbor = a_Chunk.GetRelNeighborChunkAdjustCoords(otherHalfRelCoord.x, otherHalfRelCoord.z);
auto neighbor = a_Chunk.GetRelNeighborChunkAdjustCoords(otherHalfRelCoord);
if (neighbor == nullptr)
{
continue;