mirror of
				https://github.com/mt-mods/plantlife_modpack.git
				synced 2025-11-03 23:25:26 +01:00 
			
		
		
		
	Compare commits
	
		
			5 Commits
		
	
	
		
			master
			...
			ferns_rm_b
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					80cedce7c6 | ||
| 
						 | 
					21816e5a43 | ||
| 
						 | 
					3c390beb0f | ||
| 
						 | 
					e0dca20186 | ||
| 
						 | 
					25fbc53114 | 
@@ -79,31 +79,3 @@ minetest.register_craft({
 | 
				
			|||||||
	output = "dye:green",
 | 
						output = "dye:green",
 | 
				
			||||||
	recipe = {"group:horsetail"},
 | 
						recipe = {"group:horsetail"},
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
-- GLUE WOODEN TOOLS with RESIN & POLISH them with HORSETAIL (planned)
 | 
					 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
--[[minetest.register_craft({
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "default:pick_wood",
 | 
					 | 
				
			||||||
	recipe = {"default:pick_wood","group:horsetail","farming:string","default:stick"},
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "default:shovel_wood",
 | 
					 | 
				
			||||||
	recipe = {"default:shovel_wood","group:horsetail","farming:string","default:stick"},
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "default:axe_wood",
 | 
					 | 
				
			||||||
	recipe = {"default:axe_wood","group:horsetail","farming:string","default:stick"},
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "default:sword_wood",
 | 
					 | 
				
			||||||
	recipe = {"default:sword_wood","group:horsetail","farming:string","default:stick"},
 | 
					 | 
				
			||||||
})
 | 
					 | 
				
			||||||
minetest.register_craft({
 | 
					 | 
				
			||||||
	type = "shapeless",
 | 
					 | 
				
			||||||
	output = "farming:hoe_wood",
 | 
					 | 
				
			||||||
	recipe = {"farming:hoe_wood","group:horsetail","farming:string","default:stick"},
 | 
					 | 
				
			||||||
})]]
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										248
									
								
								ferns/fern.lua
									
									
									
									
									
								
							
							
						
						
									
										248
									
								
								ferns/fern.lua
									
									
									
									
									
								
							@@ -4,7 +4,6 @@
 | 
				
			|||||||
-- by Mossmanikin
 | 
					-- by Mossmanikin
 | 
				
			||||||
-- Contains code from:		biome_lib
 | 
					-- Contains code from:		biome_lib
 | 
				
			||||||
-- Looked at code from:		default, flowers, painting, trees
 | 
					-- Looked at code from:		default, flowers, painting, trees
 | 
				
			||||||
-- Dependencies:			biome_lib
 | 
					 | 
				
			||||||
-- Supports:				dryplants, stoneage, sumpf
 | 
					-- Supports:				dryplants, stoneage, sumpf
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
-- some inspiration from here
 | 
					-- some inspiration from here
 | 
				
			||||||
@@ -12,19 +11,10 @@
 | 
				
			|||||||
-- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1
 | 
					-- http://www.mygarden.net.au/gardening/athyrium-yokoscense/3900/1
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
assert(abstract_ferns.config.enable_lady_fern == true)
 | 
					minetest.register_alias("ferns:fern_03", "default:fern_3")
 | 
				
			||||||
 | 
					minetest.register_alias("ferns:fern_02", "default:fern_2")
 | 
				
			||||||
 | 
					minetest.register_alias("ferns:fern_01", "default:fern_1")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- support for i18n
 | 
					 | 
				
			||||||
local S = minetest.get_translator("ferns")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Maintain backward compatibilty
 | 
					 | 
				
			||||||
-- minetest-0.5: Begin
 | 
					 | 
				
			||||||
local default_ferns = minetest.registered_items["default:fern_1"] or false
 | 
					 | 
				
			||||||
if default_ferns then
 | 
					 | 
				
			||||||
	minetest.register_alias("ferns:fern_03", "default:fern_3")
 | 
					 | 
				
			||||||
	minetest.register_alias("ferns:fern_02", "default:fern_2")
 | 
					 | 
				
			||||||
	minetest.register_alias("ferns:fern_01", "default:fern_1")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
-- minetest-0.5: End
 | 
					-- minetest-0.5: End
 | 
				
			||||||
minetest.register_alias("archaeplantae:fern",		"ferns:fern_03")
 | 
					minetest.register_alias("archaeplantae:fern",		"ferns:fern_03")
 | 
				
			||||||
minetest.register_alias("archaeplantae:fern_mid",	"ferns:fern_02")
 | 
					minetest.register_alias("archaeplantae:fern_mid",	"ferns:fern_02")
 | 
				
			||||||
@@ -33,183 +23,87 @@ minetest.register_alias("ferns:fern_04",		"ferns:fern_02") -- for placing
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
local nodenames = {}
 | 
					local nodenames = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local function create_nodes()
 | 
					 | 
				
			||||||
	local images	= { "ferns_fern.png", "ferns_fern_mid.png", "ferns_fern_big.png" }
 | 
					 | 
				
			||||||
	local vscales	= { 1, math.sqrt(8), math.sqrt(11) }
 | 
					 | 
				
			||||||
	local descs		= { S("Lady-fern (Athyrium)"), nil, nil }
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for i = 1, 3 do
 | 
					 | 
				
			||||||
		local node_on_place = nil
 | 
					 | 
				
			||||||
		if i == 1 then
 | 
					 | 
				
			||||||
			node_on_place = function(itemstack, placer, pointed_thing)
 | 
					 | 
				
			||||||
				-- place a random fern
 | 
					 | 
				
			||||||
				local stack = ItemStack("ferns:fern_0"..math.random(1,4))
 | 
					 | 
				
			||||||
				local ret = minetest.item_place(stack, placer, pointed_thing)
 | 
					 | 
				
			||||||
				return ItemStack("ferns:fern_01 "..itemstack:get_count()-(1-ret:get_count()))	-- TODO FIXME?
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
		nodenames[i] = "ferns:fern_"..string.format("%02d", i)
 | 
					 | 
				
			||||||
		minetest.register_node(nodenames[i], {
 | 
					 | 
				
			||||||
			description = descs[i] or (S("Lady-fern (Athyrium)").." " .. string.format("%02d", i)),
 | 
					 | 
				
			||||||
			inventory_image = "ferns_fern.png",
 | 
					 | 
				
			||||||
			drawtype = "plantlike",
 | 
					 | 
				
			||||||
			visual_scale = vscales[i],
 | 
					 | 
				
			||||||
			paramtype = "light",
 | 
					 | 
				
			||||||
			tiles = { images[i] },
 | 
					 | 
				
			||||||
			walkable = false,
 | 
					 | 
				
			||||||
			buildable_to = true,
 | 
					 | 
				
			||||||
			groups = {snappy=3,flammable=2,attached_node=1,not_in_creative_inventory=1},
 | 
					 | 
				
			||||||
			sounds = default.node_sound_leaves_defaults(),
 | 
					 | 
				
			||||||
			selection_box = {
 | 
					 | 
				
			||||||
				type = "fixed",
 | 
					 | 
				
			||||||
				fixed = {-7/16, -1/2, -7/16, 7/16, 0, 7/16},
 | 
					 | 
				
			||||||
			},
 | 
					 | 
				
			||||||
			drop = "ferns:fern_01",
 | 
					 | 
				
			||||||
			on_place = node_on_place
 | 
					 | 
				
			||||||
		})
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
-- Init
 | 
					-- Init
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if default_ferns then
 | 
					for i = 1, 3 do
 | 
				
			||||||
	for i = 1, 3 do
 | 
						nodenames[i] = "ferns:fern_"..string.format("%02d", i)
 | 
				
			||||||
		nodenames[i] = "ferns:fern_"..string.format("%02d", i)
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
else
 | 
					 | 
				
			||||||
	create_nodes()
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
-- Spawning
 | 
					-- Spawning
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if abstract_ferns.config.lady_ferns_near_tree == true then
 | 
					minetest.register_decoration({ -- near trees (woodlands)
 | 
				
			||||||
	biome_lib.register_on_generate({ -- near trees (woodlands)
 | 
						decoration = nodenames,
 | 
				
			||||||
		surface = {
 | 
						deco_type = "simple",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
						flags = "all_floors",
 | 
				
			||||||
			"default:mossycobble",
 | 
						place_on = {
 | 
				
			||||||
			"default:desert_sand",
 | 
							"default:dirt_with_grass",
 | 
				
			||||||
			"default:sand",
 | 
							"default:mossycobble",
 | 
				
			||||||
			"default:jungletree",
 | 
							"default:desert_sand",
 | 
				
			||||||
			"stoneage:grass_with_silex",
 | 
							"default:sand",
 | 
				
			||||||
			"sumpf:sumpf"
 | 
							"default:jungletree",
 | 
				
			||||||
		},
 | 
							"stoneage:grass_with_silex",
 | 
				
			||||||
		max_count = 30,
 | 
							"sumpf:sumpf"
 | 
				
			||||||
		rarity = 62,--63,
 | 
					 | 
				
			||||||
		min_elevation = 1, -- above sea level
 | 
					 | 
				
			||||||
		near_nodes = {"group:tree"},
 | 
					 | 
				
			||||||
		near_nodes_size = 3,--4,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 2,--3,
 | 
					 | 
				
			||||||
		near_nodes_count = 1,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5, -- 55 °C (too hot?)
 | 
					 | 
				
			||||||
		temp_min = 0.75, -- -12 °C
 | 
					 | 
				
			||||||
		random_facedir = { 0, 179 },
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	nodenames
 | 
						y_min = 1, -- above sea level
 | 
				
			||||||
	)
 | 
						param2 = 0,
 | 
				
			||||||
end
 | 
						param2_max = 179,
 | 
				
			||||||
 | 
						spawn_by = "group:tree",
 | 
				
			||||||
 | 
						num_spawn_by = 1,
 | 
				
			||||||
 | 
						fill_ratio = 0.1,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if abstract_ferns.config.lady_ferns_near_rock == true then
 | 
					minetest.register_decoration({ -- near stone (mountains)
 | 
				
			||||||
	biome_lib.register_on_generate({ -- near stone (mountains)
 | 
						decoration = nodenames,
 | 
				
			||||||
		surface = {
 | 
						deco_type = "simple",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
						flags = "all_floors",
 | 
				
			||||||
			"default:mossycobble",
 | 
						place_on = {
 | 
				
			||||||
			"group:falling_node",
 | 
							"default:dirt_with_grass",
 | 
				
			||||||
			--"default:jungletree",
 | 
							"default:mossycobble",
 | 
				
			||||||
			"stoneage:grass_with_silex",
 | 
							"group:falling_node",
 | 
				
			||||||
			"sumpf:sumpf"
 | 
							--"default:jungletree",
 | 
				
			||||||
		},
 | 
							"stoneage:grass_with_silex",
 | 
				
			||||||
		max_count = 35,
 | 
							"sumpf:sumpf"
 | 
				
			||||||
		rarity = 40,
 | 
					 | 
				
			||||||
		min_elevation = 1, -- above sea level
 | 
					 | 
				
			||||||
		near_nodes = {"group:stone"},
 | 
					 | 
				
			||||||
		near_nodes_size = 1,
 | 
					 | 
				
			||||||
		near_nodes_count = 16,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5, -- 55 °C (too hot?)
 | 
					 | 
				
			||||||
		temp_min = 0.75, -- -12 °C
 | 
					 | 
				
			||||||
		random_facedir = { 0, 179 },
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	nodenames
 | 
						y_min = 1, -- above sea level
 | 
				
			||||||
	)
 | 
						param2 = 0,
 | 
				
			||||||
end
 | 
						param2_max = 179,
 | 
				
			||||||
 | 
						spawn_by = "group:stone",
 | 
				
			||||||
 | 
						num_spawn_by = 1,
 | 
				
			||||||
 | 
						fill_ratio = 0.3,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if abstract_ferns.config.lady_ferns_near_ores == true then -- this one causes a huge fps drop
 | 
					minetest.register_decoration({ -- near stone (mountains)
 | 
				
			||||||
	biome_lib.register_on_generate({ -- near ores (potential mining sites)
 | 
						decoration = nodenames,
 | 
				
			||||||
		surface = {
 | 
						deco_type = "simple",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
						flags = "all_floors",
 | 
				
			||||||
			"default:mossycobble",
 | 
						place_on = {
 | 
				
			||||||
			"default:stone_with_coal",
 | 
							"default:dirt_with_grass",
 | 
				
			||||||
			"default:stone_with_iron",
 | 
							"default:mossycobble",
 | 
				
			||||||
			"default:stone_with_tin", -- minetest >= 0.4.16
 | 
							"default:stone_with_coal",
 | 
				
			||||||
			"moreores:mineral_tin",
 | 
							"default:stone_with_iron",
 | 
				
			||||||
			"moreores:mineral_silver",
 | 
							"default:stone_with_tin",
 | 
				
			||||||
			"sumpf:sumpf"
 | 
							"moreores:mineral_tin",
 | 
				
			||||||
		},
 | 
							"moreores:mineral_silver",
 | 
				
			||||||
		max_count = 1200,--1600, -- maybe too much? :D
 | 
							"sumpf:sumpf"
 | 
				
			||||||
		rarity = 25,--15,
 | 
					 | 
				
			||||||
		min_elevation = 1, -- above sea level
 | 
					 | 
				
			||||||
		near_nodes = {
 | 
					 | 
				
			||||||
			"default:stone_with_iron",
 | 
					 | 
				
			||||||
			--"default:stone_with_copper",
 | 
					 | 
				
			||||||
			--"default:stone_with_mese",
 | 
					 | 
				
			||||||
			--"default:stone_with_gold",
 | 
					 | 
				
			||||||
			--"default:stone_with_diamond",
 | 
					 | 
				
			||||||
			"default:stone_with_tin", -- minetest >= 0.4.16
 | 
					 | 
				
			||||||
			"moreores:mineral_tin",
 | 
					 | 
				
			||||||
			"moreores:mineral_silver"
 | 
					 | 
				
			||||||
			--"moreores:mineral_mithril"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		near_nodes_size = 2,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 4,--5,--6,
 | 
					 | 
				
			||||||
		near_nodes_count = 2,--3,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5, -- 55 °C (too hot?)
 | 
					 | 
				
			||||||
		temp_min = 0.75, -- -12 °C
 | 
					 | 
				
			||||||
		random_facedir = { 0, 179 },
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	nodenames
 | 
						y_min = 1, -- above sea level
 | 
				
			||||||
	)
 | 
						param2 = 0,
 | 
				
			||||||
end
 | 
						param2_max = 179,
 | 
				
			||||||
 | 
						spawn_by = {
 | 
				
			||||||
if abstract_ferns.config.lady_ferns_in_groups == true then -- this one is meant as a replacement of Ferns_near_Ores
 | 
							"default:stone_with_iron",
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
							--"default:stone_with_copper",
 | 
				
			||||||
		surface = {
 | 
							--"default:stone_with_mese",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
							--"default:stone_with_gold",
 | 
				
			||||||
			"default:mossycobble",
 | 
							--"default:stone_with_diamond",
 | 
				
			||||||
			"default:stone_with_coal",
 | 
							"default:stone_with_tin",
 | 
				
			||||||
			"default:stone_with_iron",
 | 
							"moreores:mineral_tin",
 | 
				
			||||||
			"default:stone_with_tin", -- minetest >= 0.4.16
 | 
							"moreores:mineral_silver"
 | 
				
			||||||
			"moreores:mineral_tin",
 | 
							--"moreores:mineral_mithril"
 | 
				
			||||||
			"moreores:mineral_silver",
 | 
					 | 
				
			||||||
			"sumpf:sumpf"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		max_count = 70,
 | 
					 | 
				
			||||||
		rarity = 25,--15,
 | 
					 | 
				
			||||||
		min_elevation = 1, -- above sea level
 | 
					 | 
				
			||||||
		near_nodes = {
 | 
					 | 
				
			||||||
			"default:stone"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		near_nodes_size = 2,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 2,--6,
 | 
					 | 
				
			||||||
		near_nodes_count = 3,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5, -- 55 °C (too hot?)
 | 
					 | 
				
			||||||
		temp_min = 0.75, -- -12 °C
 | 
					 | 
				
			||||||
		random_facedir = { 0, 179 },
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	nodenames
 | 
						num_spawn_by = 1,
 | 
				
			||||||
	)
 | 
						fill_ratio = 0.8,
 | 
				
			||||||
end
 | 
					})
 | 
				
			||||||
@@ -7,8 +7,6 @@
 | 
				
			|||||||
-- Supports:				vines
 | 
					-- Supports:				vines
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
assert(abstract_ferns.config.enable_giant_treefern == true)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = minetest.get_translator("ferns")
 | 
					local S = minetest.get_translator("ferns")
 | 
				
			||||||
-- lot of code, lot to load
 | 
					-- lot of code, lot to load
 | 
				
			||||||
@@ -331,54 +329,50 @@ minetest.register_abm({
 | 
				
			|||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- in jungles
 | 
					-- in jungles
 | 
				
			||||||
if abstract_ferns.config.enable_giant_treeferns_in_jungle == true then
 | 
					biome_lib.register_on_generate({
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
						surface = {
 | 
				
			||||||
		surface = {
 | 
							"default:dirt_with_grass",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
							"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
 | 
				
			||||||
			"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
 | 
							"default:sand",
 | 
				
			||||||
			"default:sand",
 | 
							"default:desert_sand"--,
 | 
				
			||||||
			"default:desert_sand"--,
 | 
							--"dryplants:grass_short"
 | 
				
			||||||
			--"dryplants:grass_short"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		max_count = 12,--27,
 | 
					 | 
				
			||||||
		avoid_nodes = {"group:tree"},
 | 
					 | 
				
			||||||
		avoid_radius = 3,--4,
 | 
					 | 
				
			||||||
		rarity = 85,
 | 
					 | 
				
			||||||
		seed_diff = 329,
 | 
					 | 
				
			||||||
		min_elevation = 1,
 | 
					 | 
				
			||||||
		near_nodes = {"default:jungletree"},
 | 
					 | 
				
			||||||
		near_nodes_size = 6,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 2,--4,
 | 
					 | 
				
			||||||
		near_nodes_count = 1,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	abstract_ferns.grow_giant_tree_fern
 | 
						max_count = 12,--27,
 | 
				
			||||||
	)
 | 
						avoid_nodes = {"group:tree"},
 | 
				
			||||||
end
 | 
						avoid_radius = 3,--4,
 | 
				
			||||||
 | 
						rarity = 85,
 | 
				
			||||||
 | 
						seed_diff = 329,
 | 
				
			||||||
 | 
						min_elevation = 1,
 | 
				
			||||||
 | 
						near_nodes = {"default:jungletree"},
 | 
				
			||||||
 | 
						near_nodes_size = 6,
 | 
				
			||||||
 | 
						near_nodes_vertical = 2,--4,
 | 
				
			||||||
 | 
						near_nodes_count = 1,
 | 
				
			||||||
 | 
						plantlife_limit = -0.9,
 | 
				
			||||||
 | 
					},
 | 
				
			||||||
 | 
					abstract_ferns.grow_giant_tree_fern
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- for oases & tropical beaches
 | 
					-- for oases & tropical beaches
 | 
				
			||||||
if abstract_ferns.config.enable_giant_treeferns_in_oases == true then
 | 
					biome_lib.register_on_generate({
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
						surface = {
 | 
				
			||||||
		surface = {
 | 
							"default:sand"--,
 | 
				
			||||||
			"default:sand"--,
 | 
							--"default:desert_sand"
 | 
				
			||||||
			--"default:desert_sand"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		max_count = 10,--27,
 | 
					 | 
				
			||||||
		rarity = 90,
 | 
					 | 
				
			||||||
		seed_diff = 329,
 | 
					 | 
				
			||||||
		neighbors = {"default:desert_sand"},
 | 
					 | 
				
			||||||
		ncount = 1,
 | 
					 | 
				
			||||||
		min_elevation = 1,
 | 
					 | 
				
			||||||
		near_nodes = {"default:water_source", "default:river_water_source"},
 | 
					 | 
				
			||||||
		near_nodes_size = 2,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 1,
 | 
					 | 
				
			||||||
		near_nodes_count = 1,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 1.0,
 | 
					 | 
				
			||||||
		temp_max = -1.0,
 | 
					 | 
				
			||||||
		temp_min = 1.0,
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	abstract_ferns.grow_giant_tree_fern
 | 
						max_count = 10,--27,
 | 
				
			||||||
	)
 | 
						rarity = 90,
 | 
				
			||||||
end
 | 
						seed_diff = 329,
 | 
				
			||||||
 | 
						neighbors = {"default:desert_sand"},
 | 
				
			||||||
 | 
						ncount = 1,
 | 
				
			||||||
 | 
						min_elevation = 1,
 | 
				
			||||||
 | 
						near_nodes = {"default:water_source", "default:river_water_source"},
 | 
				
			||||||
 | 
						near_nodes_size = 2,
 | 
				
			||||||
 | 
						near_nodes_vertical = 1,
 | 
				
			||||||
 | 
						near_nodes_count = 1,
 | 
				
			||||||
 | 
						plantlife_limit = -0.9,
 | 
				
			||||||
 | 
						humidity_max = -1.0,
 | 
				
			||||||
 | 
						humidity_min = 1.0,
 | 
				
			||||||
 | 
						temp_max = -1.0,
 | 
				
			||||||
 | 
						temp_min = 1.0,
 | 
				
			||||||
 | 
					},
 | 
				
			||||||
 | 
					abstract_ferns.grow_giant_tree_fern
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -8,8 +8,6 @@
 | 
				
			|||||||
-- Supports:				dryplants, stoneage, sumpf
 | 
					-- Supports:				dryplants, stoneage, sumpf
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
assert(abstract_ferns.config.enable_horsetails == true)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = minetest.get_translator("ferns")
 | 
					local S = minetest.get_translator("ferns")
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
@@ -71,101 +69,45 @@ end
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
create_nodes()
 | 
					create_nodes()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
-- Spawning
 | 
					 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					 | 
				
			||||||
if abstract_ferns.config.enable_horsetails_spawning == true then
 | 
					 | 
				
			||||||
	minetest.register_abm({
 | 
					 | 
				
			||||||
		nodenames = {
 | 
					 | 
				
			||||||
			"default:dirt_with_grass",
 | 
					 | 
				
			||||||
			"default:dirt_with_coniferous_litter",
 | 
					 | 
				
			||||||
			"default:desert_sand",
 | 
					 | 
				
			||||||
			"default:sand",
 | 
					 | 
				
			||||||
			"dryplants:grass_short",
 | 
					 | 
				
			||||||
			"stoneage:grass_with_silex",
 | 
					 | 
				
			||||||
			"default:mossycobble",
 | 
					 | 
				
			||||||
			"default:gravel"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		interval = 1200,
 | 
					 | 
				
			||||||
		chance = 400,
 | 
					 | 
				
			||||||
		label = "[ferns] spawn horsetails",
 | 
					 | 
				
			||||||
		min_y = 1,
 | 
					 | 
				
			||||||
		max_y = 48,
 | 
					 | 
				
			||||||
		action = function(pos, node)
 | 
					 | 
				
			||||||
			local p_top = {x = pos.x, y = pos.y + 1, z = pos.z}
 | 
					 | 
				
			||||||
			local n_top = minetest.get_node_or_nil(p_top)
 | 
					 | 
				
			||||||
			if not n_top or n_top.name ~= "air" then return end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			local NEAR_DST = 2
 | 
					 | 
				
			||||||
			if #minetest.find_nodes_in_area(
 | 
					 | 
				
			||||||
					{x=pos.x-NEAR_DST, y=pos.y-1, z=pos.z-NEAR_DST},
 | 
					 | 
				
			||||||
					{x=pos.x+NEAR_DST, y=pos.y+1, z=pos.z+NEAR_DST},
 | 
					 | 
				
			||||||
					{"default:water_source","default:river_water_source","default:gravel"}
 | 
					 | 
				
			||||||
				) < 1 then return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			local plant_to_spawn = node_names[math.random(1, #node_names)]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
			minetest.swap_node(p_top, {name = plant_to_spawn, param2 = 0})
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
-- Generating
 | 
					-- Generating
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if abstract_ferns.config.enable_horsetails_on_grass == true then
 | 
					minetest.register_decoration({ -- near trees (woodlands)
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
						decoration = node_names,
 | 
				
			||||||
		surface = {
 | 
						deco_type = "simple",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
						flags = "all_floors",
 | 
				
			||||||
			"default:dirt_with_coniferous_litter", -- minetest >= 0.5
 | 
						place_on = {
 | 
				
			||||||
			"sumpf:sumpf"
 | 
							"default:dirt_with_grass",
 | 
				
			||||||
		},
 | 
							"default:dirt_with_coniferous_litter",
 | 
				
			||||||
		max_count = 35,
 | 
							"sumpf:sumpf"
 | 
				
			||||||
		rarity = 40,
 | 
					 | 
				
			||||||
		min_elevation = 1, -- above sea level
 | 
					 | 
				
			||||||
		near_nodes = {
 | 
					 | 
				
			||||||
			"group:water", -- likes water (of course)
 | 
					 | 
				
			||||||
			"default:gravel", -- near those on gravel
 | 
					 | 
				
			||||||
			"default:sand", -- some like sand
 | 
					 | 
				
			||||||
			"default:clay", -- some like clay
 | 
					 | 
				
			||||||
			"stoneage:grass_with_silex",
 | 
					 | 
				
			||||||
			"default:mossycobble",
 | 
					 | 
				
			||||||
			"default:cobble",
 | 
					 | 
				
			||||||
			"sumpf:sumpf"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		near_nodes_size = 3,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 2,--3,
 | 
					 | 
				
			||||||
		near_nodes_count = 1,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5, -- 55 °C
 | 
					 | 
				
			||||||
		temp_min = 0.53, -- 0 °C, dies back in winter
 | 
					 | 
				
			||||||
		--random_facedir = { 0, 179 },
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	node_names
 | 
						y_min = 1, -- above sea level
 | 
				
			||||||
	)
 | 
						spawn_by = {
 | 
				
			||||||
end
 | 
							"group:water", -- likes water (of course)
 | 
				
			||||||
 | 
							"default:gravel", -- near those on gravel
 | 
				
			||||||
 | 
							"default:sand", -- some like sand
 | 
				
			||||||
 | 
							"default:clay", -- some like clay
 | 
				
			||||||
 | 
							"stoneage:grass_with_silex",
 | 
				
			||||||
 | 
							"default:mossycobble",
 | 
				
			||||||
 | 
							"default:cobble",
 | 
				
			||||||
 | 
							"sumpf:sumpf"
 | 
				
			||||||
 | 
						},
 | 
				
			||||||
 | 
						num_spawn_by = 1,
 | 
				
			||||||
 | 
						fill_ratio = 0.1,
 | 
				
			||||||
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if abstract_ferns.config.enable_horsetails_on_stones == true then
 | 
					minetest.register_decoration({ -- near trees (woodlands)
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
						decoration = node_names,
 | 
				
			||||||
		surface = {
 | 
						deco_type = "simple",
 | 
				
			||||||
			"default:gravel", -- roots go deep
 | 
						flags = "all_floors",
 | 
				
			||||||
			"default:mossycobble",
 | 
						place_on = {
 | 
				
			||||||
			"stoneage:dirt_with_silex",
 | 
							"default:gravel", -- roots go deep
 | 
				
			||||||
			"stoneage:grass_with_silex",
 | 
							"default:mossycobble",
 | 
				
			||||||
			"stoneage:sand_with_silex", -- roots go deep
 | 
							"stoneage:dirt_with_silex",
 | 
				
			||||||
		},
 | 
							"stoneage:grass_with_silex",
 | 
				
			||||||
		max_count = 35,
 | 
							"stoneage:sand_with_silex", -- roots go deep
 | 
				
			||||||
		rarity = 20,
 | 
					 | 
				
			||||||
		min_elevation = 1, -- above sea level
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5, -- 55 °C
 | 
					 | 
				
			||||||
		temp_min = 0.53, -- 0 °C, dies back in winter
 | 
					 | 
				
			||||||
		--random_facedir = { 0, 179 },
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	node_names
 | 
						y_min = 1, -- above sea level
 | 
				
			||||||
	)
 | 
						fill_ratio = 0.1,
 | 
				
			||||||
end
 | 
					})
 | 
				
			||||||
@@ -1,21 +1,7 @@
 | 
				
			|||||||
abstract_ferns = {}
 | 
					abstract_ferns = {}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
dofile(minetest.get_modpath("ferns").."/settings.lua")
 | 
					dofile(minetest.get_modpath("ferns").."/fern.lua")
 | 
				
			||||||
 | 
					dofile(minetest.get_modpath("ferns").."/horsetail.lua")
 | 
				
			||||||
if abstract_ferns.config.enable_lady_fern == true then
 | 
					dofile(minetest.get_modpath("ferns").."/treefern.lua")
 | 
				
			||||||
	dofile(minetest.get_modpath("ferns").."/fern.lua")
 | 
					dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if abstract_ferns.config.enable_horsetails == true then
 | 
					 | 
				
			||||||
	dofile(minetest.get_modpath("ferns").."/horsetail.lua")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if abstract_ferns.config.enable_treefern == true then
 | 
					 | 
				
			||||||
	dofile(minetest.get_modpath("ferns").."/treefern.lua")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if abstract_ferns.config.enable_giant_treefern == true then
 | 
					 | 
				
			||||||
	dofile(minetest.get_modpath("ferns").."/gianttreefern.lua")
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
dofile(minetest.get_modpath("ferns").."/crafting.lua")
 | 
					dofile(minetest.get_modpath("ferns").."/crafting.lua")
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,2 +1,2 @@
 | 
				
			|||||||
name = ferns
 | 
					name = ferns
 | 
				
			||||||
depends = default, biome_lib
 | 
					depends = default
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,43 +0,0 @@
 | 
				
			|||||||
-- In case you don't wanna have errors:
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Only change what's behind a "=" (or "--").
 | 
					 | 
				
			||||||
-- Don't use caps (behind a "=").
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- If there's a "false" (behind a "=") you can change it to "true" (and the other way around).
 | 
					 | 
				
			||||||
-- Spelling is important.
 | 
					 | 
				
			||||||
-- If "true" or "false" is necessary as setting, everything(!) which is not spelled "true" will be read as if it were "false" (even "1", "True"...)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- If you wanna comment something (for example to remember the default value), you can do this by putting "--" in front of the comment.
 | 
					 | 
				
			||||||
-- You can put "--" at the end of a line with "=" in it, or at the beginning of an empty/new line (minetest will ignore what's behind it then).
 | 
					 | 
				
			||||||
-- But don't put "--" in front of a line with "=" in it (or else minetest will ignore the setting and you might get an error).
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- If something is still unclear, don't hesitate to post your question @ https://forum.minetest.net/viewtopic.php?id=6921
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
abstract_ferns.config = {}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Which plants should generate/spawn?
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_lady_fern			= true
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_horsetails			= true
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_treefern			= true
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_giant_treefern		= true
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- Where should they generate/spawn? (if they generate/spawn)
 | 
					 | 
				
			||||||
--
 | 
					 | 
				
			||||||
--  Lady-Fern
 | 
					 | 
				
			||||||
abstract_ferns.config.lady_ferns_near_tree = true
 | 
					 | 
				
			||||||
abstract_ferns.config.lady_ferns_near_rock = true
 | 
					 | 
				
			||||||
abstract_ferns.config.lady_ferns_near_ores = true				-- if there's a bunch of ferns there's ores nearby, this one causes a huge fps drop
 | 
					 | 
				
			||||||
abstract_ferns.config.lady_ferns_in_groups = false				-- this one is meant as a replacement of Ferns_near_Ores: ferns tend to generate in groups, less fps drop, no hint for nearby ores
 | 
					 | 
				
			||||||
--
 | 
					 | 
				
			||||||
--	Horsetails
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_horsetails_spawning	= false		-- horsetails will grow in already explored areas, over time, near water or gravel
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_horsetails_on_grass	= true		-- on dirt with grass and swamp (sumpf mod)
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_horsetails_on_stones	= true		-- on gravel, mossy cobble and silex (stoneage mod)
 | 
					 | 
				
			||||||
--
 | 
					 | 
				
			||||||
-- Tree_Fern
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_treeferns_in_jungle	= true
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_treeferns_in_oases		= true		-- for oases and tropical beaches
 | 
					 | 
				
			||||||
--
 | 
					 | 
				
			||||||
-- Giant_Tree_Fern
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_giant_treeferns_in_jungle	= true
 | 
					 | 
				
			||||||
abstract_ferns.config.enable_giant_treeferns_in_oases	= true	-- for oases and tropical beaches
 | 
					 | 
				
			||||||
@@ -9,8 +9,6 @@
 | 
				
			|||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = minetest.get_translator("ferns")
 | 
					local S = minetest.get_translator("ferns")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
assert(abstract_ferns.config.enable_treefern == true)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function abstract_ferns.can_grow_tree_fern(pos)
 | 
					function abstract_ferns.can_grow_tree_fern(pos)
 | 
				
			||||||
	local node_name = minetest.get_node(pos).name
 | 
						local node_name = minetest.get_node(pos).name
 | 
				
			||||||
	if node_name ~= "air" and node_name ~= "ferns:sapling_tree_fern" and node_name ~= "default:junglegrass" then
 | 
						if node_name ~= "air" and node_name ~= "ferns:sapling_tree_fern" and node_name ~= "default:junglegrass" then
 | 
				
			||||||
@@ -205,57 +203,53 @@ minetest.register_abm({
 | 
				
			|||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- in jungles
 | 
					-- in jungles
 | 
				
			||||||
if abstract_ferns.config.enable_treeferns_in_jungle == true then
 | 
					biome_lib.register_on_generate({
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
						surface = {
 | 
				
			||||||
		surface = {
 | 
							"default:dirt_with_grass",
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
							"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
 | 
				
			||||||
			"default:dirt_with_rainforest_litter", -- minetest >= 0.4.16
 | 
							"default:sand",
 | 
				
			||||||
			"default:sand",
 | 
							"default:desert_sand",
 | 
				
			||||||
			"default:desert_sand",
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		max_count = 35,--27,
 | 
					 | 
				
			||||||
		avoid_nodes = {"default:tree"},
 | 
					 | 
				
			||||||
		avoid_radius = 4,
 | 
					 | 
				
			||||||
		rarity = 50,
 | 
					 | 
				
			||||||
		seed_diff = 329,
 | 
					 | 
				
			||||||
		min_elevation = -10,
 | 
					 | 
				
			||||||
		near_nodes = {"default:jungletree"},
 | 
					 | 
				
			||||||
		near_nodes_size = 6,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 2,--4,
 | 
					 | 
				
			||||||
		near_nodes_count = 1,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 0.4,
 | 
					 | 
				
			||||||
		temp_max = -0.5,
 | 
					 | 
				
			||||||
		temp_min = 0.13,
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	abstract_ferns.grow_tree_fern
 | 
						max_count = 35,--27,
 | 
				
			||||||
	)
 | 
						avoid_nodes = {"default:tree"},
 | 
				
			||||||
end
 | 
						avoid_radius = 4,
 | 
				
			||||||
 | 
						rarity = 50,
 | 
				
			||||||
 | 
						seed_diff = 329,
 | 
				
			||||||
 | 
						min_elevation = -10,
 | 
				
			||||||
 | 
						near_nodes = {"default:jungletree"},
 | 
				
			||||||
 | 
						near_nodes_size = 6,
 | 
				
			||||||
 | 
						near_nodes_vertical = 2,--4,
 | 
				
			||||||
 | 
						near_nodes_count = 1,
 | 
				
			||||||
 | 
						plantlife_limit = -0.9,
 | 
				
			||||||
 | 
						humidity_max = -1.0,
 | 
				
			||||||
 | 
						humidity_min = 0.4,
 | 
				
			||||||
 | 
						temp_max = -0.5,
 | 
				
			||||||
 | 
						temp_min = 0.13,
 | 
				
			||||||
 | 
					},
 | 
				
			||||||
 | 
					abstract_ferns.grow_tree_fern
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- for oases & tropical beaches
 | 
					-- for oases & tropical beaches
 | 
				
			||||||
if abstract_ferns.config.enable_treeferns_in_oases == true then
 | 
					biome_lib.register_on_generate({
 | 
				
			||||||
	biome_lib.register_on_generate({
 | 
						surface = {
 | 
				
			||||||
		surface = {
 | 
							"default:sand"--,
 | 
				
			||||||
			"default:sand"--,
 | 
							--"default:desert_sand"
 | 
				
			||||||
			--"default:desert_sand"
 | 
					 | 
				
			||||||
		},
 | 
					 | 
				
			||||||
		max_count = 35,
 | 
					 | 
				
			||||||
		rarity = 50,
 | 
					 | 
				
			||||||
		seed_diff = 329,
 | 
					 | 
				
			||||||
		neighbors = {"default:desert_sand"},
 | 
					 | 
				
			||||||
		ncount = 1,
 | 
					 | 
				
			||||||
		min_elevation = 1,
 | 
					 | 
				
			||||||
		near_nodes = {"default:water_source","default:river_water_source"},
 | 
					 | 
				
			||||||
		near_nodes_size = 2,
 | 
					 | 
				
			||||||
		near_nodes_vertical = 1,
 | 
					 | 
				
			||||||
		near_nodes_count = 1,
 | 
					 | 
				
			||||||
		plantlife_limit = -0.9,
 | 
					 | 
				
			||||||
		humidity_max = -1.0,
 | 
					 | 
				
			||||||
		humidity_min = 1.0,
 | 
					 | 
				
			||||||
		temp_max = -1.0,
 | 
					 | 
				
			||||||
		temp_min = 1.0,
 | 
					 | 
				
			||||||
	},
 | 
						},
 | 
				
			||||||
	abstract_ferns.grow_tree_fern
 | 
						max_count = 35,
 | 
				
			||||||
 | 
						rarity = 50,
 | 
				
			||||||
 | 
						seed_diff = 329,
 | 
				
			||||||
 | 
						neighbors = {"default:desert_sand"},
 | 
				
			||||||
 | 
						ncount = 1,
 | 
				
			||||||
 | 
						min_elevation = 1,
 | 
				
			||||||
 | 
						near_nodes = {"default:water_source","default:river_water_source"},
 | 
				
			||||||
 | 
						near_nodes_size = 2,
 | 
				
			||||||
 | 
						near_nodes_vertical = 1,
 | 
				
			||||||
 | 
						near_nodes_count = 1,
 | 
				
			||||||
 | 
						plantlife_limit = -0.9,
 | 
				
			||||||
 | 
						humidity_max = -1.0,
 | 
				
			||||||
 | 
						humidity_min = 1.0,
 | 
				
			||||||
 | 
						temp_max = -1.0,
 | 
				
			||||||
 | 
						temp_min = 1.0,
 | 
				
			||||||
 | 
					},
 | 
				
			||||||
 | 
					abstract_ferns.grow_tree_fern
 | 
				
			||||||
)
 | 
					)
 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 
 | 
				
			|||||||
@@ -126,8 +126,8 @@ for r = 0, 3 do
 | 
				
			|||||||
	})
 | 
						})
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_alias("trunks:moss", "trunks:moss_plain_0")
 | 
					minetest.register_alias("trunks:moss_plain", "trunks:moss_plain_0")
 | 
				
			||||||
minetest.register_alias("trunks:moss_fungus", "trunks:moss_with_fungus_0")
 | 
					minetest.register_alias("trunks:moss_with_fungus", "trunks:moss_with_fungus_0")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-----------------------------------------------------------------------------------------------
 | 
					-----------------------------------------------------------------------------------------------
 | 
				
			||||||
-- TWiGS BLoCK
 | 
					-- TWiGS BLoCK
 | 
				
			||||||
 
 | 
				
			|||||||
							
								
								
									
										159
									
								
								vines/init.lua
									
									
									
									
									
								
							
							
						
						
									
										159
									
								
								vines/init.lua
									
									
									
									
									
								
							@@ -11,8 +11,8 @@ local enable_side = minetest.settings:get_bool("vines_enable_side", true)
 | 
				
			|||||||
local enable_jungle = minetest.settings:get_bool("vines_enable_jungle", true)
 | 
					local enable_jungle = minetest.settings:get_bool("vines_enable_jungle", true)
 | 
				
			||||||
local enable_willow = minetest.settings:get_bool("vines_enable_willow", true)
 | 
					local enable_willow = minetest.settings:get_bool("vines_enable_willow", true)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local rarity_roots = tonumber(minetest.settings:get("vines_rarity_roots")) or 0.5
 | 
					local rarity_roots = tonumber(minetest.settings:get("vines_rarity_roots")) or 70
 | 
				
			||||||
local default_rarity = 0.2
 | 
					local default_rarity = 95
 | 
				
			||||||
local rarity_standard = tonumber(minetest.settings:get("vines_rarity_standard")) or default_rarity
 | 
					local rarity_standard = tonumber(minetest.settings:get("vines_rarity_standard")) or default_rarity
 | 
				
			||||||
local rarity_side = tonumber(minetest.settings:get("vines_rarity_side")) or default_rarity
 | 
					local rarity_side = tonumber(minetest.settings:get("vines_rarity_side")) or default_rarity
 | 
				
			||||||
local rarity_jungle = tonumber(minetest.settings:get("vines_rarity_jungle")) or default_rarity
 | 
					local rarity_jungle = tonumber(minetest.settings:get("vines_rarity_jungle")) or default_rarity
 | 
				
			||||||
@@ -24,25 +24,6 @@ local growth_max = tonumber(minetest.settings:get("vines_growth_max")) or 360
 | 
				
			|||||||
-- support for i18n
 | 
					-- support for i18n
 | 
				
			||||||
local S = minetest.get_translator("vines")
 | 
					local S = minetest.get_translator("vines")
 | 
				
			||||||
 | 
					
 | 
				
			||||||
local dids = {}
 | 
					 | 
				
			||||||
local spawn_funcs = {}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
local function find_open_side(pos) -- copied from biome_lib
 | 
					 | 
				
			||||||
	if minetest.get_node({ x=pos.x-1, y=pos.y, z=pos.z }).name == "air" then
 | 
					 | 
				
			||||||
		return {newpos = { x=pos.x-1, y=pos.y, z=pos.z }, facedir = 2}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if minetest.get_node({ x=pos.x+1, y=pos.y, z=pos.z }).name == "air" then
 | 
					 | 
				
			||||||
		return {newpos = { x=pos.x+1, y=pos.y, z=pos.z }, facedir = 3}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if minetest.get_node({ x=pos.x, y=pos.y, z=pos.z-1 }).name == "air" then
 | 
					 | 
				
			||||||
		return {newpos = { x=pos.x, y=pos.y, z=pos.z-1 }, facedir = 4}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	if minetest.get_node({ x=pos.x, y=pos.y, z=pos.z+1 }).name == "air" then
 | 
					 | 
				
			||||||
		return {newpos = { x=pos.x, y=pos.y, z=pos.z+1 }, facedir = 5}
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
	return nil
 | 
					 | 
				
			||||||
end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ITEMS
 | 
					-- ITEMS
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if enable_vines ~= false then
 | 
					if enable_vines ~= false then
 | 
				
			||||||
@@ -104,7 +85,7 @@ local function ensure_vine_end(pos, oldnode)
 | 
				
			|||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
vines.register_vine = function( name, defs, def )
 | 
					vines.register_vine = function( name, defs, biome )
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local groups = {vines = 1, snappy = 3, flammable = 2}
 | 
						local groups = {vines = 1, snappy = 3, flammable = 2}
 | 
				
			||||||
	local vine_name_end = 'vines:' .. name .. '_end'
 | 
						local vine_name_end = 'vines:' .. name .. '_end'
 | 
				
			||||||
@@ -112,37 +93,16 @@ vines.register_vine = function( name, defs, def )
 | 
				
			|||||||
	local vine_image_end = "vines_" .. name .. "_end.png"
 | 
						local vine_image_end = "vines_" .. name .. "_end.png"
 | 
				
			||||||
	local vine_image_middle = "vines_" .. name .. "_middle.png"
 | 
						local vine_image_middle = "vines_" .. name .. "_middle.png"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	local spawn_plants = function(pos)
 | 
						local spawn_plants = function(pos, fdir)
 | 
				
			||||||
		local param2 = 0
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if def.spawn_on_bottom then -- spawn under e.g. leaves
 | 
					 | 
				
			||||||
			local newpos = vector.new(pos.x, pos.y - 1, pos.z)
 | 
					 | 
				
			||||||
			if minetest.get_node(pos).name ~= "air" and minetest.get_node(newpos).name == "air" then
 | 
					 | 
				
			||||||
				-- (1) prevent floating vines; (2) is there even space?
 | 
					 | 
				
			||||||
				pos = newpos
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		elseif def.spawn_on_side then
 | 
					 | 
				
			||||||
			local onside = find_open_side(pos)
 | 
					 | 
				
			||||||
			if onside then
 | 
					 | 
				
			||||||
				pos = onside.newpos
 | 
					 | 
				
			||||||
				param2 = onside.facedir
 | 
					 | 
				
			||||||
			else
 | 
					 | 
				
			||||||
				return
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		local max_length = math.random(defs.average_length)
 | 
							local max_length = math.random(defs.average_length)
 | 
				
			||||||
		local current_length = 1
 | 
							local current_length = 1
 | 
				
			||||||
		-- print("Generate " .. name .. " at " .. minetest.pos_to_string(pos))
 | 
					 | 
				
			||||||
		if minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' then
 | 
							if minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' then
 | 
				
			||||||
			while minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' and current_length < max_length do
 | 
								while minetest.get_node({ x=pos.x, y=pos.y - 1, z=pos.z }).name == 'air' and current_length < max_length do
 | 
				
			||||||
				minetest.set_node(pos, { name = vine_name_middle, param2 = param2 })
 | 
									minetest.swap_node(pos, { name = vine_name_middle, param2 = fdir })
 | 
				
			||||||
				pos.y = pos.y - 1
 | 
									pos.y = pos.y - 1
 | 
				
			||||||
				current_length = current_length + 1
 | 
									current_length = current_length + 1
 | 
				
			||||||
			end
 | 
								end
 | 
				
			||||||
			minetest.set_node(pos, { name = vine_name_end, param2 = param2 })
 | 
								minetest.set_node(pos, { name = vine_name_end, param2 = fdir })
 | 
				
			||||||
		end
 | 
							end
 | 
				
			||||||
	end
 | 
						end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -150,7 +110,7 @@ vines.register_vine = function( name, defs, def )
 | 
				
			|||||||
	local drawtype = 'signlike'
 | 
						local drawtype = 'signlike'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	-- different properties for bottom and side vines.
 | 
						-- different properties for bottom and side vines.
 | 
				
			||||||
	if not def.spawn_on_side then
 | 
						if not biome.spawn_on_side then
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		selection_box = {
 | 
							selection_box = {
 | 
				
			||||||
			type = "fixed", fixed = { -0.4, -1/2, -0.4, 0.4, 1/2, 0.4 }
 | 
								type = "fixed", fixed = { -0.4, -1/2, -0.4, 0.4, 1/2, 0.4 }
 | 
				
			||||||
@@ -197,7 +157,7 @@ vines.register_vine = function( name, defs, def )
 | 
				
			|||||||
					minetest.set_node(bottom, {
 | 
										minetest.set_node(bottom, {
 | 
				
			||||||
							name = node.name, param2 = node.param2})
 | 
												name = node.name, param2 = node.param2})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					local timer = minetest.get_node_timer(bottom)
 | 
										local timer = minetest.get_node_timer(bottom_node)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
					timer:start(math.random(growth_min, growth_max))
 | 
										timer:start(math.random(growth_min, growth_max))
 | 
				
			||||||
				end
 | 
									end
 | 
				
			||||||
@@ -235,44 +195,9 @@ vines.register_vine = function( name, defs, def )
 | 
				
			|||||||
		end,
 | 
							end,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	minetest.register_decoration({
 | 
						biome_lib.register_on_generate(biome, spawn_plants)
 | 
				
			||||||
		name = "vines:" .. name,
 | 
					 | 
				
			||||||
		decoration = {"air"},
 | 
					 | 
				
			||||||
		fill_ratio = def.rarity,
 | 
					 | 
				
			||||||
		y_min = -16,
 | 
					 | 
				
			||||||
		y_max = 48,
 | 
					 | 
				
			||||||
		place_on = def.place_on,
 | 
					 | 
				
			||||||
		deco_type = "simple",
 | 
					 | 
				
			||||||
		flags = "all_floors, all_ceilings"
 | 
					 | 
				
			||||||
	})
 | 
					 | 
				
			||||||
	dids[#dids + 1] = {name = name, spawn_func = spawn_plants}
 | 
					 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
minetest.register_on_mods_loaded(function()
 | 
					 | 
				
			||||||
	for idx, def in ipairs(dids) do
 | 
					 | 
				
			||||||
		local did = minetest.get_decoration_id("vines:" .. def.name)
 | 
					 | 
				
			||||||
		dids[idx] = did
 | 
					 | 
				
			||||||
		spawn_funcs[did] = def.spawn_func
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	minetest.set_gen_notify("decoration", dids)
 | 
					 | 
				
			||||||
end)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
minetest.register_on_generated(function(minp, maxp, blockseed)
 | 
					 | 
				
			||||||
	local g = minetest.get_mapgen_object("gennotify")
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	for _, did in ipairs(dids) do
 | 
					 | 
				
			||||||
		local deco_locations = g["decoration#" .. did]
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
		if deco_locations then
 | 
					 | 
				
			||||||
			local func = spawn_funcs[did]
 | 
					 | 
				
			||||||
			for _, pos in pairs(deco_locations) do
 | 
					 | 
				
			||||||
				func(pos)
 | 
					 | 
				
			||||||
			end
 | 
					 | 
				
			||||||
		end
 | 
					 | 
				
			||||||
	end
 | 
					 | 
				
			||||||
end)
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
-- ALIASES
 | 
					-- ALIASES
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- used to remove the old vine nodes and give room for the new.
 | 
					-- used to remove the old vine nodes and give room for the new.
 | 
				
			||||||
@@ -445,12 +370,19 @@ minetest.register_craft({
 | 
				
			|||||||
if enable_roots ~= false then
 | 
					if enable_roots ~= false then
 | 
				
			||||||
	vines.register_vine('root',
 | 
						vines.register_vine('root',
 | 
				
			||||||
		{description = S("Roots"), average_length = 9}, {
 | 
							{description = S("Roots"), average_length = 9}, {
 | 
				
			||||||
		place_on = {
 | 
							check_air = false,
 | 
				
			||||||
 | 
							avoid_nodes = {"vines:root_middle"},
 | 
				
			||||||
 | 
							avoid_radius = 5,
 | 
				
			||||||
 | 
							surface = {
 | 
				
			||||||
			"default:dirt_with_grass",
 | 
								"default:dirt_with_grass",
 | 
				
			||||||
			"default:dirt"
 | 
								"default:dirt"
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		spawn_on_bottom = true,
 | 
							spawn_on_bottom = true,
 | 
				
			||||||
 | 
							plantlife_limit = -0.6,
 | 
				
			||||||
		rarity = rarity_roots,
 | 
							rarity = rarity_roots,
 | 
				
			||||||
 | 
							tries = 3,
 | 
				
			||||||
 | 
							humidity_min = 0.4,
 | 
				
			||||||
 | 
							temp_min = 0.4,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	minetest.register_alias('vines:root_middle', 'air')
 | 
						minetest.register_alias('vines:root_middle', 'air')
 | 
				
			||||||
@@ -461,14 +393,22 @@ end
 | 
				
			|||||||
if enable_standard ~= false then
 | 
					if enable_standard ~= false then
 | 
				
			||||||
	vines.register_vine('vine',
 | 
						vines.register_vine('vine',
 | 
				
			||||||
		{description = S("Vines"), average_length = 5}, {
 | 
							{description = S("Vines"), average_length = 5}, {
 | 
				
			||||||
		place_on = {
 | 
							check_air = false,
 | 
				
			||||||
 | 
							avoid_nodes = {"group:vines"},
 | 
				
			||||||
 | 
							avoid_radius = 5,
 | 
				
			||||||
 | 
							surface = {
 | 
				
			||||||
 | 
						--		"default:leaves",
 | 
				
			||||||
			"default:jungleleaves",
 | 
								"default:jungleleaves",
 | 
				
			||||||
			"moretrees:jungletree_leaves_red",
 | 
								"moretrees:jungletree_leaves_red",
 | 
				
			||||||
			"moretrees:jungletree_leaves_yellow",
 | 
								"moretrees:jungletree_leaves_yellow",
 | 
				
			||||||
			"moretrees:jungletree_leaves_green"
 | 
								"moretrees:jungletree_leaves_green"
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		spawn_on_bottom = true,
 | 
							spawn_on_bottom = true,
 | 
				
			||||||
 | 
							plantlife_limit = -0.9,
 | 
				
			||||||
		rarity = rarity_standard,
 | 
							rarity = rarity_standard,
 | 
				
			||||||
 | 
							tries = 1,
 | 
				
			||||||
 | 
							humidity_min = 0.7,
 | 
				
			||||||
 | 
							temp_min = 0.4,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	minetest.register_alias('vines:vine_middle', 'air')
 | 
						minetest.register_alias('vines:vine_middle', 'air')
 | 
				
			||||||
@@ -479,14 +419,22 @@ end
 | 
				
			|||||||
if enable_side ~= false then
 | 
					if enable_side ~= false then
 | 
				
			||||||
	vines.register_vine('side',
 | 
						vines.register_vine('side',
 | 
				
			||||||
		{description = S("Vines"), average_length = 6}, {
 | 
							{description = S("Vines"), average_length = 6}, {
 | 
				
			||||||
		place_on = {
 | 
							check_air = false,
 | 
				
			||||||
 | 
							avoid_nodes = {"group:vines", "default:apple"},
 | 
				
			||||||
 | 
							avoid_radius = 3,
 | 
				
			||||||
 | 
							surface = {
 | 
				
			||||||
 | 
						--		"default:leaves",
 | 
				
			||||||
			"default:jungleleaves",
 | 
								"default:jungleleaves",
 | 
				
			||||||
			"moretrees:jungletree_leaves_red",
 | 
								"moretrees:jungletree_leaves_red",
 | 
				
			||||||
			"moretrees:jungletree_leaves_yellow",
 | 
								"moretrees:jungletree_leaves_yellow",
 | 
				
			||||||
			"moretrees:jungletree_leaves_green"
 | 
								"moretrees:jungletree_leaves_green"
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		spawn_on_side = true,
 | 
							spawn_on_side = true,
 | 
				
			||||||
 | 
							plantlife_limit = -0.9,
 | 
				
			||||||
		rarity = rarity_side,
 | 
							rarity = rarity_side,
 | 
				
			||||||
 | 
							tries = 1,
 | 
				
			||||||
 | 
							humidity_min = 0.4,
 | 
				
			||||||
 | 
							temp_min = 0.4,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	minetest.register_alias('vines:side_middle', 'air')
 | 
						minetest.register_alias('vines:side_middle', 'air')
 | 
				
			||||||
@@ -497,25 +445,54 @@ end
 | 
				
			|||||||
if enable_jungle ~= false then
 | 
					if enable_jungle ~= false then
 | 
				
			||||||
	vines.register_vine("jungle",
 | 
						vines.register_vine("jungle",
 | 
				
			||||||
		{description = S("Jungle Vines"), average_length = 7}, {
 | 
							{description = S("Jungle Vines"), average_length = 7}, {
 | 
				
			||||||
		place_on = {
 | 
							check_air = false,
 | 
				
			||||||
 | 
							near_nodes = {
 | 
				
			||||||
 | 
								"default:jungleleaves",
 | 
				
			||||||
 | 
								"moretrees:jungletree_leaves_red",
 | 
				
			||||||
 | 
								"moretrees:jungletree_leaves_yellow",
 | 
				
			||||||
 | 
								"moretrees:jungletree_leaves_green"
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							near_nodes_size = 4,
 | 
				
			||||||
 | 
							near_nodes_vertical = 4,
 | 
				
			||||||
 | 
							avoid_nodes = {
 | 
				
			||||||
 | 
								"vines:jungle_middle",
 | 
				
			||||||
 | 
								"vines:jungle_end",
 | 
				
			||||||
 | 
							},
 | 
				
			||||||
 | 
							avoid_radius = 5,
 | 
				
			||||||
 | 
							surface = {
 | 
				
			||||||
			"default:jungletree",
 | 
								"default:jungletree",
 | 
				
			||||||
			"moretrees:jungletree_trunk"
 | 
								"moretrees:jungletree_trunk"
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		spawn_on_side = true,
 | 
							spawn_on_side = true,
 | 
				
			||||||
 | 
							plantlife_limit = -0.9,
 | 
				
			||||||
		rarity = rarity_jungle,
 | 
							rarity = rarity_jungle,
 | 
				
			||||||
 | 
							tries = 1,
 | 
				
			||||||
 | 
							humidity_min = 0.2,
 | 
				
			||||||
 | 
							temp_min = 0.3,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	minetest.register_alias('vines:jungle_middle', 'air')
 | 
						minetest.register_alias('vines:jungle_middle', 'air')
 | 
				
			||||||
	minetest.register_alias('vines:jungle_end', 'air')
 | 
						minetest.register_alias('vines:jungle_end', 'air')
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
-- WILLOW VINES (Note from 2024-06: Broken for years now, integration w/ new moretrees spawn mechanic needed)
 | 
					-- WILLOW VINES
 | 
				
			||||||
if enable_willow ~= false then
 | 
					if enable_willow ~= false then
 | 
				
			||||||
	vines.register_vine("willow",
 | 
						vines.register_vine( 'willow',
 | 
				
			||||||
		{description = S("Willow Vines"), average_length = 9}, {
 | 
							{description = S("Willow Vines"), average_length = 9}, {
 | 
				
			||||||
 | 
							check_air = false,
 | 
				
			||||||
 | 
							avoid_nodes = {"vines:willow_middle"},
 | 
				
			||||||
 | 
							avoid_radius = 5,
 | 
				
			||||||
 | 
							near_nodes = {'default:water_source'},
 | 
				
			||||||
 | 
							near_nodes_size = 1,
 | 
				
			||||||
 | 
							near_nodes_count = 1,
 | 
				
			||||||
 | 
							near_nodes_vertical = 7,
 | 
				
			||||||
 | 
							plantlife_limit = -0.8,
 | 
				
			||||||
		spawn_on_side = true,
 | 
							spawn_on_side = true,
 | 
				
			||||||
		place_on = {"moretrees:willow_leaves"},
 | 
							surface = {"moretrees:willow_leaves"},
 | 
				
			||||||
		rarity = rarity_willow,
 | 
							rarity = rarity_willow,
 | 
				
			||||||
 | 
							tries = 1,
 | 
				
			||||||
 | 
							humidity_min = 0.5,
 | 
				
			||||||
 | 
							temp_min = 0.5,
 | 
				
			||||||
	})
 | 
						})
 | 
				
			||||||
else
 | 
					else
 | 
				
			||||||
	minetest.register_alias('vines:willow_middle', 'air')
 | 
						minetest.register_alias('vines:willow_middle', 'air')
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -1,4 +1,4 @@
 | 
				
			|||||||
name = vines
 | 
					name = vines
 | 
				
			||||||
description = Adds climbable vines that are spawned on trees.
 | 
					description = Adds climbable vines that are spawned on trees.
 | 
				
			||||||
depends = default
 | 
					depends = default, biome_lib
 | 
				
			||||||
optional_depends = moretrees, ebiomes
 | 
					optional_depends = moretrees
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -7,32 +7,32 @@ vines_enable_rope (Enable vine ropes) bool true
 | 
				
			|||||||
#Enables root vines.
 | 
					#Enables root vines.
 | 
				
			||||||
vines_enable_roots (Enable root vines) bool true
 | 
					vines_enable_roots (Enable root vines) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Rarity of root vines, from 1 to 10, lower numbers are rarer.
 | 
					#Rarity of root vines, from 1 to 100, higher numbers are rarer.
 | 
				
			||||||
vines_rarity_roots (Rarity of roots vines) float 0.5 1 0
 | 
					vines_rarity_roots (Rarity of roots vines) float 95 0 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Enables the standard type of vines.
 | 
					#Enables the standard type of vines.
 | 
				
			||||||
vines_enable_standard (Enable standard vines) bool true
 | 
					vines_enable_standard (Enable standard vines) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Rarity of standard vines, from 1 to 10, lower numbers are rarer.
 | 
					#Rarity of standard vines, from 1 to 100, higher numbers are rarer.
 | 
				
			||||||
vines_rarity_standard (Rarity of standard vines) float 0.2 1 0
 | 
					vines_rarity_standard (Rarity of standard vines) float 95 0 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Enables the type of vines that grow on the sides of leaf blocks.
 | 
					#Enables the type of vines that grow on the sides of leaf blocks.
 | 
				
			||||||
vines_enable_side (Enable side vines) bool true
 | 
					vines_enable_side (Enable side vines) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Rarity of side vines, from 1 to 10, lower numbers are rarer.
 | 
					#Rarity of side vines, from 1 to 100, higher numbers are rarer.
 | 
				
			||||||
vines_rarity_side (Rarity of side vines) float 0.2 1 0
 | 
					vines_rarity_side (Rarity of side vines) float 95 0 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Enables jungle style vines.
 | 
					#Enables jungle style vines.
 | 
				
			||||||
vines_enable_jungle (Enable jungle vines) bool true
 | 
					vines_enable_jungle (Enable jungle vines) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Rarity of jungle vines, from 1 to 10, lower numbers are rarer.
 | 
					#Rarity of jungle vines, from 1 to 100, higher numbers are rarer.
 | 
				
			||||||
vines_rarity_jungle (Rarity of jungle vines) float 0.2 1 0
 | 
					vines_rarity_jungle (Rarity of jungle vines) float 95 0 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Enables willow vines.
 | 
					#Enables willow vines.
 | 
				
			||||||
vines_enable_willow (Enable willow vines) bool true
 | 
					vines_enable_willow (Enable willow vines) bool true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Rarity of willow vines, from 1 to 10, lower numbers are rarer.
 | 
					#Rarity of willow vines, from 1 to 100, higher numbers are rarer.
 | 
				
			||||||
vines_rarity_willow (Rarity of willow vines) float 0.2 1 0
 | 
					vines_rarity_willow (Rarity of willow vines) float 95 0 100
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#Vine growth speed, minimum number of seconds between each growth.
 | 
					#Vine growth speed, minimum number of seconds between each growth.
 | 
				
			||||||
vines_growth_min (Minimum number of seconds between growth) int 180 1 3600
 | 
					vines_growth_min (Minimum number of seconds between growth) int 180 1 3600
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user