Change tdef to tooldef

This commit is contained in:
Calinou 2013-09-08 19:30:49 +02:00
parent 7595c898d2
commit 32f2a82047
1 changed files with 11 additions and 11 deletions

View File

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