mirror of
https://github.com/minefaco/stripped_tree.git
synced 2024-12-12 00:43:25 +01:00
remove mods tool, add ability for default axes to strip trees
This commit is contained in:
parent
060c943076
commit
9fdcb7439a
28
init.lua
28
init.lua
@ -19,14 +19,15 @@ for _, name in ipairs(trunk_names) do
|
||||
})
|
||||
end
|
||||
|
||||
--Register tool
|
||||
minetest.register_tool("chisel_tree:chisel", {
|
||||
description = "A chisel for wood",
|
||||
inventory_image = "chisel.png",
|
||||
wield_image = "chisel.png",
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
stack_max = 1,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
--list of axes to override
|
||||
local axe_types = {
|
||||
"wood", "stone", "bronze", "steel", "mese", "diamond",
|
||||
}
|
||||
|
||||
for _, axe_name in ipairs(axe_types) do
|
||||
|
||||
minetest.override_item("default:axe_" .. axe_name, {
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
|
||||
if pointed_thing.type ~= "node" then
|
||||
return
|
||||
@ -55,15 +56,10 @@ minetest.register_tool("chisel_tree:chisel", {
|
||||
|
||||
end,
|
||||
})
|
||||
end
|
||||
|
||||
--Register craft
|
||||
minetest.register_craft({
|
||||
output = "chisel_tree:chisel",
|
||||
recipe = {
|
||||
{"", "default:steel_ingot", ""},
|
||||
{"", "group:fence", ""},
|
||||
}
|
||||
})
|
||||
--register alias to support old tool
|
||||
minetest.register_alias("chisel_tree:chisel", "default:axe_steel")
|
||||
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user