[nalc_mediterranean] Add christmas_craft support if snow enabled
This commit is contained in:
		| @@ -432,6 +432,42 @@ if minetest.get_modpath("bonemeal") then | ||||
| 	bonemeal:add_sapling(g_saplings) | ||||
| end | ||||
|  | ||||
| -- Support of Christmas_craft | ||||
| if minetest.get_modpath("christmas_craft") then | ||||
| 	--load configuration file from world folder | ||||
| 	local MODPATH = minetest.get_modpath("nalc_mediterranean") | ||||
| 	local worldpath = minetest.get_worldpath() | ||||
| 	local config = Settings(worldpath.."/christmas_craft.conf") | ||||
|  | ||||
| 	local conf_table = config:to_table() | ||||
|  | ||||
| 	--look into readme.md how to change settings | ||||
| 	local defaults = { | ||||
| 		enable_snowing = "false", | ||||
| 		enable_crafts = "true", | ||||
| 	} | ||||
|  | ||||
| 	--if not in conf file, create it. | ||||
| 	for k, v in pairs(defaults) do | ||||
| 		if conf_table[k] == nil then | ||||
| 			config:set(k, v) | ||||
| 			config:write() | ||||
| 		end | ||||
| 	end | ||||
|  | ||||
| 	--if snow enabled, let it snow | ||||
| 	if config:get("enable_snowing") == "true"  then | ||||
| 		minetest.override_item( | ||||
| 			"nalc_mediterranean:dirt_with_mediterranean_grass", { | ||||
| 			tiles = { | ||||
| 				"default_snow.png", | ||||
| 				"default_dirt.png", | ||||
| 				{name = "default_dirt.png^default_snow_side.png", | ||||
| 				 tileable_vertical = false} | ||||
| 		}}) | ||||
| 	end | ||||
| end | ||||
|  | ||||
| minetest.log("action", "[nalc_mediterranean] loaded.") | ||||
|  | ||||
| -- local mts_save = function(name, schematic) | ||||
|   | ||||
		Reference in New Issue
	
	Block a user