From 3a25e79efe1203ea6b37e19b337e94662b641561 Mon Sep 17 00:00:00 2001 From: TenPlus1 Date: Sun, 13 Dec 2015 10:30:17 +0000 Subject: Fire Flowers spread --- README.md | 1 + flowers.lua | 28 +++++++++++++++++++++++++++- init.lua | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 5e2a6c9..0e1d71c 100644 --- a/README.md +++ b/README.md @@ -16,6 +16,7 @@ Ethereal v7 Mapgen mod for Minetest - Dirt with dry grass turns into green grass when near water - Ice or snow above sea level melts into river water - Disabling ethereal biomes no longer shows error messages +- Fire Flowers re-generate, can also be made into Fire Dust ### 1.18 diff --git a/flowers.lua b/flowers.lua index df3646e..21c6dcc 100644 --- a/flowers.lua +++ b/flowers.lua @@ -3,7 +3,7 @@ minetest.register_abm({ nodenames = {"group:flora"}, neighbors = {"group:soil"}, interval = 25, - chance = 10, + chance = 15, catch_up = false, action = function(pos, node) @@ -45,6 +45,32 @@ minetest.register_abm({ return + elseif num > 3 + and node.name == "ethereal:dry_shrub" then + + local grass = minetest.find_nodes_in_area_under_air( + pos0, pos1, {"ethereal:dry_shrub"}) + + local fflower = minetest.find_nodes_in_area_under_air( + pos0, pos1, {"ethereal:fire_flower"}) + + if #grass > 4 + and #fflower < 1 then + + grass = grass[math.random(#grass)] + + grass.y = grass.y - 1 + + if minetest.get_node(grass).name == "ethereal:fiery_dirt" then + + grass.y = grass.y + 1 + + minetest.set_node(grass, {name = "ethereal:fire_flower"}) + end + end + + return + elseif num > 3 then return end diff --git a/init.lua b/init.lua index 2af7328..8e2c319 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,6 @@ --[[ - Minetest Ethereal Mod 1.19 (3rd December 2015) + Minetest Ethereal Mod 1.19 (13th December 2015) Created by ChinChow -- cgit v1.2.3