2018-12-30 19:37:59 -05:00
|
|
|
-- LUALOCALS < ---------------------------------------------------------
|
2019-01-26 11:39:55 -05:00
|
|
|
local minetest, nodecore
|
|
|
|
= minetest, nodecore
|
2018-12-30 19:37:59 -05:00
|
|
|
-- LUALOCALS > ---------------------------------------------------------
|
|
|
|
|
2018-12-30 19:16:16 -05:00
|
|
|
local modname = minetest.get_current_modname()
|
2018-12-30 17:36:47 -05:00
|
|
|
|
2019-01-25 09:26:15 -05:00
|
|
|
local function toolhead(name, from, group, sticks)
|
2019-01-03 23:19:41 -05:00
|
|
|
local n
|
|
|
|
if name then
|
2019-01-04 00:05:10 -05:00
|
|
|
n = modname .. ":toolhead_" .. name:lower()
|
2019-01-03 23:19:41 -05:00
|
|
|
local t = n:gsub(":", "_") .. ".png"
|
|
|
|
minetest.register_craftitem(n, {
|
2019-01-04 20:11:04 -05:00
|
|
|
description = "Wooden " .. name .. " Head",
|
2019-01-03 23:19:41 -05:00
|
|
|
inventory_image = t,
|
2019-01-06 14:51:09 -05:00
|
|
|
stack_max = 1,
|
|
|
|
groups = {
|
2019-01-24 23:16:12 -05:00
|
|
|
choppy = 1,
|
2019-01-17 00:01:00 -05:00
|
|
|
flammable = 2
|
2019-03-14 01:16:44 -04:00
|
|
|
},
|
|
|
|
sounds = nodecore.sounds("nc_tree_woody")
|
2019-01-03 23:19:41 -05:00
|
|
|
})
|
2019-01-04 20:11:04 -05:00
|
|
|
local m = modname .. ":tool_" .. name:lower()
|
|
|
|
local u = m:gsub(":", "_") .. ".png"
|
|
|
|
minetest.register_tool(m, {
|
|
|
|
description = "Wooden " .. name,
|
|
|
|
inventory_image = u,
|
2019-01-06 14:51:09 -05:00
|
|
|
groups = {
|
2019-01-17 00:01:00 -05:00
|
|
|
flammable = 2
|
2019-01-06 14:51:09 -05:00
|
|
|
},
|
2019-01-24 22:08:05 -05:00
|
|
|
tool_capabilities = nodecore.toolcaps({
|
|
|
|
[group] = 2
|
2019-03-14 01:16:44 -04:00
|
|
|
}),
|
|
|
|
sounds = nodecore.sounds("nc_tree_woody")
|
2019-01-04 20:11:04 -05:00
|
|
|
})
|
2019-01-03 23:42:53 -05:00
|
|
|
nodecore.register_craft({
|
2019-02-21 14:37:22 -05:00
|
|
|
label = "assemble wood " .. name:lower(),
|
2019-01-03 23:42:53 -05:00
|
|
|
normal = {y = 1},
|
|
|
|
nodes = {
|
|
|
|
{match = n, replace = "air"},
|
2019-01-04 20:11:04 -05:00
|
|
|
{y = -1, match = modname .. ":staff", replace = "air"},
|
|
|
|
},
|
|
|
|
items = {
|
|
|
|
{y = -1, name = m},
|
2019-01-03 23:42:53 -05:00
|
|
|
}
|
|
|
|
})
|
2019-01-03 23:19:41 -05:00
|
|
|
end
|
2019-02-10 00:20:55 -05:00
|
|
|
|
|
|
|
nodecore.register_craft({
|
|
|
|
label = "carve " .. from,
|
|
|
|
action = "pummel",
|
|
|
|
toolgroups = {choppy = 1},
|
|
|
|
nodes = {
|
|
|
|
{match = from, replace = "air"}
|
|
|
|
},
|
|
|
|
items = {
|
2019-03-02 08:55:15 -05:00
|
|
|
n and {name = n} or nil,
|
|
|
|
sticks and {name = "nc_tree:stick",
|
|
|
|
count = sticks, scatter = 5} or nil
|
2019-02-10 00:20:55 -05:00
|
|
|
}
|
|
|
|
})
|
2018-12-30 19:16:16 -05:00
|
|
|
end
|
|
|
|
|
2019-01-06 17:09:34 -05:00
|
|
|
toolhead("Mallet", modname .. ":plank",
|
2019-01-25 09:26:15 -05:00
|
|
|
"thumpy", 2)
|
2019-01-06 17:09:34 -05:00
|
|
|
toolhead("Spade", modname .. ":toolhead_mallet",
|
|
|
|
"crumbly", 1)
|
|
|
|
toolhead("Hatchet", modname .. ":toolhead_spade",
|
|
|
|
"choppy", 1)
|
|
|
|
toolhead("Pick", modname .. ":toolhead_hatchet",
|
2019-01-25 09:26:15 -05:00
|
|
|
"cracky", 2)
|
2019-12-01 11:08:12 -05:00
|
|
|
toolhead(nil, modname .. ":toolhead_pick",
|
2019-01-06 17:09:34 -05:00
|
|
|
nil, 2)
|