This commit is contained in:
Calinou 2013-09-08 19:57:27 +02:00
parent 32f2a82047
commit 53d846ba8b

View File

@ -175,44 +175,44 @@ local function add_ore(modname, description, mineral_name, oredef)
minetest.register_ore(oredef.oredef) minetest.register_ore(oredef.oredef)
for toolname, tooldef in pairs(oredef.tools) do for toolname, tdef in pairs(oredef.tools) do
local tooldef = { local tdef = {
description = "", description = "",
inventory_image = toolimg_base .. toolname .. ".png", inventory_image = toolimg_base .. toolname .. ".png",
tool_capabilities = { tool_capabilities = {
max_drop_level=3, max_drop_level=3,
groupcaps=tooldef groupcaps=tdef
} }
} }
if toolname == "sword" then if toolname == "sword" then
tooldef.full_punch_interval = oredef.punchint tdef.full_punch_interval = oredef.punchint
tooldef.description = S("%s Sword"):format(S(description)) tdef.description = S("%s Sword"):format(S(description))
end end
if toolname == "pick" then if toolname == "pick" then
tooldef.description = S("%s Pickaxe"):format(S(description)) tdef.description = S("%s Pickaxe"):format(S(description))
end end
if toolname == "axe" then if toolname == "axe" then
tooldef.description = S("%s Axe"):format(S(description)) tdef.description = S("%s Axe"):format(S(description))
end end
if toolname == "shovel" then if toolname == "shovel" then
tooldef.description = S("%s Shovel"):format(S(description)) tdef.description = S("%s Shovel"):format(S(description))
end end
if toolname == "hoe" then if toolname == "hoe" then
tooldef.description = S("%s Hoe"):format(S(description)) tdef.description = S("%s Hoe"):format(S(description))
local uses = tooldef.uses local uses = tooldef.uses
tooldef.uses = nil tdef.uses = nil
tooldef.on_use = function(itemstack, user, pointed_thing) tdef.on_use = function(itemstack, user, pointed_thing)
return hoe_on_use(itemstack, user, pointed_thing, uses) return hoe_on_use(itemstack, user, pointed_thing, uses)
end end
end end
local fulltoolname = tool_base .. toolname .. tool_post local fulltoolname = tool_base .. toolname .. tool_post
minetest.register_tool(fulltoolname, tooldef) minetest.register_tool(fulltoolname, tdef)
minetest.register_alias(toolname .. tool_post, fulltoolname) minetest.register_alias(toolname .. tool_post, fulltoolname)
if oredef.makes.ingot then if oredef.makes.ingot then
minetest.register_craft({ minetest.register_craft({