1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2025-01-23 16:30:19 +01:00

Updated minetestforfun_game, part 4

Merged :
	Add reverse recipes to craft hoesw
This commit is contained in:
LeMagnesium 2015-03-03 22:04:16 +01:00
parent 5734e2a2e2
commit 2c6e09ce1c

View File

@ -1,6 +1,7 @@
-- Hoe registration function -- Hoe registration function
-- Register new hoes
farming.register_hoe = function(name, def) farming.register_hoe = function(name, def)
-- Check for : prefix (register new hoes in your mod's namespace) -- Check for : prefix (register new hoes in your mod's namespace)
if name:sub(1,1) ~= ":" then if name:sub(1,1) ~= ":" then
@ -32,10 +33,30 @@ farming.register_hoe = function(name, def)
end end
}) })
-- Register its recipe -- Register its recipe
minetest.register_craft({ if def.material == nil then
output = name:gsub(":", "", 1), minetest.register_craft({
recipe = def.recipe output = name:sub(2),
}) recipe = def.recipe
})
else
minetest.register_craft({
output = name:sub(2),
recipe = {
{def.material, def.material, ""},
{"", "group:stick", ""},
{"", "group:stick", ""}
}
})
-- Reverse Recipe
minetest.register_craft({
output = name:sub(2),
recipe = {
{"", def.material, def.material},
{"", "group:stick", ""},
{"", "group:stick", ""}
}
})
end
end end
-- Turns dirt with group soil=1 into soil -- Turns dirt with group soil=1 into soil
@ -87,64 +108,40 @@ farming.register_hoe(":farming:hoe_wood", {
description = "Wooden Hoe", description = "Wooden Hoe",
inventory_image = "farming_tool_woodhoe.png", inventory_image = "farming_tool_woodhoe.png",
max_uses = 30, max_uses = 30,
recipe = { material = "group:wood"
{"group:wood", "group:wood"},
{"", "group:stick"},
{"", "group:stick"},
}
}) })
farming.register_hoe(":farming:hoe_stone", { farming.register_hoe(":farming:hoe_stone", {
description = "Stone Hoe", description = "Stone Hoe",
inventory_image = "farming_tool_stonehoe.png", inventory_image = "farming_tool_stonehoe.png",
max_uses = 90, max_uses = 90,
recipe = { material = "group:stone"
{"group:stone", "group:stone"},
{"", "group:stick"},
{"", "group:stick"},
}
}) })
farming.register_hoe(":farming:hoe_steel", { farming.register_hoe(":farming:hoe_steel", {
description = "Steel Hoe", description = "Steel Hoe",
inventory_image = "farming_tool_steelhoe.png", inventory_image = "farming_tool_steelhoe.png",
max_uses = 200, max_uses = 200,
recipe = { material = "default:steel_ingot"
{"default:steel_ingot", "default:steel_ingot"},
{"", "group:stick"},
{"", "group:stick"},
}
}) })
farming.register_hoe(":farming:hoe_bronze", { farming.register_hoe(":farming:hoe_bronze", {
description = "Bronze Hoe", description = "Bronze Hoe",
inventory_image = "farming_tool_bronzehoe.png", inventory_image = "farming_tool_bronzehoe.png",
max_uses = 220, max_uses = 220,
recipe = { material = "default:bronze_ingot"
{"default:bronze_ingot", "default:bronze_ingot"},
{"", "group:stick"},
{"", "group:stick"},
}
}) })
farming.register_hoe(":farming:hoe_mese", { farming.register_hoe(":farming:hoe_mese", {
description = "Mese Hoe", description = "Mese Hoe",
inventory_image = "farming_tool_mesehoe.png", inventory_image = "farming_tool_mesehoe.png",
max_uses = 350, max_uses = 350,
recipe = { material = "default:mese_crystal"
{"default:mese_crystal", "default:mese_crystal"},
{"", "group:stick"},
{"", "group:stick"},
}
}) })
farming.register_hoe(":farming:hoe_diamond", { farming.register_hoe(":farming:hoe_diamond", {
description = "Diamond Hoe", description = "Diamond Hoe",
inventory_image = "farming_tool_diamondhoe.png", inventory_image = "farming_tool_diamondhoe.png",
max_uses = 500, max_uses = 500,
recipe = { material = "default:diamond"
{"default:diamond", "default:diamond"},
{"", "group:stick"},
{"", "group:stick"},
}
}) })