summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authorQUSpilPrgm <QUSpilPrgm@users.noreply.github.com>2016-05-29 10:30:47 +0200
committerQUSpilPrgm <QUSpilPrgm@users.noreply.github.com>2016-06-03 15:45:49 +0200
commit706257f8fbd897dc6087fa93269dd964d633d0f8 (patch)
tree6dd9d70ac993c04993580345b246f5d0c52f1ccc /src/Chunk.cpp
parentDebuggers: Added the forgotten Inject.lua file. (diff)
downloadcuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.tar
cuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.tar.gz
cuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.tar.bz2
cuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.tar.lz
cuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.tar.xz
cuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.tar.zst
cuberite-706257f8fbd897dc6087fa93269dd964d633d0f8.zip
Diffstat (limited to '')
-rw-r--r--src/Chunk.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp
index 363de9933..c65c043da 100644
--- a/src/Chunk.cpp
+++ b/src/Chunk.cpp
@@ -929,7 +929,7 @@ void cChunk::ApplyWeatherToTop()
-void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, MTRand & a_TickRandom)
+bool cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, MTRand & a_TickRandom)
{
// Convert the stem BlockType into produce BlockType
BLOCKTYPE ProduceType;
@@ -940,7 +940,7 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl
default:
{
ASSERT(!"Unhandled blocktype in TickMelonPumpkin()");
- return;
+ return false;
}
}
@@ -961,7 +961,7 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl
)
{
// Neighbors not valid or already taken by the same produce
- return;
+ return false;
}
// Pick a direction in which to place the produce:
@@ -985,7 +985,7 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl
{
break;
}
- default: return;
+ default: return false;
}
// Check if there's soil under the neighbor. We already know the neighbors are valid. Place produce if ok
@@ -1013,13 +1013,14 @@ void cChunk::GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Bl
break;
}
}
+ return true;
}
-void cChunk::GrowSugarcane(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
+int cChunk::GrowSugarcane(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
{
// Check the total height of the sugarcane blocks here:
int Top = a_RelY + 1;
@@ -1051,16 +1052,17 @@ void cChunk::GrowSugarcane(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
}
else
{
- break;
+ return i;
}
} // for i
+ return ToGrow;
}
-void cChunk::GrowCactus(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
+int cChunk::GrowCactus(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
{
// Check the total height of the sugarcane blocks here:
int Top = a_RelY + 1;
@@ -1093,9 +1095,10 @@ void cChunk::GrowCactus(int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks)
}
else
{
- break;
+ return i;
}
} // for i
+ return ToGrow;
}