'fertile' achievement now needs using fertilizer

master
Wuzzy 2022-06-24 13:29:38 +02:00
parent 4c8115098e
commit cba649f410
2 changed files with 7 additions and 2 deletions

View File

@ -76,9 +76,9 @@ achievements.register_achievement(
"fertile",
{
title = S("Fertile"),
description = S("Craft a bag of fertilizer."),
description = S("Use fertilizer to fertilize a plant."),
times = 1,
craftitem = "rp_default:fertilizer",
item_icon = "rp_default:fertilizer",
})
-- Literature

View File

@ -151,6 +151,11 @@ minetest.register_craftitem(
" at " .. minetest.pos_to_string(above_soil_pos, 0) .. " with timeout="..timeout.." set from elapsed="..elapsed..
" to elapsed="..new_elapsed)
end
if placer and placer:is_player() then
if minetest.get_item_group(above_soil_node.name, "plant") == 1 then
achievements.trigger_achievement(placer, "fertile")
end
end
end
end