mirror of
				https://github.com/mt-mods/plantlife_modpack.git
				synced 2025-11-03 23:25:26 +01:00 
			
		
		
		
	Compare commits
	
		
			8 Commits
		
	
	
		
			2018-11-09
			...
			2019-06-18
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					3d13053d97 | ||
| 
						 | 
					07b6fc48ea | ||
| 
						 | 
					9a3d101c89 | ||
| 
						 | 
					0d228f705c | ||
| 
						 | 
					229d6aba88 | ||
| 
						 | 
					4e32feaa55 | ||
| 
						 | 
					b9b592af44 | ||
| 
						 | 
					08698ecd60 | 
@@ -14,10 +14,10 @@ local S = plantlife_i18n.gettext
 | 
			
		||||
-- lot of code, lot to load
 | 
			
		||||
 | 
			
		||||
abstract_ferns.grow_giant_tree_fern = function(pos)
 | 
			
		||||
	local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
 | 
			
		||||
	if minetest.get_node(pos_01).name ~= "air"
 | 
			
		||||
			and minetest.get_node(pos_01).name ~= "ferns:sapling_giant_tree_fern"
 | 
			
		||||
			and minetest.get_node(pos_01).name ~= "default:junglegrass" then
 | 
			
		||||
	local pos_aux = {x = pos.x, y = pos.y + 1, z = pos.z}
 | 
			
		||||
	local name = minetest.get_node(pos_aux).name
 | 
			
		||||
	if name ~= "air" and name ~= "ferns:sapling_giant_tree_fern"
 | 
			
		||||
			and name ~= "default:junglegrass" then
 | 
			
		||||
		return
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
@@ -64,7 +64,9 @@ abstract_ferns.grow_giant_tree_fern = function(pos)
 | 
			
		||||
 | 
			
		||||
	local brk = false
 | 
			
		||||
	for i = 1, size-3 do
 | 
			
		||||
		if minetest.get_node({x = pos.x, y = pos.y + i, z = pos.z}).name ~= "air" then
 | 
			
		||||
		pos_aux.y = pos.y + i
 | 
			
		||||
		local name = minetest.get_node(pos_aux).name
 | 
			
		||||
		if not (name == "air" or (i == 1 and name == "ferns:sapling_giant_tree_fern")) then
 | 
			
		||||
			brk = true
 | 
			
		||||
			break
 | 
			
		||||
		end
 | 
			
		||||
 
 | 
			
		||||
@@ -13,10 +13,10 @@ assert(abstract_ferns.config.enable_treefern == true)
 | 
			
		||||
 | 
			
		||||
abstract_ferns.grow_tree_fern = function(pos)
 | 
			
		||||
 | 
			
		||||
	local pos_01 = {x = pos.x, y = pos.y + 1, z = pos.z}
 | 
			
		||||
	if minetest.get_node(pos_01).name ~= "air"
 | 
			
		||||
			and minetest.get_node(pos_01).name ~= "ferns:sapling_tree_fern"
 | 
			
		||||
			and minetest.get_node(pos_01).name ~= "default:junglegrass" then
 | 
			
		||||
	local pos_aux = {x = pos.x, y = pos.y + 1, z = pos.z}
 | 
			
		||||
	local name = minetest.get_node(pos_aux).name
 | 
			
		||||
	if name ~= "air" and name ~= "ferns:sapling_tree_fern"
 | 
			
		||||
			and name ~= "default:junglegrass" then
 | 
			
		||||
		return
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
@@ -30,7 +30,9 @@ abstract_ferns.grow_tree_fern = function(pos)
 | 
			
		||||
	local i = 1
 | 
			
		||||
	local brk = false
 | 
			
		||||
	while (i < size) do
 | 
			
		||||
		if minetest.get_node({x = pos.x, y = pos.y + i, z = pos.z}).name ~= "air" then
 | 
			
		||||
		pos_aux.y = pos.y + i
 | 
			
		||||
		name = minetest.get_node(pos_aux).name
 | 
			
		||||
		if not (name == "air" or (i == 1 and name == "ferns:sapling_tree_fern")) then
 | 
			
		||||
			brk = true
 | 
			
		||||
			break
 | 
			
		||||
		end
 | 
			
		||||
 
 | 
			
		||||
