diff --git a/README.md b/README.md index aecc4a3..ae47623 100644 --- a/README.md +++ b/README.md @@ -56,6 +56,7 @@ Also those more as optional: | ethereal.lilywalk | Lilypads are walkable | bool | true | | ethereal.xcraft | Enable X-Craft cheats | bool | true | | ethereal.flight | Enable Flight Potion | bool | true | +| ethereal.leaf_particles | Enable falling lead particles | bool | true | | ethereal.glacier | Glacier biome, 1=on / 0=off | int | 1 | | ethereal.bambo | Bamboo biome, 1=on / 0=off | int | 1 | | ethereal.mesa | Mesa biome, 1=on / 0=off | int | 1 | @@ -104,6 +105,7 @@ who helped make this mod bigger and better throughout it's release :) - Tidy and tweak code to run on Minetest 5.1 and above - Replace 32px textures with 16px variants so items do not look mismatched - Add new biome layout so that specific biomes aren't too large or small + - Add falling leaf particles with setting to disable ### 1.31 - Fix fishing biome checks diff --git a/leaves.lua b/leaves.lua index 1c59e0d..30d4826 100644 --- a/leaves.lua +++ b/leaves.lua @@ -602,3 +602,76 @@ decay({"ethereal:olive_trunk"}, {"ethereal:olive_leaves", "ethereal:olive"}, 3) decay({"ethereal:mushroom_trunk"}, {"ethereal:mushroom", "ethereal:mushroom_brown", "ethereal:mushroom_pore", "ethereal:lightstring"}, 4) + +if minetest.settings:get_bool("ethereal.leaf_particles") ~= false then + + -- falling leaf effect + + local leaf_list = { + {"ethereal:frost_leaves", "331b37", 9}, + {"ethereal:bananaleaves", "28581e"}, + {"ethereal:lemon_leaves", "507c1e"}, + {"ethereal:olive_leaves", "416531"}, + {"ethereal:orange_leaves", "1a3b1b"}, + {"ethereal:redwood_leaves", "15342a"}, + {"ethereal:sakura_leaves", "c281a9"}, + {"ethereal:sakura_leaves2", "d4cbac"}, + {"ethereal:willow_twig", "0b9445"}, + {"ethereal:yellowleaves", "8b5f00", 9}, + {"ethereal:birch_leaves", "274527"}, + {"ethereal:palmleaves", "2b6000"}, + {"ethereal:bamboo_leaves", "445811"}, + {"default:acacia_leaves", "296600"}, + {"default:aspen_leaves", "395d16"}, + {"default:jungleleaves", "141e10"}, + {"default:pine_needles", "00280e"}, + {"default:leaves", "223a20"} + } + + minetest.register_abm({ + label = "Ethereal falling leaves", + nodenames = {"group:leaves"}, + neighbors = {"air"}, + interval = 7, + chance = 50, + catch_up = false, + + action = function(pos, node) + + local tex = "ethereal_falling_leaf.png" + local glow = nil + local can_fall = false + + for n = 1, #leaf_list do + + if node.name == leaf_list[n][1] then + tex = tex .. "^[multiply:#" .. leaf_list[n][2] .. "70" + glow = leaf_list[n][3] + can_fall = true ; break + end + end + + if can_fall then + + minetest.add_particlespawner({ + amount = 2, + time = 2, + minpos = {x = pos.x - 1, y = pos.y - 1, z = pos.z - 1}, + maxpos = {x = pos.x + 1, y = pos.y, z = pos.z + 1}, + minvel = {x = -0.8, y = -1, z = -0.8}, + maxvel = {x = 0.8, y = -3, z = 0.8}, + minacc = {x = -0.1, y = -1, z = -0.1}, + mixacc = {x = 0.2, y = -3, z = 0.2}, + minexptime = 2, + maxexptime = 10, + minsize = 0.5, + maxsize = 1.5, + collisiondetection = false, + texture = tex, + vertical = true, + glow = glow + }) + end + end + }) +end diff --git a/settingtypes.txt b/settingtypes.txt index d1b3fb0..0c64fdc 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -37,6 +37,7 @@ ethereal.tundra (Tundra biome, 1 = Enable / 0 = Disable) int 1 ethereal.mediterranean (Mediterranean biome, 1 = Enable / 0 = Disable) int 1 ethereal.logs (Tree log decor, 1 = Enable / 0 = Disable) int 1 ethereal.wood_rotate (Enable directional placement of wood) bool true +ethereal.leaf_particles (Enable falling leaf particles) bool true ethereal.flightpotion_duration (Flight Potion Duration) int 300 diff --git a/textures/ethereal_falling_leaf.png b/textures/ethereal_falling_leaf.png new file mode 100644 index 0000000..afeeaab Binary files /dev/null and b/textures/ethereal_falling_leaf.png differ diff --git a/textures/moretrees_acacia_leaves.png b/textures/moretrees_acacia_leaves.png deleted file mode 100644 index 08cf399..0000000 Binary files a/textures/moretrees_acacia_leaves.png and /dev/null differ