[Mod] Moon Flower
Although I've made several code changes to MineTest, I never created my own mod or worked with the Lua API before. I decided to change that today, and start with putting in practice a simple idea I had in mind.
The Moon Flower is an unique flower created for Minetest. It spawns on grass and can be pretty rare to find (5 spawn attempts of 0.1 probability per chunk). Compared to simple decorative flowers, it has a special property: It opens up and casts lighting when under the influence of the moon. This is done by checking that its location is affected by sky light and the time of day is right. This was mainly its purpose, since I thought a plant that spawns naturally and emits lighting at night could be a beautiful sight.
This is also intended to become part of MineTest by default, but I'd rather it's included as part of the complete flowers mod. The texture and code are free to use, and I guess they're licensed GPL or WTFPL if that works best. Since this is my first Lua mod, I'd like to know what you think of the coding too and if my approach is generally correct (some of the code was inspired from VanessaE's old Flowers mod).
Mod available on Github


The Moon Flower is an unique flower created for Minetest. It spawns on grass and can be pretty rare to find (5 spawn attempts of 0.1 probability per chunk). Compared to simple decorative flowers, it has a special property: It opens up and casts lighting when under the influence of the moon. This is done by checking that its location is affected by sky light and the time of day is right. This was mainly its purpose, since I thought a plant that spawns naturally and emits lighting at night could be a beautiful sight.
This is also intended to become part of MineTest by default, but I'd rather it's included as part of the complete flowers mod. The texture and code are free to use, and I guess they're licensed GPL or WTFPL if that works best. Since this is my first Lua mod, I'd like to know what you think of the coding too and if my approach is generally correct (some of the code was inspired from VanessaE's old Flowers mod).
Mod available on Github

