From 3539eac6b4c7ddbe29a14ed2e171b8c37e4f511d Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 5 Mar 2017 22:33:09 +0100 Subject: [PATCH] =?UTF-8?q?Achievements:=20Add=20=E2=80=9CInto=20Fire?= =?UTF-8?q?=E2=80=9D,=20fix=20=E2=80=9CDIAMONDS!=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mods/ENTITIES/mcl_item_entity/init.lua | 10 ++++++++++ mods/HUD/mcl_achievements/init.lua | 12 +++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/mods/ENTITIES/mcl_item_entity/init.lua b/mods/ENTITIES/mcl_item_entity/init.lua index 74346688d2..4436438991 100644 --- a/mods/ENTITIES/mcl_item_entity/init.lua +++ b/mods/ENTITIES/mcl_item_entity/init.lua @@ -12,6 +12,14 @@ item_drop_settings.random_item_velocity = true --this sets random item velocity item_drop_settings.drop_single_item = false --if true, the drop control drops 1 item instead of the entire stack, and sneak+drop drops the stack -- drop_single_item is disabled by default because it is annoying to throw away items from the intentory screen +local check_pickup_achievements = function(object, player) + local itemname = ItemStack(object:get_luaentity().itemstring):get_name() + if itemname == "mcl_mobitems:blaze_rod" then + awards.unlock(player:get_player_name(), "mcl:blazeRod") + elseif itemname == "mcl_core:diamond" then + awards.unlock(player:get_player_name(), "mcl:diamonds") + end +end minetest.register_globalstep(function(dtime) for _,player in ipairs(minetest.get_connected_players()) do @@ -33,6 +41,7 @@ minetest.register_globalstep(function(dtime) max_hear_distance = 100, gain = 10.0, }) + check_pickup_achievements(object, player) object:get_luaentity().itemstring = "" object:remove() end @@ -92,6 +101,7 @@ minetest.register_globalstep(function(dtime) gain = 10.0, }) end + check_pickup_achievements(object, player) object:get_luaentity().itemstring = "" object:remove() else diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index d3a6356bfb..0d08c0a475 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -109,13 +109,10 @@ 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", - trigger = { - type = "dig", - node = "mcl_core:stone_with_diamond", - target = 1 - } }) + awards.register_achievement("mcl:bookcase", { title = S("Librarian"), icon = "default_bookshelf.png", @@ -126,6 +123,11 @@ awards.register_achievement("mcl:bookcase", { } }) +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", +}) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)