From 3fce92a9f5aa23335e3bbbec40693da6434fbec8 Mon Sep 17 00:00:00 2001 From: Niklp <89982526+Niklp09@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:52:42 +0200 Subject: [PATCH] Re-add simple spawn settings for some plants (#62) * Red-add simple spawn settings for some plants * Add pl_ --- molehills/init.lua | 4 +++- molehills/settingtypes.txt | 2 ++ pl_sunflowers/init.lua | 4 +++- pl_sunflowers/settingtypes.txt | 7 ++----- youngtrees/init.lua | 4 +++- youngtrees/settingtypes.txt | 2 ++ 6 files changed, 15 insertions(+), 8 deletions(-) create mode 100644 molehills/settingtypes.txt create mode 100644 youngtrees/settingtypes.txt diff --git a/molehills/init.lua b/molehills/init.lua index c6f7824..2c35376 100644 --- a/molehills/init.lua +++ b/molehills/init.lua @@ -4,6 +4,8 @@ -- support for i18n local S = minetest.get_translator("molehills") +local molehill_rarity = minetest.settings:get("molehills.molehill_rarity") or 0.002 + -- Node local mh_cbox = { type = "fixed", @@ -38,7 +40,7 @@ minetest.register_decoration({ decoration = { "molehills:molehill" }, - fill_ratio = 0.002, + fill_ratio = molehill_rarity, y_min = 1, y_max = 40, place_on = { diff --git a/molehills/settingtypes.txt b/molehills/settingtypes.txt new file mode 100644 index 0000000..4a95084 --- /dev/null +++ b/molehills/settingtypes.txt @@ -0,0 +1,2 @@ +# Molehill rarity (higher number -> higher probability) +molehills.molehill_rarity (Molehill rarity) float 0.002 0.0001 1 diff --git a/pl_sunflowers/init.lua b/pl_sunflowers/init.lua index a801ff8..738cab6 100644 --- a/pl_sunflowers/init.lua +++ b/pl_sunflowers/init.lua @@ -1,6 +1,8 @@ -- support for i18n local S = minetest.get_translator("pl_sunflowers") +local sunflower_rarity = minetest.settings:get("pl_sunflowers.sunflower_rarity") or 0.005 + local box = { type="fixed", fixed = { { -0.2, -0.5, -0.2, 0.2, 0.5, 0.2 } }, @@ -40,7 +42,7 @@ minetest.register_decoration({ decoration = { "flowers:sunflower" }, - fill_ratio = 0.005, + fill_ratio = sunflower_rarity, y_min = 1, y_max = 40, param2 = 0, diff --git a/pl_sunflowers/settingtypes.txt b/pl_sunflowers/settingtypes.txt index 67af9e4..0de2098 100644 --- a/pl_sunflowers/settingtypes.txt +++ b/pl_sunflowers/settingtypes.txt @@ -1,5 +1,2 @@ -#Sunflowers maximum count -pl_sunflowers_max_count (Sunflowers maximum count) int 10 1 1000 - -#Sunflowers rarity -pl_sunflowers_rarity (Sunflowers rarity) int 25 0 100 +# Sunflower rarity (higher number -> higher probability) +pl_sunflowers.sunflower_rarity (Sunflower rarity) float 0.005 0.0001 1 diff --git a/youngtrees/init.lua b/youngtrees/init.lua index 91c1bfe..b69da5d 100644 --- a/youngtrees/init.lua +++ b/youngtrees/init.lua @@ -1,6 +1,8 @@ -- support for i18n local S = minetest.get_translator("youngtrees") +local youngtree_rarity = minetest.settings:get("youngtrees.youngtree_rarity") or 0.0005 + minetest.register_node("youngtrees:bamboo", { description = S("Young Bamboo Tree"), drawtype="nodebox", @@ -105,7 +107,7 @@ minetest.register_decoration({ decoration = { "youngtrees:youngtree_bottom" }, - fill_ratio = 0.0005, + fill_ratio = youngtree_rarity, y_min = 1, y_max = 40, param2 = 0, diff --git a/youngtrees/settingtypes.txt b/youngtrees/settingtypes.txt new file mode 100644 index 0000000..de07b5b --- /dev/null +++ b/youngtrees/settingtypes.txt @@ -0,0 +1,2 @@ +# Youngtree rarity (higher number -> higher probability) +youngtrees.youngtree_rarity (Youngtree rarity) float 0.0005 0.0001 1