supports multiple harvesting stages

master
nixnoxus 2022-03-26 21:30:16 +01:00
parent b1d61a499f
commit 76713b2532
1 changed files with 11 additions and 1 deletions

View File

@ -50,10 +50,20 @@ end
-- Farming Redo
-------------------------------------------------------------------------------
if farming.mod == "redo" then
local fp_grows = function(def, step)
local crop = def.crop .. "_" .. step
local node = minetest.registered_nodes[crop]
if node then
fp(def.seed, def.crop .. "_1", crop, def.trellis)
return node.groups and node.groups.growing
end
end
for name, def in pairs(farming.registered_plants) do
-- everything except cocoa (these can only be placed on jungletree)
if name ~= "farming:cocoa_beans" then
fp(def.seed, def.crop .. "_1", def.crop .. "_" .. def.steps, def.trellis)
local step = def.steps
while fp_grows(def, step) do step = step + 1 end
end
end
end