Merge pull request 'Fix skipping growth stages of mcl_farming plants' (#345) from balazsszalab/MineClone5:master into master

Reviewed-on: MineClone5/MineClone5#345
Reviewed-by: PrairieWind <prairie.astronomer1@gmail.com>
This commit is contained in:
PrairieWind 2022-06-18 17:48:49 +00:00
commit f93efc4843
2 changed files with 6 additions and 1 deletions

View File

@ -281,6 +281,11 @@ local function apply_bone_meal(pointed_thing)
if math.random(1, 100) <= 75 then
return mcl_farming:grow_plant("plant_beetroot", pos, n, 1, true)
end
-- Sweet berry bush advances 1 stage
elseif string.find(n.name, "mcl_farming:sweet_berry_bush_") then
mcl_dye.add_bone_meal_particle(pos)
local stages = 1
return mcl_farming:grow_plant("plant_sweet_berry_bush", pos, n, stages, true)
elseif n.name == "mcl_cocoas:cocoa_1" or n.name == "mcl_cocoas:cocoa_2" then
mcl_dye.add_bone_meal_particle(pos)
-- Cocoa: Advance by 1 stage

View File

@ -129,7 +129,7 @@ function mcl_farming:grow_plant(identifier, pos, node, stages, ignore_light, low
if not stages then
stages = 1
end
stages = stages + math.ceil(intervals_counter)
stages = stages + math.floor(intervals_counter)
local new_node = {name = plant_info.names[step+stages]}
if new_node.name == nil then
new_node.name = plant_info.full_grown