mirror of
				https://github.com/FaceDeer/dfcaverns.git
				synced 2025-11-04 10:05:29 +01:00 
			
		
		
		
	Split this mod into a set of sub-mods in a modpack, and in the process did a whole bunch of renovations. * updated Subterrane's API to allow for more patterned placement of things * added "warrens" * clean separation of flooded and non-flooded caverns * rearranged biomes to make cavern layers more distinct * added oil layer * added underworld layer
		
			
				
	
	
		
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
			
		
		
	
	
			43 lines
		
	
	
		
			1.2 KiB
		
	
	
	
		
			Lua
		
	
	
	
	
	
local CONFIG_FILE_PREFIX = "dfcaverns_"
 | 
						|
 | 
						|
df_farming.config = {}
 | 
						|
 | 
						|
local print_settingtypes = false
 | 
						|
 | 
						|
local function setting(stype, name, default, description)
 | 
						|
	local value
 | 
						|
	if stype == "bool" then
 | 
						|
		value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name)
 | 
						|
	elseif stype == "string" then
 | 
						|
		value = minetest.setting_get(CONFIG_FILE_PREFIX..name)
 | 
						|
	elseif stype == "int" or stype == "float" then
 | 
						|
		value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name))
 | 
						|
	end
 | 
						|
	if value == nil then
 | 
						|
		value = default
 | 
						|
	end
 | 
						|
	df_farming.config[name] = value
 | 
						|
	
 | 
						|
	if print_settingtypes then
 | 
						|
		minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
 | 
						|
	end	
 | 
						|
end
 | 
						|
 | 
						|
local plants = {
 | 
						|
	{name="cave_wheat", delay_multiplier=1},
 | 
						|
	{name="dimple_cup", delay_multiplier=3},
 | 
						|
	{name="pig_tail", delay_multiplier=1},
 | 
						|
	{name="plump_helmet", delay_multiplier=3},
 | 
						|
	{name="quarry_bush", delay_multiplier=2},
 | 
						|
	{name="sweet_pod", delay_multiplier=2},
 | 
						|
}
 | 
						|
 | 
						|
--Plants
 | 
						|
 | 
						|
setting("int", "plant_growth_time", 500, "Base plant growth time")
 | 
						|
 | 
						|
for _, plant in pairs(plants) do
 | 
						|
	setting("float", plant.name.."_delay_multiplier", plant.delay_multiplier, plant.name.." growth delay multiplier")
 | 
						|
end
 | 
						|
 | 
						|
setting("bool", "light_kills_fungus", true, "Light kills fungus") |