@@ -2,5 +2,5 @@
 | 
			
		||||
 | 
			
		||||
Molehills_Max_Count		= 320 -- absolute maximum number in an area of 80x80x80 nodes
 | 
			
		||||
 | 
			
		||||
Molehills_Rarity		= 87 -- larger values make molehills more rare (100 means chance of 0 %)
 | 
			
		||||
Molehills_Rarity		= 95 -- larger values make molehills more rare (100 means chance of 0 %)
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,14 +1,5 @@
 | 
			
		||||
-- Code by Mossmanikin, Neuromancer, and others
 | 
			
		||||
 | 
			
		||||
local function clone_node(name)
 | 
			
		||||
	local node2 = {}
 | 
			
		||||
	local node = minetest.registered_nodes[name]
 | 
			
		||||
	for k,v in pairs(node) do
 | 
			
		||||
		node2[k]=v
 | 
			
		||||
	end
 | 
			
		||||
	return node2
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-----------------------------------------------------------------------------------------------
 | 
			
		||||
-- TWiGS
 | 
			
		||||
-----------------------------------------------------------------------------------------------
 | 
			
		||||
@@ -230,7 +221,7 @@ for i in pairs(TRuNKS) do
 | 
			
		||||
	if minetest.get_modpath(MoD) ~= nil
 | 
			
		||||
	and NR < 6 -- moretrees trunks allready have facedir
 | 
			
		||||
	and minetest.registered_nodes[trunkname] then -- the node being called exists.
 | 
			
		||||
			temptrunk = clone_node(trunkname)
 | 
			
		||||
			temptrunk = minetest.registered_nodes[trunkname]
 | 
			
		||||
			temptrunk.paramtype2 = "facedir"
 | 
			
		||||
			minetest.register_node(":"..trunkname, temptrunk)
 | 
			
		||||
	end
 | 
			
		||||
 
 | 
			
		||||
@@ -3,6 +3,8 @@ vines = {
 | 
			
		||||
	recipes = {}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local enable_roots = minetest.settings:get_bool("vines_enable_roots")
 | 
			
		||||
 | 
			
		||||
-- support for i18n
 | 
			
		||||
local S = plantlife_i18n.gettext
 | 
			
		||||
 | 
			
		||||
@@ -11,7 +13,7 @@ local S = plantlife_i18n.gettext
 | 
			
		||||
minetest.register_craftitem("vines:vines", {
 | 
			
		||||
	description = S("Vines"),
 | 
			
		||||
	inventory_image = "vines_item.png",
 | 
			
		||||
	group = {vines = 1, flammable = 2}
 | 
			
		||||
	groups = {vines = 1, flammable = 2}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- FUNCTIONS
 | 
			
		||||
@@ -305,6 +307,14 @@ minetest.register_tool("vines:shears", {
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- VINES
 | 
			
		||||
local spawn_root_surfaces = {}
 | 
			
		||||
 | 
			
		||||
if enable_roots ~= false then
 | 
			
		||||
	spawn_root_surfaces = {
 | 
			
		||||
		"default:dirt_with_grass",
 | 
			
		||||
		"default:dirt"
 | 
			
		||||
	}
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
vines.register_vine('root',
 | 
			
		||||
	{description = S("Roots"), average_length = 9}, {
 | 
			
		||||
@@ -313,10 +323,7 @@ vines.register_vine('root',
 | 
			
		||||
	avoid_radius = 5,
 | 
			
		||||
	spawn_delay = 500,
 | 
			
		||||
	spawn_chance = 10,
 | 
			
		||||
	spawn_surfaces = {
 | 
			
		||||
		"default:dirt_with_grass",
 | 
			
		||||
		"default:dirt"
 | 
			
		||||
	},
 | 
			
		||||
	spawn_surfaces = spawn_root_surfaces,
 | 
			
		||||
	spawn_on_bottom = true,
 | 
			
		||||
	plantlife_limit = -0.6,
 | 
			
		||||
	humidity_min = 0.4,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user