refactor leaves node registrations.

This commit is contained in:
trans_soup 2023-10-16 20:32:52 +02:00
parent 5bc048eb12
commit 06110f157b

View file

@ -29,31 +29,26 @@ blockgame.reg_simple_node("sapling", "Sapling", {
planty = 1,
})
blockgame.register_node(modname .. ":leaves", {
description = "Leaves",
drawtype = "glasslike",
tiles = {
modname .. "_leaves.png",
},
paramtype = "light",
sunlight_propagates = true,
groups = {
planty = 1,
},
})
blockgame.register_node(modname .. ":leaves_alive", {
description = "Growing Leaves",
drawtype = "glasslike",
tiles = {
modname .. "_leaves_alive.png",
},
paramtype = "light",
sunlight_propagates = true,
groups = {
planty = 1,
},
drop = modname .. ":leaves",
local function reg_leaves (name, desc, groups, drop)
blockgame.register_node(modname .. ":" .. name, {
description = desc,
drawtype = "glasslike",
tiles = {
modname .. "_" .. name .. ".png",
},
paramtype = "light",
sunlight_propagates = true,
groups = groups,
drop = drop,
})
end
reg_leaves("leaves", "Leaves", {
planty = 1,
})
reg_leaves("leaves_alive", "Growing Leaves", {
planty = 1,
}, modname .. ":leaves")
blockgame.reg_simple_node("nut", "Nut", {
woody = 1,