123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504 |
- local S = ethereal.intllib
- -- set leaftype (value inside init.lua)
- local leaftype = "plantlike"
- if ethereal.leaftype ~= 0 then
- leaftype = "allfaces_optional"
- end
- -- default apple tree leaves
- minetest.override_item("default:leaves", {
- drawtype = leaftype,
- visual_scale = 1.4,
- inventory_image = "default_leaves.png",
- wield_image = "default_leaves.png",
- walkable = ethereal.leafwalk,
- })
- -- 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", {
- drawtype = leaftype,
- 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,
- visual_scale = 1.4,
- inventory_image = "default_pine_needles.png",
- wield_image = "default_pine_needles.png",
- walkable = ethereal.leafwalk,
- drop = {
- max_items = 1,
- items = {
- {items = {"default:pine_sapling"}, rarity = 20},
- {items = {"ethereal:pine_nuts"}, rarity = 5},
- {items = {"default:pine_needles"}}
- }
- },
- })
- -- default acacia tree leaves
- minetest.override_item("default:acacia_leaves", {
- drawtype = leaftype,
- inventory_image = "default_acacia_leaves.png",
- wield_image = "default_acacia_leaves.png",
- 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",
- visual_scale = 1.4,
- walkable = ethereal.leafwalk,
- })
- -- willow twig
- minetest.register_node("ethereal:willow_twig", {
- description = S("Willow Twig"),
- drawtype = "plantlike",
- tiles = {"willow_twig.png"},
- inventory_image = "willow_twig.png",
- wield_image = "willow_twig.png",
- paramtype = "light",
- walkable = ethereal.leafwalk,
- visual_scale = 1.4,
- waving = 1,
- groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
- drop = {
- max_items = 1,
- items = {
- {items = {"ethereal:willow_sapling"}, rarity = 50},
- {items = {"ethereal:willow_twig"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- redwood leaves
- minetest.register_node("ethereal:redwood_leaves", {
- description = S("Redwood Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"redwood_leaves.png"},
- inventory_image = "redwood_leaves.png",
- wield_image = "redwood_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:redwood_sapling"}, rarity = 50},
- {items = {"ethereal:redwood_leaves"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- orange tree leaves
- minetest.register_node("ethereal:orange_leaves", {
- description = S("Orange Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"orange_leaves.png"},
- inventory_image = "orange_leaves.png",
- wield_image = "orange_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:orange_tree_sapling"}, rarity = 15},
- {items = {"ethereal:orange_leaves"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- banana tree leaves
- minetest.register_node("ethereal:bananaleaves", {
- description = S("Banana Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"banana_leaf.png"},
- inventory_image = "banana_leaf.png",
- wield_image = "banana_leaf.png",
- paramtype = "light",
- walkable = ethereal.leafwalk,
- waving = 1,
- groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
- drop = {
- max_items = 1,
- items = {
- {items = {"ethereal:banana_tree_sapling"}, rarity = 10},
- {items = {"ethereal:bananaleaves"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- healing tree leaves
- minetest.register_node("ethereal:yellowleaves", {
- description = S("Healing Tree Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"yellow_leaves.png"},
- inventory_image = "yellow_leaves.png",
- wield_image = "yellow_leaves.png",
- paramtype = "light",
- walkable = ethereal.leafwalk,
- waving = 1,
- groups = {snappy = 3, leafdecay = 3, leaves = 1},
- drop = {
- max_items = 1,
- items = {
- {items = {"ethereal:yellow_tree_sapling"}, rarity = 50},
- {items = {"ethereal:yellowleaves"}}
- }
- },
- -- one leaf heals half a heart when eaten
- on_use = minetest.item_eat(1),
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- light_source = 9,
- })
- -- palm tree leaves
- minetest.register_node("ethereal:palmleaves", {
- description = S("Palm Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"moretrees_palm_leaves.png"},
- inventory_image = "moretrees_palm_leaves.png",
- wield_image = "moretrees_palm_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:palm_sapling"}, rarity = 10},
- {items = {"ethereal:palmleaves"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- birch tree leaves
- minetest.register_node("ethereal:birch_leaves", {
- description = S("Birch Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"moretrees_birch_leaves.png"},
- inventory_image = "moretrees_birch_leaves.png",
- 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,
- })
- -- frost tree leaves
- minetest.register_node("ethereal:frost_leaves", {
- description = S("Frost Leaves"),
- drawtype = leaftype,
- 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},
- drop = {
- max_items = 1,
- items = {
- {items = {"ethereal:frost_tree_sapling"}, rarity = 15},
- {items = {"ethereal:frost_leaves"}}
- }
- },
- light_source = 9,
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- bamboo stalk leaves
- minetest.register_node("ethereal:bamboo_leaves", {
- description = S("Bamboo Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"bamboo_leaves.png"},
- inventory_image = "bamboo_leaves.png",
- wield_image = "bamboo_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:bamboo_sprout"}, rarity = 10},
- {items = {"ethereal:bamboo_leaves"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- sakura leaves
- minetest.register_node("ethereal:sakura_leaves", {
- description = S("Sakura Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"ethereal_sakura_leaves.png"},
- inventory_image = "ethereal_sakura_leaves.png",
- wield_image = "ethereal_sakura_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:sakura_sapling"}, rarity = 30},
- {items = {"ethereal:sakura_leaves"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- minetest.register_node("ethereal:sakura_leaves2", {
- description = S("Sakura Leaves"),
- drawtype = leaftype,
- visual_scale = 1.4,
- tiles = {"ethereal_sakura_leaves2.png"},
- inventory_image = "ethereal_sakura_leaves2.png",
- wield_image = "ethereal_sakura_leaves2.png",
- paramtype = "light",
- walkable = ethereal.leafwalk,
- waving = 1,
- groups = {snappy = 3, leafdecay = 3, leaves = 1, flammable = 2},
- drop = {
- max_items = 1,
- items = {
- {items = {"ethereal:sakura_sapling"}, rarity = 30},
- {items = {"ethereal:sakura_leaves2"}}
- }
- },
- sounds = default.node_sound_leaves_defaults(),
- after_place_node = default.after_place_leaves,
- })
- -- mushroom tops
- minetest.register_node("ethereal:mushroom", {
- description = S("Mushroom Cap"),
- tiles = {"mushroom_block.png"},
- groups = {choppy = 2, oddly_breakable_by_hand = 1, flammable = 2},
- drop = {
- max_items = 1,
- items = {
- {items = {"ethereal:mushroom_sapling"}, rarity = 20},
- {items = {"ethereal:mushroom"}}
- }
- },
- sounds = default.node_sound_wood_defaults(),
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "ethereal:mushroom",
- burntime = 10,
- })
- -- mushroom pore (spongelike material found inside giant shrooms)
- minetest.register_node("ethereal:mushroom_pore", {
- description = S("Mushroom Pore"),
- tiles = {"mushroom_pore.png"},
- groups = {
- snappy = 3, cracky = 3, choppy = 3, oddly_breakable_by_hand = 3,
- flammable = 2, disable_jump = 1, fall_damage_add_percent = -100
- },
- sounds = default.node_sound_dirt_defaults(),
- })
- minetest.register_craft({
- type = "fuel",
- recipe = "ethereal:mushroom_pore",
- burntime = 3,
- })
- -- hedge block
- minetest.register_node("ethereal:bush", {
- 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",
- 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",
- 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"},
- }
- })
- 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"},
- radius = 2
- })
- default.register_leafdecay({
- trunks = {"ethereal:sakura_trunk"},
- leaves = {"ethereal:sakura_leaves", "ethereal:sakura_leaves2"},
- radius = 3
- })
- end
|