2017-01-26 21:12:13 +00:00
|
|
|
dynamic_liquid = {} -- global table to expose liquid_abm for other mods' usage
|
2017-01-23 06:45:00 +00:00
|
|
|
|
2022-09-17 23:53:19 +00:00
|
|
|
dynamic_liquid.config = {}
|
|
|
|
|
|
|
|
dynamic_liquid.config.water = minetest.settings:get_bool("dynamic_liquid_water", true)
|
|
|
|
dynamic_liquid.config.river_water = minetest.settings:get_bool("dynamic_liquid_river_water", false)
|
|
|
|
dynamic_liquid.config.lava = minetest.settings:get_bool("dynamic_liquid_lava", true)
|
|
|
|
|
|
|
|
dynamic_liquid.config.water_probability = tonumber(minetest.settings:get("dynamic_liquid_water_flow_propability")) or 1
|
|
|
|
dynamic_liquid.config.river_water_probability = tonumber(minetest.settings:get("dynamic_liquid_river_water_flow_propability")) or 1
|
|
|
|
dynamic_liquid.config.lava_probability = tonumber(minetest.settings:get("dynamic_liquid_lava_flow_propability")) or 5
|
|
|
|
dynamic_liquid.config.water_level = tonumber(minetest.get_mapgen_setting("water_level")) or 0
|
|
|
|
dynamic_liquid.config.springs = minetest.settings:get_bool("dynamic_liquid_springs", true)
|
|
|
|
dynamic_liquid.config.flow_through = minetest.settings:get_bool("dynamic_liquid_flow_through", true)
|
|
|
|
dynamic_liquid.config.mapgen_prefill = minetest.settings:get_bool("dynamic_liquid_mapgen_prefill", true)
|
|
|
|
dynamic_liquid.config.disable_flow_above = tonumber(minetest.settings:get("dynamic_liquid_disable_flow_above")) -- this one can be nil
|
|
|
|
dynamic_liquid.config.displace_liquid = minetest.settings:get_bool("dynamic_liquid_displace_liquid", true)
|
|
|
|
dynamic_liquid.config.new_lava_cooling = minetest.settings:get_bool("dynamic_liquid_new_lava_cooling", true)
|
|
|
|
dynamic_liquid.config.falling_obsidian = minetest.settings:get_bool("dynamic_liquid_falling_obsidian", false)
|
|
|
|
|
2017-02-18 05:28:52 +00:00
|
|
|
dynamic_liquid.registered_liquids = {} -- used by the flow-through node abm
|
|
|
|
dynamic_liquid.registered_liquid_neighbors = {}
|
|
|
|
|
2022-09-17 23:53:19 +00:00
|
|
|
dynamic_liquid.mapgen_data = {} -- shared by various mapgens
|
2017-02-18 05:28:52 +00:00
|
|
|
|
|
|
|
|
2020-01-31 08:42:23 +00:00
|
|
|
local function deep_copy(table_in)
|
|
|
|
local table_out = {}
|
|
|
|
for index, value in pairs(table_in) do
|
|
|
|
if type(value) == "table" then
|
|
|
|
table_out[index] = deep_copy(value)
|
|
|
|
else
|
|
|
|
table_out[index] = value
|
|
|
|
end
|
|
|
|
end
|
|
|
|
return table_out
|
|
|
|
end
|
2022-09-17 23:53:19 +00:00
|
|
|
-- utility function used when making clay into springs
|
|
|
|
dynamic_liquid.duplicate_def = function (name)
|
2017-02-14 06:50:07 +00:00
|
|
|
local old_def = minetest.registered_nodes[name]
|
2020-01-31 08:42:23 +00:00
|
|
|
return deep_copy(old_def)
|
2017-02-14 06:50:07 +00:00
|
|
|
end
|
|
|
|
|
2022-09-17 23:53:19 +00:00
|
|
|
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
2017-03-17 21:20:19 +00:00
|
|
|
|
2022-09-17 23:53:19 +00:00
|
|
|
dofile(modpath.."/cooling_lava.lua")
|
|
|
|
dofile(modpath.."/dynamic_liquids.lua")
|
|
|
|
dofile(modpath.."/flow_through.lua")
|
|
|
|
dofile(modpath.."/springs.lua")
|
|
|
|
dofile(modpath.."/mapgen_prefill.lua")
|
2022-04-14 17:34:28 +00:00
|
|
|
|
2022-09-17 23:53:19 +00:00
|
|
|
if minetest.get_modpath("default") then
|
|
|
|
dofile(modpath.."/default.lua")
|
2018-12-18 09:41:55 +00:00
|
|
|
end
|
|
|
|
|
2022-09-17 23:53:19 +00:00
|
|
|
if minetest.get_modpath("mcl_core") then
|
|
|
|
dofile(modpath.."/mineclone.lua")
|
|
|
|
end
|
2024-04-25 13:26:22 +00:00
|
|
|
|
|
|
|
if minetest.get_modpath("everness") then
|
|
|
|
dofile(modpath.."/everness.lua")
|
|
|
|
end
|