summaryrefslogtreecommitdiffstats
path: root/src/ChunkMap.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2016-06-04 13:08:15 +0200
committerMattes D <github@xoft.cz>2016-06-04 13:08:15 +0200
commitfc874ed57d6f16dc5d4b616711e3bfbd6e963ccf (patch)
treed299b6e8cd24f087f8bf5047cde858d4bcedbcf5 /src/ChunkMap.cpp
parentDebuggers: Added the forgotten Inject.lua file. (diff)
parentMakes tall grass and large flowers bonemealable (diff)
downloadcuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.tar
cuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.tar.gz
cuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.tar.bz2
cuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.tar.lz
cuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.tar.xz
cuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.tar.zst
cuberite-fc874ed57d6f16dc5d4b616711e3bfbd6e963ccf.zip
Diffstat (limited to '')
-rw-r--r--src/ChunkMap.cpp33
1 files changed, 27 insertions, 6 deletions
diff --git a/src/ChunkMap.cpp b/src/ChunkMap.cpp
index 83c1c12dd..55cabaa67 100644
--- a/src/ChunkMap.cpp
+++ b/src/ChunkMap.cpp
@@ -2597,7 +2597,7 @@ void cChunkMap::GetChunkStats(int & a_NumChunksValid, int & a_NumChunksDirty)
-void cChunkMap::GrowMelonPumpkin(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, MTRand & a_Rand)
+bool cChunkMap::GrowMelonPumpkin(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, MTRand & a_Rand)
{
int ChunkX, ChunkZ;
cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ);
@@ -2606,15 +2606,16 @@ void cChunkMap::GrowMelonPumpkin(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCK
cChunkPtr Chunk = GetChunkNoLoad(ChunkX, ChunkZ);
if (Chunk != nullptr)
{
- Chunk->GrowMelonPumpkin(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_Rand);
+ return Chunk->GrowMelonPumpkin(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_Rand);
}
+ return false;
}
-void cChunkMap::GrowSugarcane(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow)
+int cChunkMap::GrowSugarcane(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow)
{
int ChunkX, ChunkZ;
cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ);
@@ -2623,15 +2624,16 @@ void cChunkMap::GrowSugarcane(int a_BlockX, int a_BlockY, int a_BlockZ, int a_Nu
cChunkPtr Chunk = GetChunkNoLoad(ChunkX, ChunkZ);
if (Chunk != nullptr)
{
- Chunk->GrowSugarcane(a_BlockX, a_BlockY, a_BlockZ, a_NumBlocksToGrow);
+ return Chunk->GrowSugarcane(a_BlockX, a_BlockY, a_BlockZ, a_NumBlocksToGrow);
}
+ return 0;
}
-void cChunkMap::GrowCactus(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow)
+int cChunkMap::GrowCactus(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow)
{
int ChunkX, ChunkZ;
cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ);
@@ -2640,8 +2642,27 @@ void cChunkMap::GrowCactus(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBl
cChunkPtr Chunk = GetChunkNoLoad(ChunkX, ChunkZ);
if (Chunk != nullptr)
{
- Chunk->GrowCactus(a_BlockX, a_BlockY, a_BlockZ, a_NumBlocksToGrow);
+ return Chunk->GrowCactus(a_BlockX, a_BlockY, a_BlockZ, a_NumBlocksToGrow);
}
+ return 0;
+}
+
+
+
+
+
+bool cChunkMap::GrowTallGrass(int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+ int ChunkX, ChunkZ;
+ cChunkDef::AbsoluteToRelative(a_BlockX, a_BlockY, a_BlockZ, ChunkX, ChunkZ);
+
+ cCSLock Lock(m_CSLayers);
+ cChunkPtr Chunk = GetChunkNoLoad(ChunkX, ChunkZ);
+ if (Chunk != nullptr)
+ {
+ return Chunk->GrowTallGrass(a_BlockX, a_BlockY, a_BlockZ);
+ }
+ return 0;
}