57 lines
1.8 KiB
Lua
Raw Normal View History

2019-02-20 00:40:55 -05:00
-- LUALOCALS < ---------------------------------------------------------
local minetest, nodecore
2019-02-28 23:16:07 -05:00
= minetest, nodecore
2019-02-20 00:40:55 -05:00
-- LUALOCALS > ---------------------------------------------------------
local modname = minetest.get_current_modname()
local bark = "nc_tree_tree_side.png^[mask:nc_api_storebox_frame.png"
local plank = modname .. "_plank.png^(" .. bark .. ")"
2019-02-23 20:35:22 -05:00
2019-02-20 00:40:55 -05:00
minetest.register_node(modname .. ":shelf", {
description = "Wooden Shelf",
tiles = {bark, plank, plank},
selection_box = nodecore.fixedbox(),
collision_box = nodecore.fixedbox(),
2019-02-20 00:40:55 -05:00
groups = {
choppy = 1,
visinv = 1,
flammable = 2,
fire_fuel = 3,
storebox = 1,
totable = 1
2019-02-20 00:40:55 -05:00
},
paramtype = "light",
sounds = nodecore.sounds("nc_tree_woody"),
storebox_access = function(pt) return pt.above.y == pt.under.y end,
on_ignite = function(pos)
2019-12-01 16:54:15 -05:00
if minetest.get_node(pos).name == modname .. ":shelf" then
return nodecore.stack_get(pos)
end
2019-02-20 00:40:55 -05:00
end
})
nodecore.register_craft({
2019-02-21 14:59:41 -05:00
label = "assemble wood shelf",
norotate = true,
2019-02-20 00:40:55 -05:00
nodes = {
{match = modname .. ":plank", replace = "air"},
{x = -1, z = -1, match = modname .. ":frame", replace = modname .. ":shelf"},
{x = 1, z = -1, match = modname .. ":frame", replace = modname .. ":shelf"},
{x = -1, z = 1, match = modname .. ":frame", replace = modname .. ":shelf"},
{x = 1, z = 1, match = modname .. ":frame", replace = modname .. ":shelf"},
2019-02-20 00:40:55 -05:00
}
})
nodecore.register_craft({
2019-02-21 14:59:41 -05:00
label = "assemble wood shelf",
norotate = true,
nodes = {
{match = modname .. ":plank", replace = "air"},
{x = 0, z = -1, match = modname .. ":frame", replace = modname .. ":shelf"},
{x = 0, z = 1, match = modname .. ":frame", replace = modname .. ":shelf"},
{x = -1, z = 0, match = modname .. ":frame", replace = modname .. ":shelf"},
{x = 1, z = 0, match = modname .. ":frame", replace = modname .. ":shelf"},
}
})