From 230b4dda5d47d8e139ac0e2e817a714306cdf50c Mon Sep 17 00:00:00 2001 From: FaceDeer Date: Fri, 27 Jan 2017 20:47:22 -0700 Subject: [PATCH] Add settings for water flow probabilities too --- init.lua | 15 +++++++++++++-- settingtypes.txt | 36 +++++++++++++++++++++++++++--------- 2 files changed, 40 insertions(+), 11 deletions(-) diff --git a/init.lua b/init.lua index e35bb0f..cdc11a7 100644 --- a/init.lua +++ b/init.lua @@ -80,11 +80,22 @@ river_water = river_water or river_water == nil -- default true local lava = minetest.setting_getbool("dynamic_liquid_lava") lava = lava or lava == nil -- default true +local water_probability = tonumber(minetest.setting_get("dynamic_liquid_water_flow_propability")) +if water_probability == nil then + water_probability = 1 +end + +local river_water_probability = tonumber(minetest.setting_get("dynamic_liquid_river_water_flow_propability")) +if river_water_probability == nil then + river_water_probability = 1 +end + local lava_probability = tonumber(minetest.setting_get("dynamic_liquid_lava_flow_propability")) if lava_probability == nil then lava_probability = 5 end + local springs = minetest.setting_getbool("dynamic_liquid_springs") springs = springs or springs == nil -- default true @@ -114,10 +125,10 @@ if lava then dynamic_liquid.liquid_abm("default:lava_source", "default:lava_flowing", lava_probability) end if water then - dynamic_liquid.liquid_abm("default:water_source", "default:water_flowing", 1) + dynamic_liquid.liquid_abm("default:water_source", "default:water_flowing", water_probability) end if river_water then - dynamic_liquid.liquid_abm("default:river_water_source", "default:river_water_flowing", 1) + dynamic_liquid.liquid_abm("default:river_water_source", "default:river_water_flowing", river_water_probability) end -- register damp clay whether we're going to set the ABM or not, if the user disables this feature we don't want existing diff --git a/settingtypes.txt b/settingtypes.txt index a96fce5..e8fa4c0 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -1,18 +1,36 @@ -#Makes water limited (it doesn't spawn new blocks any more) and causes it to flow dynamically +#Makes water limited (it doesn't spawn new source blocks any more) and causes +#water blocks to move dynamically dynamic_liquid_water (Dynamic water) bool true -#Causes river water to flow dynamically +#Causes river water blocks to move dynamically dynamic_liquid_river_water (Dynamic river water) bool true -#Causes lava to flow dynamically +#Causes lava blocks to move dynamically dynamic_liquid_lava (Dynamic lava) bool true -#Sets the probability of the lava flow calculation per block per second. +#Causes natural clay deposits to act as water sources, seeping new water blocks +#into the space above them. +#Also adds a "spring" block to the creative inventory to serve as an infinite water +#source in creative mode. +dynamic_liquid_springs (Springs) bool true + +[Flow Rates] + +#Sets the probability of water flow per block per second. +#That is, if this is set to 5 then there's a 1/5 chance per second that a water block +#will check if it should move. Increase this value to make water flow slower. +#This value only has an effect if dynamic water is set to true +dynamic_liquid_water_flow_propability (Water flow probability) int 1 1 100 + +#Sets the probability of river water flow per block per second. +#That is, if this is set to 5 then there's a 1/5 chance per second that a river water +#block will check if it should move. Increase this value to make river water flow +#slower. +#This value only has an effect if dynamic river water is set to true +dynamic_liquid_river_water_flow_propability (River water flow probability) int 1 1 100 + +#Sets the probability of lava flow per block per second. #That is, if this is set to 5 then there's a 1/5 chance per second that a lava block -#will check if it should move. Increase this value to make lava flow slower. Set it to -#1 to make lava flow as fast as water does. +#will check if it should move. Increase this value to make lava flow slower. #This value only has an effect if dynamic lava is set to true dynamic_liquid_lava_flow_propability (Lava flow probability) int 5 1 100 - -#Causes natural clay deposits to act as water sources, seeping water into the block above them -dynamic_liquid_springs (Clay springs) bool true \ No newline at end of file