Merge pull request #18 from nixnoxus/fix_farming_pepper

supports multiple harvesting stages (for farming:pepper)
This commit is contained in:
Joachim Stolberg 2022-03-27 11:27:11 +02:00 committed by GitHub
commit e13a28daf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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