refactor leaves node registrations.
This commit is contained in:
parent
5bc048eb12
commit
06110f157b
1 changed files with 19 additions and 24 deletions
|
@ -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,
|
||||||
|
drop = drop,
|
||||||
|
})
|
||||||
|
end
|
||||||
|
|
||||||
|
reg_leaves("leaves", "Leaves", {
|
||||||
planty = 1,
|
planty = 1,
|
||||||
},
|
|
||||||
})
|
})
|
||||||
blockgame.register_node(modname .. ":leaves_alive", {
|
reg_leaves("leaves_alive", "Growing Leaves", {
|
||||||
description = "Growing Leaves",
|
|
||||||
drawtype = "glasslike",
|
|
||||||
tiles = {
|
|
||||||
modname .. "_leaves_alive.png",
|
|
||||||
},
|
|
||||||
paramtype = "light",
|
|
||||||
sunlight_propagates = true,
|
|
||||||
groups = {
|
|
||||||
planty = 1,
|
planty = 1,
|
||||||
},
|
}, modname .. ":leaves")
|
||||||
drop = modname .. ":leaves",
|
|
||||||
})
|
|
||||||
|
|
||||||
blockgame.reg_simple_node("nut", "Nut", {
|
blockgame.reg_simple_node("nut", "Nut", {
|
||||||
woody = 1,
|
woody = 1,
|
||||||
|
|
Loading…
Reference in a new issue