2023-10-17 13:43:18 +00:00
|
|
|
local modname = minetest.get_current_modname()
|
|
|
|
|
|
|
|
local function reg_log (name, def)
|
|
|
|
def = def or {}
|
|
|
|
|
|
|
|
def.description = def.description or "Log"
|
|
|
|
|
|
|
|
local texture = def.texture or name
|
|
|
|
def.tiles = blockgame.underride(def.tiles, {
|
|
|
|
modname .. "_" .. texture .. "_top.png",
|
|
|
|
modname .. "_" .. texture .. "_top.png",
|
|
|
|
modname .. "_" .. texture .. ".png",
|
|
|
|
})
|
|
|
|
|
|
|
|
def.groups = blockgame.underride(def.groups, {
|
|
|
|
woody = 1,
|
|
|
|
supports_leaves = 1,
|
2023-10-21 08:19:16 +00:00
|
|
|
falling_node = 1,
|
2023-10-17 13:43:18 +00:00
|
|
|
})
|
|
|
|
|
2023-10-17 18:20:42 +00:00
|
|
|
blockgame.register_node(name, def)
|
2023-10-17 13:43:18 +00:00
|
|
|
end
|
|
|
|
|
2023-10-17 14:00:36 +00:00
|
|
|
reg_log("log", {
|
|
|
|
groups = {
|
|
|
|
supports_leaves = 0,
|
2023-10-21 08:19:16 +00:00
|
|
|
falling_node = 0,
|
2023-10-17 14:00:36 +00:00
|
|
|
},
|
|
|
|
})
|
2023-10-17 13:43:18 +00:00
|
|
|
reg_log("log_alive", {
|
|
|
|
groups = {
|
|
|
|
planty = 1,
|
2023-10-19 13:08:53 +00:00
|
|
|
supports_sapling = 1,
|
2023-10-17 13:43:18 +00:00
|
|
|
},
|
|
|
|
texture = "log",
|
|
|
|
drop = modname .. ":log",
|
|
|
|
})
|
|
|
|
reg_log("sapling", {
|
|
|
|
groups = {
|
|
|
|
planty = 1,
|
|
|
|
},
|
|
|
|
drop = modname .. ":log",
|
|
|
|
})
|