4ea8050c67
by using minetest builtin support for nodes that fall when they're not supported.
63 lines
1.1 KiB
Lua
63 lines
1.1 KiB
Lua
local modname = minetest.get_current_modname()
|
|
|
|
local function reg_leaves (name, def)
|
|
def.description = def.description or name
|
|
def.texture = def.texture or name
|
|
def.tiles = {modname .. "_" .. def.texture .. ".png"}
|
|
|
|
def.drawtype = "glasslike"
|
|
def.paramtype = "light"
|
|
def.sunlight_propagates = true
|
|
|
|
def.groups = blockgame.underride(def.groups, {
|
|
planty = 1,
|
|
extends_leaves_support = 1,
|
|
air_flowable = 1,
|
|
falling_node = 1,
|
|
})
|
|
|
|
blockgame.register_node(modname .. ":" .. name, def)
|
|
end
|
|
|
|
local nutty_drops = {
|
|
max_items = 3,
|
|
items = {
|
|
{
|
|
rarity = 8,
|
|
items = {modname .. ":nut"},
|
|
},
|
|
{
|
|
rarity = 12,
|
|
items = {modname .. ":nut 2"},
|
|
},
|
|
{
|
|
rarity = 1,
|
|
items = {modname .. ":leaves"},
|
|
},
|
|
},
|
|
}
|
|
|
|
reg_leaves("leaves", {
|
|
description = "Leaves",
|
|
})
|
|
reg_leaves("leaves_growing", {
|
|
description = "Growing Leaves",
|
|
texture = "leaves_alive",
|
|
drop = nutty_drops,
|
|
groups = {
|
|
falling_node = 0,
|
|
},
|
|
})
|
|
reg_leaves("leaves_alive", {
|
|
description = "Leaves",
|
|
drop = nutty_drops,
|
|
groups = {
|
|
falling_node = 0,
|
|
},
|
|
})
|
|
reg_leaves("leaves_decomposing", {
|
|
description = "Decomposing Leaves",
|
|
groups = {
|
|
supports_leaves = 0,
|
|
},
|
|
})
|