From 706257f8fbd897dc6087fa93269dd964d633d0f8 Mon Sep 17 00:00:00 2001 From: QUSpilPrgm Date: Sun, 29 May 2016 10:30:47 +0200 Subject: Update Dispensers and let them act more like in Vanilla - Added code to make bonemeal, potions, minecarts, XP bottles and boats work inside dispensers - Dispensers are now able to place TNT if the block is transparent but not air - Added return value that indicates the success of pumpkin, melon, sugarcane and cactus growing functions - Changed return value of "GrowRipePlant" so that it actually indicates if the block was able to grow - Fixed "GrowSugarcane" and "GrowCactus" in "GrowRipePlant" so that it only grows them a single block --- src/Chunk.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index c7987723b..f8bd9075d 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -580,14 +580,14 @@ private: /** Adds snow to the top of snowy biomes and hydrates farmland / fills cauldrons in rainy biomes */ void ApplyWeatherToTop(void); - /** Grows sugarcane by the specified number of blocks, but no more than 3 blocks high (used by both bonemeal and ticking) */ - void GrowSugarcane (int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks); + /** Grows sugarcane by the specified number of blocks, but no more than 3 blocks high (used by both bonemeal and ticking); returns the amount of blocks the sugarcane grew inside this call */ + int GrowSugarcane (int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks); - /** Grows cactus by the specified number of blocks, but no more than 3 blocks high (used by both bonemeal and ticking) */ - void GrowCactus (int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks); + /** Grows cactus by the specified number of blocks, but no more than 3 blocks high (used by both bonemeal and ticking); returns the amount of blocks the cactus grew inside this call */ + int GrowCactus (int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks); - /** Grows a melon or a pumpkin next to the block specified (assumed to be the stem) */ - void GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, MTRand & a_Random); + /** Grows a melon or a pumpkin next to the block specified (assumed to be the stem); returns true if the pumpkin or melon sucessfully grew */ + bool GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, MTRand & a_Random); /** Called by Tick() when an entity moves out of this chunk into a neighbor; moves the entity and sends spawn / despawn packet to clients */ void MoveEntityToNewChunk(cEntity * a_Entity); -- cgit v1.2.3 From f1192c6860fc209509a414beaa4bbeaf87cfcb8d Mon Sep 17 00:00:00 2001 From: QUSpilPrgm Date: Sun, 29 May 2016 22:10:35 +0200 Subject: Makes tall grass and large flowers bonemealable Adds the bonemeal particle effect to some more places --- src/Chunk.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/Chunk.h') diff --git a/src/Chunk.h b/src/Chunk.h index f8bd9075d..162c8de96 100644 --- a/src/Chunk.h +++ b/src/Chunk.h @@ -586,6 +586,9 @@ private: /** Grows cactus by the specified number of blocks, but no more than 3 blocks high (used by both bonemeal and ticking); returns the amount of blocks the cactus grew inside this call */ int GrowCactus (int a_RelX, int a_RelY, int a_RelZ, int a_NumBlocks); + /** Grows a tall grass present at the block specified to a two tall grass; returns true if the grass grew */ + bool GrowTallGrass (int a_RelX, int a_RelY, int a_RelZ); + /** Grows a melon or a pumpkin next to the block specified (assumed to be the stem); returns true if the pumpkin or melon sucessfully grew */ bool GrowMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_BlockType, MTRand & a_Random); -- cgit v1.2.3