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 --- Server/Plugins/APIDump/Classes/World.lua | 121 +------------------------------ 1 file changed, 4 insertions(+), 117 deletions(-) (limited to 'Server') diff --git a/Server/Plugins/APIDump/Classes/World.lua b/Server/Plugins/APIDump/Classes/World.lua index 2f5d0b8f2..a1f2bc979 100644 --- a/Server/Plugins/APIDump/Classes/World.lua +++ b/Server/Plugins/APIDump/Classes/World.lua @@ -2096,64 +2096,6 @@ function OnAllChunksAvailable() All return values from the callbacks are i }, Notes = "Returns the total age of the world, in ticks. The age always grows, cannot be set by plugins and is unrelated to TimeOfDay.", }, - GrowCactus = - { - Params = - { - { - Name = "BlockX", - Type = "number", - }, - { - Name = "BlockY", - Type = "number", - }, - { - Name = "BlockZ", - Type = "number", - }, - { - Name = "NumBlocksToGrow", - Type = "number", - }, - }, - Returns = - { - { - Type = "number", - }, - }, - Notes = "OBSOLETE, use GrowPlantAt instead. Grows a cactus block at the specified coords, by up to the specified number of blocks. Adheres to the world's maximum cactus growth (GetMaxCactusHeight()). Returns the amount of blocks the cactus grew inside this call.", - }, - GrowMelonPumpkin = - { - Params = - { - { - Name = "BlockX", - Type = "number", - }, - { - Name = "BlockY", - Type = "number", - }, - { - Name = "BlockZ", - Type = "number", - }, - { - Name = "StemBlockType", - Type = "number", - }, - }, - Returns = - { - { - Type = "boolean", - }, - }, - Notes = "OBSOLETE, use GrowPlantAt instead. Grows a melon or pumpkin, based on the stem block type specified (assumed to be at the coords provided). Checks for normal melon / pumpkin growth conditions - stem not having another produce next to it and suitable ground below. Returns true if the melon or pumpkin grew successfully.", - }, GrowPlantAt = { Params = @@ -2176,76 +2118,21 @@ function OnAllChunksAvailable() All return values from the callbacks are i Notes = "Grows the plant at the specified block by the specified number of stages. Returns the number of stages actually grown. Returns zero for non-growable blocks.", }, GrowRipePlant = - { - { - Params = - { - { - Name = "BlockX", - Type = "number", - }, - { - Name = "BlockY", - Type = "number", - }, - { - Name = "BlockZ", - Type = "number", - }, - }, - Returns = - { - { - Type = "boolean", - }, - }, - Notes = "OBSOLETE, use the Vector3-based overload instead. Grows the plant at the specified coords to its full. Returns true if the plant was grown, false if not.", - }, - { - Params = - { - { - Name = "BlockPos", - Type = "Vector3i", - }, - }, - Returns = - { - { - Type = "boolean", - }, - }, - Notes = "Grows the plant at the specified coords to its full. Returns true if the plant was grown, false if not.", - }, - }, - GrowSugarcane = { Params = { { - Name = "BlockX", - Type = "number", - }, - { - Name = "BlockY", - Type = "number", - }, - { - Name = "BlockZ", - Type = "number", - }, - { - Name = "NumBlocksToGrow", - Type = "number", + Name = "BlockPos", + Type = "Vector3i", }, }, Returns = { { - Type = "number", + Type = "boolean", }, }, - Notes = "OBSOLETE, use GrowPlantAt instead. Grows a sugarcane block at the specified coords, by up to the specified number of blocks. Adheres to the world's maximum sugarcane growth (GetMaxSugarcaneHeight()). Returns the amount of blocks the sugarcane grew inside this call.", + Notes = "Grows the plant at the specified coords to its full. Returns true if the plant was grown, false if not.", }, GrowTree = { -- cgit v1.2.3