Achievements: Delicious Fish, Acquire Hardware

This commit is contained in:
Wuzzy 2017-03-05 23:58:26 +01:00
parent cf1be05710
commit 419169d06b
3 changed files with 27 additions and 10 deletions

View file

@ -2,3 +2,4 @@ mcl_init
mcl_core
mcl_sounds
mcl_craftguide
mcl_achievements

View file

@ -113,6 +113,17 @@ local function allow_metadata_inventory_take(pos, listname, index, stack, player
return stack:get_count()
end
local function on_metadata_inventory_take(pos, listname, index, stack, player)
-- Award smelting achievements
if listname == "dst" then
if stack:get_name() == "mcl_core:iron_ingot" then
awards.unlock(player:get_player_name(), "mcl:acquireIron")
elseif stack:get_name() == "mcl_fishing:fish_cooked" then
awards.unlock(player:get_player_name(), "mcl:cookFish")
end
end
end
local function swap_node(pos, name)
local node = minetest.get_node(pos)
if node.name == name then
@ -296,6 +307,7 @@ minetest.register_node("mcl_furnaces:furnace", {
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
on_metadata_inventory_take = on_metadata_inventory_take,
on_receive_fields = craftguide,
_mcl_blast_resistance = 17.5,
_mcl_hardness = 3.5,
@ -336,6 +348,7 @@ minetest.register_node("mcl_furnaces:furnace_active", {
allow_metadata_inventory_put = allow_metadata_inventory_put,
allow_metadata_inventory_move = allow_metadata_inventory_move,
allow_metadata_inventory_take = allow_metadata_inventory_take,
on_metadata_inventory_take = on_metadata_inventory_take,
on_receive_fields = craftguide,
_mcl_blast_resistance = 17.5,
_mcl_hardness = 3.5,