From cf1be057108c5d5b23c62c10d57ea047ab804ba7 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 5 Mar 2017 22:52:19 +0100 Subject: [PATCH] Achievements: Fix mineWood, add Cow Tipper --- mods/ENTITIES/mcl_item_entity/init.lua | 6 ++++- mods/HUD/mcl_achievements/init.lua | 34 ++++++++++++++------------ 2 files changed, 23 insertions(+), 17 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 4436438991..51bac5b440 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -14,8 +14,12 @@ item_drop_settings.drop_single_item = false --if true, the drop control dro local check_pickup_achievements = function(object, player) local itemname = ItemStack(object:get_luaentity().itemstring):get_name() - if itemname == "mcl_mobitems:blaze_rod" then + if minetest.get_item_group(itemname, "tree") ~= 0 then + awards.unlock(player:get_player_name(), "mcl:mineWood") + elseif itemname == "mcl_mobitems:blaze_rod" then awards.unlock(player:get_player_name(), "mcl:blazeRod") + elseif itemname == "mcl_mobitems:leather" then + awards.unlock(player:get_player_name(), "mcl:killCow") elseif itemname == "mcl_core:diamond" then awards.unlock(player:get_player_name(), "mcl:diamonds") end diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index 0d08c0a475..cc79db4550 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -17,16 +17,6 @@ awards.register_achievement("mcl_buildWorkBench", { target = 1 } }) -awards.register_achievement("mcl_mineWood", { - title = S("Getting Wood"), - description = S("Punch a tree to get oak wood."), - icon = "default_tree.png", - trigger = { - type = "dig", - node = "mcl_core:tree", - target = 1 - } -}) awards.register_achievement("mcl:buildPickaxe", { title = S("Time to Mine!"), description = S("Use a crafting table to craft a wooden pickaxe from wooden planks and sticks."), @@ -107,12 +97,6 @@ awards.register_achievement("mcl:buildSword", { } }) -awards.register_achievement("mcl:diamonds", { - title = S("DIAMONDS!"), - description = S("Pick up a diamond from the floor."), - icon = "default_stone.png^default_mineral_diamond.png", -}) - awards.register_achievement("mcl:bookcase", { title = S("Librarian"), icon = "default_bookshelf.png", @@ -123,12 +107,30 @@ awards.register_achievement("mcl:bookcase", { } }) +-- Item pickup achievements: These are awarded when picking up a certain item. +-- The achivements are manually given in the mod mcl_item_entity. +awards.register_achievement("mcl:diamonds", { + title = S("DIAMONDS!"), + description = S("Pick up a diamond from the floor."), + icon = "default_stone.png^default_mineral_diamond.png", +}) awards.register_achievement("mcl:blazeRod", { title = S("Into Fire"), description = S("Pick up a blaze rod from the floor."), icon = "mcl_mobitems_blaze_rod.png", }) +awards.register_achievement("mcl:killCow", { + title = S("Cow Tipper"), + description = S("Pick up leather from the floor."), + icon = "mcl_mobitems_leather.png", +}) +awards.register_achievement("mcl:mineWood", { + title = S("Getting Wood"), + description = S("Pick up a wood item from the ground.\nHint: Punch a tree trunk until it pops out as an item."), + icon = "default_tree.png", +}) + -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) awards.register_achievement("mcl:n_placeDispenser", {