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, planty = 1,
}) })
blockgame.register_node(modname .. ":leaves", { local function reg_leaves (name, desc, groups, drop)
description = "Leaves", blockgame.register_node(modname .. ":" .. name, {
description = desc,
drawtype = "glasslike", drawtype = "glasslike",
tiles = { tiles = {
modname .. "_leaves.png", modname .. "_" .. name .. ".png",
}, },
paramtype = "light", paramtype = "light",
sunlight_propagates = true, sunlight_propagates = true,
groups = { groups = groups,
planty = 1, drop = drop,
},
}) })
blockgame.register_node(modname .. ":leaves_alive", { end
description = "Growing Leaves",
drawtype = "glasslike", reg_leaves("leaves", "Leaves", {
tiles = {
modname .. "_leaves_alive.png",
},
paramtype = "light",
sunlight_propagates = true,
groups = {
planty = 1, planty = 1,
},
drop = modname .. ":leaves",
}) })
reg_leaves("leaves_alive", "Growing Leaves", {
planty = 1,
}, modname .. ":leaves")
blockgame.reg_simple_node("nut", "Nut", { blockgame.reg_simple_node("nut", "Nut", {
woody = 1, woody = 1,