From b9b592af442a226f79ffadd537cdf99c024583e3 Mon Sep 17 00:00:00 2001 From: John Wayne Date: Sun, 17 Mar 2019 22:53:50 +0000 Subject: [PATCH 1/2] more realistic frequency of molehills --- molehills/molehills_settings.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/molehills/molehills_settings.txt b/molehills/molehills_settings.txt index 2079574..1afc592 100644 --- a/molehills/molehills_settings.txt +++ b/molehills/molehills_settings.txt @@ -2,5 +2,5 @@ Molehills_Max_Count = 320 -- absolute maximum number in an area of 80x80x80 nodes -Molehills_Rarity = 87 -- larger values make molehills more rare (100 means chance of 0 %) +Molehills_Rarity = 95 -- larger values make molehills more rare (100 means chance of 0 %) From 229d6aba88ba36a78877cd8f10e487edddccab2f Mon Sep 17 00:00:00 2001 From: Pedro Gimeno Date: Fri, 12 Apr 2019 00:10:44 +0200 Subject: [PATCH 2/2] Fix growth of tree fern saplings While on it, factor out calls to get_node. --- ferns/gianttreefern.lua | 12 +++++++----- ferns/treefern.lua | 12 +++++++----- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/ferns/gianttreefern.lua b/ferns/gianttreefern.lua index a1276b8..847cea2 100644 --- a/ferns/gianttreefern.lua +++ b/ferns/gianttreefern.lua @@ -14,10 +14,10 @@ local S = plantlife_i18n.gettext -- lot of code, lot to load abstract_ferns.grow_giant_tree_fern = function(pos) - local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} - if minetest.get_node(pos_01).name ~= "air" - and minetest.get_node(pos_01).name ~= "ferns:sapling_giant_tree_fern" - and minetest.get_node(pos_01).name ~= "default:junglegrass" then + local pos_aux = {x = pos.x, y = pos.y + 1, z = pos.z} + local name = minetest.get_node(pos_aux).name + if name ~= "air" and name ~= "ferns:sapling_giant_tree_fern" + and name ~= "default:junglegrass" then return end @@ -64,7 +64,9 @@ abstract_ferns.grow_giant_tree_fern = function(pos) local brk = false for i = 1, size-3 do - if minetest.get_node({x = pos.x, y = pos.y + i, z = pos.z}).name ~= "air" then + pos_aux.y = pos.y + i + local name = minetest.get_node(pos_aux).name + if not (name == "air" or (i == 1 and name == "ferns:sapling_giant_tree_fern")) then brk = true break end diff --git a/ferns/treefern.lua b/ferns/treefern.lua index 41d49f8..f1ae9b7 100644 --- a/ferns/treefern.lua +++ b/ferns/treefern.lua @@ -13,10 +13,10 @@ assert(abstract_ferns.config.enable_treefern == true) abstract_ferns.grow_tree_fern = function(pos) - local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z} - if minetest.get_node(pos_01).name ~= "air" - and minetest.get_node(pos_01).name ~= "ferns:sapling_tree_fern" - and minetest.get_node(pos_01).name ~= "default:junglegrass" then + local pos_aux = {x = pos.x, y = pos.y + 1, z = pos.z} + local name = minetest.get_node(pos_aux).name + if name ~= "air" and name ~= "ferns:sapling_tree_fern" + and name ~= "default:junglegrass" then return end @@ -30,7 +30,9 @@ abstract_ferns.grow_tree_fern = function(pos) local i = 1 local brk = false while (i < size) do - if minetest.get_node({x = pos.x, y = pos.y + i, z = pos.z}).name ~= "air" then + pos_aux.y = pos.y + i + name = minetest.get_node(pos_aux).name + if not (name == "air" or (i == 1 and name == "ferns:sapling_tree_fern")) then brk = true break end