diff --git a/init.lua b/init.lua index 0bbc7b5..89059ad 100644 --- a/init.lua +++ b/init.lua @@ -510,7 +510,9 @@ function update_known_items(player, item_name) end -- Mark items craftable with this (and other) items as known. + local new_recipes = 0 for _,out_item_name in pairs(known_crafting_outputs(data, item_name)) do + new_recipes = new_recipes + 1 data.known_items[out_item_name] = true end @@ -518,7 +520,11 @@ function update_known_items(player, item_name) data.items = visible_items(data) -- Notify the player. - minetest.chat_send_player(name, S("New recipes unlocked!")) + if new_recipes == 1 then + minetest.chat_send_player(name, S("New recipe unlocked!")) + elseif new_recipes > 1 then + minetest.chat_send_player(name, S("@1 new recipes unlocked!", new_recipes)) + end end end diff --git a/locale/template.txt b/locale/template.txt index e02a721..f98012f 100644 --- a/locale/template.txt +++ b/locale/template.txt @@ -51,3 +51,5 @@ Click again to show recipes.= No recipes.= Click again to show usages.= Recipes= +New recipe unlocked!= +@1 new recipes unlocked!=