From 5378aae09e2dda5241052e48b66638a9b8ff3f70 Mon Sep 17 00:00:00 2001 From: Michieal Date: Sat, 19 Nov 2022 12:19:32 +0000 Subject: [PATCH] Add in achievement. --- mods/ITEMS/mcl_hamburger/init.lua | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/mods/ITEMS/mcl_hamburger/init.lua b/mods/ITEMS/mcl_hamburger/init.lua index 4904fab87..cb0d0d425 100644 --- a/mods/ITEMS/mcl_hamburger/init.lua +++ b/mods/ITEMS/mcl_hamburger/init.lua @@ -1,3 +1,9 @@ +--- +--- Generated by EmmyLua(https://github.com/EmmyLua) +--- Created by michieal. +--- DateTime: 11/19/22 7:13 AM +--- + --- --- Generated by EmmyLua(https://github.com/EmmyLua) --- Created by michieal. @@ -46,7 +52,7 @@ local hamburger_def = { on_place = minetest.item_eat(8), on_secondary_use = minetest.item_eat(8), groups = { food = 2, eatable = 8 }, - _mcl_saturation = 12.8, + _mcl_saturation = 13.8, } if not enable_burger then @@ -62,6 +68,23 @@ else minetest.register_craftitem("mcl_hamburger:hamburger", hamburger_alt) end +local function register_achievements() + + awards.register_achievement("mcl_hamburger:hamburger", { + title = S("Burger Time!"), + description = S("Craft a Hamburger."), + icon = "mcl_hamburger.png", + trigger = { + type = "craft", + item = "mcl_hamburger:hamburger", + target = 1 + }, + type = "Advancement", + group = "Overworld", + }) + +end + if enable_burger then -- make the villagers follow the item minetest.registered_entities["mobs_mc:villager"].nofollow = false @@ -69,4 +92,7 @@ if enable_burger then table.insert(minetest.registered_entities["mobs_mc:villager"].follow,"mcl_hamburger:hamburger") -- register the item and crafting recipe. mcl_hamburger.register_burger_craft("mcl_mobitems:cooked_beef") + -- add in the super cool achievement(s)! + register_achievements() end +