ethereal/leaves.lua

453 lines
11 KiB
Lua
Raw Normal View History

2016-06-09 17:08:34 +03:00
local S = ethereal.intllib
-- set leaftype (value inside init.lua)
local leaftype = "plantlike"
if ethereal.leaftype ~= 0 then
2014-11-09 22:17:41 +03:00
leaftype = "allfaces_optional"
end
-- default apple tree leaves
minetest.override_item("default:leaves", {
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
inventory_image = "default_leaves.png",
wield_image = "default_leaves.png",
walkable = ethereal.leafwalk,
})
2014-11-09 22:17:41 +03:00
2018-06-07 11:37:19 +03:00
-- ability to craft big tree sapling
minetest.register_craft({
recipe = {{"default:sapling", "default:sapling", "default:sapling"}},
output = "ethereal:big_tree_sapling"
})
-- default jungle tree leaves
minetest.override_item("default:jungleleaves", {
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
inventory_image = "default_jungleleaves.png",
wield_image = "default_jungleleaves.png",
walkable = ethereal.leafwalk,
})
-- default pine tree leaves
minetest.override_item("default:pine_needles", {
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
inventory_image = "default_pine_needles.png",
wield_image = "default_pine_needles.png",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
{items = {"default:pine_sapling"}, rarity = 20},
{items = {"ethereal:pine_nuts"}, rarity = 5},
{items = {"default:pine_needles"}}
2014-11-09 22:17:41 +03:00
}
},
})
-- default acacia tree leaves
minetest.override_item("default:acacia_leaves", {
drawtype = leaftype,
inventory_image = "default_acacia_leaves.png",
wield_image = "default_acacia_leaves.png",
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
walkable = ethereal.leafwalk,
})
-- default aspen tree leaves
minetest.override_item("default:aspen_leaves", {
drawtype = leaftype,
inventory_image = "default_aspen_leaves.png",
wield_image = "default_aspen_leaves.png",
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
walkable = ethereal.leafwalk,
})
2014-11-09 22:17:41 +03:00
-- willow twig
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:willow_twig", {
2016-06-09 17:08:34 +03:00
description = S("Willow Twig"),
2014-11-09 22:17:41 +03:00
drawtype = "plantlike",
tiles = {"willow_twig.png"},
inventory_image = "willow_twig.png",
2015-11-23 23:43:48 +03:00
wield_image = "willow_twig.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
2014-11-09 22:17:41 +03:00
waving = 1,
2015-07-04 14:22:39 +03:00
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
2015-07-04 14:22:39 +03:00
{items = {"ethereal:willow_sapling"}, rarity = 50},
{items = {"ethereal:willow_twig"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- redwood leaves
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:redwood_leaves", {
2016-06-09 17:08:34 +03:00
description = S("Redwood Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
2014-11-09 22:17:41 +03:00
tiles = {"redwood_leaves.png"},
inventory_image = "redwood_leaves.png",
2015-11-23 23:43:48 +03:00
wield_image = "redwood_leaves.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
waving = 1,
2015-07-04 14:22:39 +03:00
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
2015-07-04 14:22:39 +03:00
{items = {"ethereal:redwood_sapling"}, rarity = 50},
{items = {"ethereal:redwood_leaves"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- orange tree leaves
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:orange_leaves", {
2016-06-09 17:08:34 +03:00
description = S("Orange Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
2014-11-09 22:17:41 +03:00
tiles = {"orange_leaves.png"},
inventory_image = "orange_leaves.png",
2015-11-23 23:43:48 +03:00
wield_image = "orange_leaves.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
waving = 1,
2015-07-04 14:22:39 +03:00
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
{items = {"ethereal:orange_tree_sapling"}, rarity = 15},
2015-07-04 14:22:39 +03:00
{items = {"ethereal:orange_leaves"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- banana tree leaves
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:bananaleaves", {
2016-06-09 17:08:34 +03:00
description = S("Banana Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
2014-11-09 22:17:41 +03:00
tiles = {"banana_leaf.png"},
inventory_image = "banana_leaf.png",
2015-11-23 23:43:48 +03:00
wield_image = "banana_leaf.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
waving = 1,
2015-07-04 14:22:39 +03:00
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
{items = {"ethereal:banana_tree_sapling"}, rarity = 10},
2015-07-04 14:22:39 +03:00
{items = {"ethereal:bananaleaves"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- healing tree leaves
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:yellowleaves", {
2016-06-09 17:08:34 +03:00
description = S("Healing Tree Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
2014-11-09 22:17:41 +03:00
tiles = {"yellow_leaves.png"},
inventory_image = "yellow_leaves.png",
2015-11-23 23:43:48 +03:00
wield_image = "yellow_leaves.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
waving = 1,
2015-07-04 14:22:39 +03:00
groups = {snappy = 3, leafdecay = 3, leaves = 1},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
2015-07-04 14:22:39 +03:00
{items = {"ethereal:yellow_tree_sapling"}, rarity = 50},
{items = {"ethereal:yellowleaves"}}
2014-11-09 22:17:41 +03:00
}
},
-- one leaf heals half a heart when eaten
2014-11-09 22:17:41 +03:00
on_use = minetest.item_eat(1),
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
light_source = 9,
})
-- palm tree leaves
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:palmleaves", {
2016-06-09 17:08:34 +03:00
description = S("Palm Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
2014-11-09 22:17:41 +03:00
tiles = {"moretrees_palm_leaves.png"},
inventory_image = "moretrees_palm_leaves.png",
2015-11-23 23:43:48 +03:00
wield_image = "moretrees_palm_leaves.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
waving = 1,
2015-07-04 14:22:39 +03:00
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
2016-07-12 22:27:07 +03:00
{items = {"ethereal:palm_sapling"}, rarity = 10},
2015-07-04 14:22:39 +03:00
{items = {"ethereal:palmleaves"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
})
-- birch tree leaves
minetest.register_node("ethereal:birch_leaves", {
2016-06-09 17:08:34 +03:00
description = S("Birch Leaves"),
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
tiles = {"moretrees_birch_leaves.png"},
inventory_image = "moretrees_birch_leaves.png",
2015-11-23 23:43:48 +03:00
wield_image = "moretrees_birch_leaves.png",
paramtype = "light",
walkable = ethereal.leafwalk,
waving = 1,
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
drop = {
max_items = 1,
items = {
{items = {"ethereal:birch_sapling"}, rarity = 20},
{items = {"ethereal:birch_leaves"}}
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- frost tree leaves
minetest.register_node("ethereal:frost_leaves", {
2016-06-09 17:08:34 +03:00
description = S("Frost Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
tiles = {"ethereal_frost_leaves.png"},
inventory_image = "ethereal_frost_leaves.png",
wield_image = "ethereal_frost_leaves.png",
paramtype = "light",
walkable = ethereal.leafwalk,
waving = 1,
groups = {snappy = 3, leafdecay = 3, leaves = 1, puts_out_fire = 1},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
{items = {"ethereal:frost_tree_sapling"}, rarity = 15},
{items = {"ethereal:frost_leaves"}}
2014-11-09 22:17:41 +03:00
}
},
light_source = 9,
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- bamboo stalk leaves
minetest.register_node("ethereal:bamboo_leaves", {
2016-06-09 17:08:34 +03:00
description = S("Bamboo Leaves"),
2014-11-09 22:17:41 +03:00
drawtype = leaftype,
2017-02-12 14:44:46 +03:00
visual_scale = 1.4,
tiles = {"bamboo_leaves.png"},
inventory_image = "bamboo_leaves.png",
wield_image = "bamboo_leaves.png",
2014-11-09 22:17:41 +03:00
paramtype = "light",
walkable = ethereal.leafwalk,
2014-11-09 22:17:41 +03:00
waving = 1,
groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
{items = {"ethereal:bamboo_sprout"}, rarity = 10},
{items = {"ethereal:bamboo_leaves"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_leaves_defaults(),
after_place_node = default.after_place_leaves,
2014-11-09 22:17:41 +03:00
})
-- mushroom tops
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:mushroom", {
2016-06-09 17:08:34 +03:00
description = S("Mushroom Cap"),
2014-11-09 22:17:41 +03:00
tiles = {"mushroom_block.png"},
2015-07-04 14:22:39 +03:00
groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
2014-11-09 22:17:41 +03:00
drop = {
max_items = 1,
items = {
2015-07-04 14:22:39 +03:00
{items = {"ethereal:mushroom_sapling"}, rarity = 20},
{items = {"ethereal:mushroom"}}
2014-11-09 22:17:41 +03:00
}
},
sounds = default.node_sound_wood_defaults(),
})
minetest.register_craft({
type = "fuel",
recipe = "ethereal:mushroom",
burntime = 10,
})
-- mushroom pore (spongelike material found inside giant shrooms)
2014-11-09 22:17:41 +03:00
minetest.register_node("ethereal:mushroom_pore", {
2016-06-09 17:08:34 +03:00
description = S("Mushroom Pore"),
2014-11-09 22:17:41 +03:00
tiles = {"mushroom_pore.png"},
2015-07-04 14:22:39 +03:00
groups = {
snappy = 3, cracky = 3, choppy = 3, oddly_breakable_by_hand = 3,
2015-08-10 18:57:12 +03:00
flammable = 2, disable_jump = 1, fall_damage_add_percent = -100
2015-07-04 14:22:39 +03:00
},
2014-11-09 22:17:41 +03:00
sounds = default.node_sound_dirt_defaults(),
})
minetest.register_craft({
type = "fuel",
recipe = "ethereal:mushroom_pore",
burntime = 3,
})
-- hedge block
minetest.register_node("ethereal:bush", {
2016-06-09 17:08:34 +03:00
description = S("Bush"),
tiles = {"ethereal_bush.png"},
walkable = true,
groups = {snappy = 3, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craft({
output = "ethereal:bush",
recipe = {
{"group:leaves", "group:leaves", "group:leaves"},
{"group:leaves", "ethereal:bamboo_leaves", "group:leaves"},
{"group:leaves", "group:leaves", "group:leaves"},
}
})
minetest.register_craft({
type = "fuel",
recipe = "ethereal:bush",
burntime = 1,
})
-- bush block #2
minetest.register_node("ethereal:bush2", {
drawtype = "allfaces_optional",
2016-06-09 17:08:34 +03:00
description = S("Bush #2"),
tiles = {"default_aspen_leaves.png"},
paramtype = "light",
walkable = true,
groups = {snappy = 3, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craft({
output = "ethereal:bush2",
recipe = {
{"group:leaves", "group:leaves", "group:leaves"},
{"group:leaves", "default:aspen_leaves", "group:leaves"},
{"group:leaves", "group:leaves", "group:leaves"},
}
})
minetest.register_craft({
type = "fuel",
recipe = "ethereal:bush2",
burntime = 1,
})
-- bush block #3
minetest.register_node("ethereal:bush3", {
drawtype = "allfaces_optional",
2016-06-09 17:08:34 +03:00
description = S("Bush #3"),
tiles = {"default_pine_needles.png"},
paramtype = "light",
walkable = true,
groups = {snappy = 3, flammable = 2},
sounds = default.node_sound_leaves_defaults(),
})
minetest.register_craft({
output = "ethereal:bush3",
recipe = {
{"group:leaves", "group:leaves", "group:leaves"},
{"group:leaves", "default:pine_needles", "group:leaves"},
{"group:leaves", "group:leaves", "group:leaves"},
}
2015-11-23 23:43:48 +03:00
})
minetest.register_craft({
type = "fuel",
recipe = "ethereal:bush3",
burntime = 1,
})
-- compatibility check for new mt version with leafdecay function
if minetest.registered_nodes["default:dirt_with_rainforest_litter"] then
default.register_leafdecay({
trunks = {"default:tree"},
leaves = {"default:apple", "default:leaves", "ethereal:orange", "ethereal:orange_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:willow_trunk"},
leaves = {"ethereal:willow_twig"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:redwood_trunk"},
leaves = {"ethereal:redwood_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:frost_tree"},
leaves = {"ethereal:frost_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:yellow_trunk"},
leaves = {"ethereal:yellowleaves", "ethereal:golden_apple"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:palm_trunk"},
leaves = {"ethereal:palmleaves", "ethereal:coconut"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:banana_trunk"},
leaves = {"ethereal:bananaleaves", "ethereal:banana"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:birch_trunk"},
leaves = {"ethereal:birch_leaves"},
radius = 3
})
default.register_leafdecay({
trunks = {"ethereal:bamboo"},
leaves = {"ethereal:bamboo_leaves"},
2017-04-23 13:04:34 +03:00
radius = 2
})
end