Update init.lua

This commit is contained in:
LoneWolfHT
2020-12-31 08:39:03 -08:00
committed by GitHub
parent 4186ff08be
commit 6ae9387823

View File

@ -26,28 +26,31 @@ minetest.register_tool("hammermod:steel_hammer", {
}) })
local ingredients = { local ingredients
stick = "default:stick",
ironBlock = "default:steelblock",
ironIngot = "default:steel_ingot",
}
if minetest.get_modpath("mcl_core") then if minetest.get_modpath("mcl_core") then
ingredients = { ingredients = {
stick = "mcl_core:stick", stick = "mcl_core:stick",
ironBlock = "mcl_core:ironblock", ironBlock = "mcl_core:ironblock",
ironIngot = "mcl_core:iron_ingot", ironIngot = "mcl_core:iron_ingot",
} }
elseif minetest.get_modpath("default") then
ingredients = {
stick = "default:stick",
ironBlock = "default:steelblock",
ironIngot = "default:steel_ingot",
}
end end
minetest.register_craft({ if ingredients then
minetest.register_craft({
output = "hammermod:steel_hammer", output = "hammermod:steel_hammer",
recipe = { recipe = {
{ingredients.ironIngot, ingredients.ironBlock, ingredients.ironIngot}, {ingredients.ironIngot, ingredients.ironBlock, ingredients.ironIngot},
{"", ingredients.stick, ""}, {"", ingredients.stick, ""},
{"", ingredients.stick, ""}, {"", ingredients.stick, ""},
}, },
}) })
end
local steelHammerDigs = {} local steelHammerDigs = {}