From 672bb0457012612ef59502b33717ee789c4d6bfe Mon Sep 17 00:00:00 2001 From: 0ddlyoko Date: Fri, 6 Nov 2020 17:54:01 +0100 Subject: Add correct implementation of crops (#4802) * [FIX] Add correct implementation of seed drops. > Official percentage of drops has been implemented * Fix C++ conventions * Change "Vals" variable to "m_Vals" * [FIX] Add correct implementation of Carrots, Potatoes, Wheat & Beetroots seed * Add Fortune support with crops Add fortune support with Wheat, Carrots, Potatoes & Beetroots seeds * [FIX] Right-clicking on a grown Beetroot in survival consume 2 bone meals Fix #4805 * Add documentation for "cWorld::IsFullGrownPlantAt" method * Fix dispenser that full grown a plant > Change methods cItemDyeHandler::FertilizePlant & cItemDyeHandler::growPlantsAround to static * Display particle even if tree doesn't grow * When right-clicking on a full grown melon / pumpkin seed, no longer produce a melon / pumpkin Before this commit, when you right-click on a melon or a pumpkin seed, a melon / pumpkin block spawned. With this commit, it no longer spawns * [FIX] Do not create melon / pumpkin block when right-clicking with a bone meal This fix will prevent the creation of a melon / pumpkin block when you right-click with a bone meal on a melon / pumpkin plant - It just detect if the plant is full grown. if yes, the method "Grow" is not called - Remove IsFullGrownPlant Co-authored-by: 12xx12 <12xx12100@gmail.com> Co-authored-by: Tiger Wang --- src/World.h | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'src/World.h') diff --git a/src/World.h b/src/World.h index 490ab59b4..e1d2a1abf 100644 --- a/src/World.h +++ b/src/World.h @@ -862,18 +862,10 @@ public: bool GrowRipePlant(int a_BlockX, int a_BlockY, int a_BlockZ, bool a_IsByBonemeal = false) { UNUSED(a_IsByBonemeal); - return GrowRipePlant({a_BlockX, a_BlockY, a_BlockZ}); + LOGWARNING("Warning: cWorld:GrowRipePlant function expects Vector3i-based coords rather than int-based coords. Emulating old-style call."); + return GrowRipePlant({ a_BlockX, a_BlockY, a_BlockZ }); } - /** Grows a cactus present at the block specified by the amount of blocks specified, up to the max height specified in the config; returns the amount of blocks the cactus grew inside this call */ - int GrowCactus(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow); - - /** 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_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType); - - /** Grows a sugarcane present at the block specified by the amount of blocks specified, up to the max height specified in the config; returns the amount of blocks the sugarcane grew inside this call */ - int GrowSugarcane(int a_BlockX, int a_BlockY, int a_BlockZ, int a_NumBlocksToGrow); - /** Returns the biome at the specified coords. Reads the biome from the chunk, if loaded, otherwise uses the world generator to provide the biome value */ EMCSBiome GetBiomeAt(int a_BlockX, int a_BlockZ); -- cgit v1.2.3