From 4a230b52dce536d404aa4cbe6aeb2d809f691d5f Mon Sep 17 00:00:00 2001 From: cale Date: Fri, 30 Dec 2016 11:10:30 +0100 Subject: [PATCH] fixed anvil + copper pick --- mods/default/craft.lua | 7 ++++++ mods/default/tools.lua | 4 ++-- mods/default/trees.lua | 11 +++++++++- mods/furnace/anvil.lua | 48 ++++++++++++++++++++++++++++++++++++++---- mods/quests/init.lua | 2 +- mods/skills/init.lua | 2 +- 6 files changed, 65 insertions(+), 9 deletions(-) diff --git a/mods/default/craft.lua b/mods/default/craft.lua index 5136c16..9e2ba1f 100644 --- a/mods/default/craft.lua +++ b/mods/default/craft.lua @@ -301,6 +301,13 @@ minetest.register_craft({ --workbench +minetest.register_craft({ + output = "default:workbench", + recipe = { + {"default:wood_tutorial", "default:wood_tutorial", "default:wood_tutorial"}, + } +}) + minetest.register_craft({ output = "default:workbench", recipe = { diff --git a/mods/default/tools.lua b/mods/default/tools.lua index e309961..fe8c8ac 100644 --- a/mods/default/tools.lua +++ b/mods/default/tools.lua @@ -119,8 +119,8 @@ minetest.register_tool("default:pick_copper", { max_drop_level=3, groupcaps= { cracky={times={[1]=1.00, [2]=0.30, [3]=0.20}, uses=150, maxlevel=1}, - hard={times={[2]=2.30, [3]=1.50}, uses=50, maxlevel=100}, - choppy={times={[2]=3.50, [3]=1.10}, uses=50, maxlevel=50} + hard={times={[2]=2.5, [3]=1.50}, uses=50, maxlevel=1}, + choppy={times={[2]=3.50, [3]=1.10}, uses=50, maxlevel=1} }, damage_groups = {fleshy=3}, } diff --git a/mods/default/trees.lua b/mods/default/trees.lua index 9dcb35c..50b2142 100644 --- a/mods/default/trees.lua +++ b/mods/default/trees.lua @@ -1,9 +1,18 @@ +-- wood (tutorial) + +minetest.register_node("default:wood_tutorial", { + description = "Wood", + tiles = {"default_wood.png"}, + groups = {choppy = 3, oddly_breakable_by_hand=1}, + sounds = default.sounds.wood(), +}) + -- wood minetest.register_node("default:wood", { description = "Wood", tiles = {"default_wood.png"}, - groups = {choppy = 3, oddly_breakable_by_hand=1}, + groups = {choppy = 3}, sounds = default.sounds.wood(), }) diff --git a/mods/furnace/anvil.lua b/mods/furnace/anvil.lua index 6228ecd..c6cd14d 100644 --- a/mods/furnace/anvil.lua +++ b/mods/furnace/anvil.lua @@ -67,13 +67,19 @@ minetest.register_node("furnace:anvil", { for name, def in pairs(furnace.anvil.materials) do if item == def.items.rod or - item == def.items.plate or - item == (def.items.blade or "none") then + item == def.items.plates or + item == (def.items.blade or "none") or + item == (def.items.other or "none") then + table.insert(items, def.items.rod .. " " .. tostring(count)) table.insert(items, def.items.plate .. " " .. tostring(count)) if def.items.blade then table.insert(items, def.items.blade .. " " .. tostring(count)) end + + if def.items.other then + table.insert(items, def.items.other .. " " .. tostring(count)) + end end end @@ -84,10 +90,43 @@ minetest.register_node("furnace:anvil", { on_metadata_inventory_take = function(pos, listname, index, stack, player) local meta = minetest.get_meta(pos) local inv = meta:get_inventory() + local count = stack:get_count() if listname == "output" then - inv:set_list("main", {}) + local c = inv:get_list("main")[1]:get_count() - count + local my_item = inv:get_list("main")[1] + my_item:set_count(c) + inv:set_list("main", {my_item}) inv:set_list("output", {}) + + if c > 0 then + print(c) + + local item = inv:get_list("main")[1]:get_name() + local items = {} + for name, def in pairs(furnace.anvil.materials) do + if item == def.items.rod or + item == def.items.plates or + item == (def.items.blade or "none") or + item == (def.items.other or "none") then + + table.insert(items, def.items.rod .. " " .. tostring(c)) + table.insert(items, def.items.plate .. " " .. tostring(c)) + if def.items.blade then + table.insert(items, def.items.blade .. " " .. tostring(c)) + end + + if def.items.other then + table.insert(items, def.items.other .. " " .. tostring(c)) + end + end + end + + inv:set_list("output", items) + else + inv:set_list("main", {}) + end + elseif listname == "main" then inv:set_list("output", {}) end @@ -98,7 +137,8 @@ furnace.anvil.register_material("iron", { items = { plate = "furnace:iron_plate", rod = "furnace:iron_rod", - blade = "default:blade" + blade = "default:blade", + other = "stairs:chisel" } }) diff --git a/mods/quests/init.lua b/mods/quests/init.lua index b57016f..ed07f7f 100644 --- a/mods/quests/init.lua +++ b/mods/quests/init.lua @@ -346,7 +346,7 @@ minetest.register_on_newplayer(function(player) local q9 = quests.add_dig_goal(quest, "Mine Iron", {"default:stone_with_iron"}, 2, "Your Flint Pick is strong enough to mine Iron.", "Great! You should be on level 2 now.\nEvery time you level up you can upgrade on of your skills.\nTry out /skill warrior or /skill miner\n") - q3.reward = "default:wood 3" + q3.reward = "default:wood_tutorial 3" q4.reward = "crafting_guide:book" q2.requires = q1 diff --git a/mods/skills/init.lua b/mods/skills/init.lua index 7952a05..4d009d6 100644 --- a/mods/skills/init.lua +++ b/mods/skills/init.lua @@ -411,7 +411,7 @@ minetest.override_item("default:stone_with_coal", { minetest.override_item("default:stone_with_diamond", { on_dig = function(pos, node, player) if skills.lvls[player:get_player_name()] and skills.lvls[player:get_player_name()]["miner"] > 5 then - xp.add_xp(player,xp.get_xp(xp.player_levels[player:get_player_name()], 7)) + xp.add_xp(player,xp.get_xp(xp.player_levels[player:get_player_name()], 14)) end minetest.node_dig(pos, node, player) end,