Files
luanti-stripped-tree/recipes.lua

80 lines
2.7 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
local S = core.get_translator(core.get_current_modname())
-- Register tree bark
core.register_craftitem("stripped_tree:tree_bark", {description = S("Tree bark"), inventory_image = "tree_bark.png"})
core.register_alias("default:tree_bark", "stripped_tree:tree_bark")
-- Register bark as fuel
core.register_craft({type = "fuel", recipe = "stripped_tree:tree_bark", burntime = 15})
-- Register craft for paper
core.register_craft(
{
output = "default:paper 8",
recipe = {
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "bucket:bucket_water", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
},
replacements = {{"bucket:bucket_water", "bucket:bucket_empty"}},
}
)
-- Register the chisel tool if its enabled in the config
core.register_tool(
"stripped_tree:chisel", {
description = S("Chisel for tree trunks"),
inventory_image = "chisel.png",
wield_image = "chisel.png",
sound = {breaks = "default_tool_breaks"},
stack_max = 1,
on_use = function(itemstack, user, pointed_thing)
if pointed_thing.type == "object" then
pointed_thing.ref:punch(user, 1.0, { full_punch_interval=1.0}, nil)
return user:get_wielded_item()
end
if pointed_thing.type ~= "node" then return end
local pos = pointed_thing.under
stripped_tree.maybe_strip_trunk(pos, user, itemstack, 65535 / 299)
return itemstack
end,
}
)
core.register_craft({output = "stripped_tree:chisel", recipe = {{"default:steel_ingot"}, {"screwdriver:screwdriver"}}})
-- Recipes if the farming mod is loaded
-- Register craft for string
if core.get_modpath("farming") then
core.register_craft(
{
output = "farming:string 4",
recipe = {
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
},
}
)
end
-- Recipes if the bonemeal mod is loaded
-- Register craft for mulch
if core.get_modpath("bonemeal") then
core.register_craft(
{
output = "bonemeal:mulch 4",
recipe = {
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
{"stripped_tree:tree_bark", "stripped_tree:tree_bark", "stripped_tree:tree_bark"},
},
}
)
end