forked from mtcontrib/bonemeal
		
	Compare commits
	
		
			16 Commits
		
	
	
		
			52ada84c58
			...
			d357709339
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| d357709339 | |||
| 
						 | 
					1f4c1a1fd7 | ||
| 
						 | 
					9ceeb63c8a | ||
| 
						 | 
					1315e2cc5f | ||
| 
						 | 
					4a0eddef02 | ||
| 
						 | 
					e163e815d6 | ||
| 
						 | 
					08ed68a8b7 | ||
| 
						 | 
					1a1c49ba06 | ||
| 
						 | 
					996094dd5c | ||
| 
						 | 
					bb34fbae3d | ||
| 
						 | 
					5f81c3dfa2 | ||
| 131024ee97 | |||
| 
						 | 
					804343f7c0 | ||
| 
						 | 
					4c50a02a0e | ||
| 52a3856f26 | |||
| 
						 | 
					79f9cb3294 | 
@@ -33,5 +33,6 @@ Changelog:
 | 
			
		||||
- 1.1 - Added {can_bonemeal=1} group for special nodes
 | 
			
		||||
- 1.2 - Added support for minetest 5.0 cactus seedling, blueberry bush sapling and emergent jungle tree saplings, additional flowers and pine bush sapling.
 | 
			
		||||
- 1.3 - Ability to craft dye from mulch, bonemeal and fertiliser (thanks orbea)
 | 
			
		||||
- 1.4 - Add support for fern saplings from plantlife mod (thanks nixnoxus)
 | 
			
		||||
 | 
			
		||||
Lucky Blocks: 6
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								api.txt
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								api.txt
									
									
									
									
									
								
							@@ -15,7 +15,7 @@ Adding Crops
 | 
			
		||||
------------
 | 
			
		||||
 | 
			
		||||
bonemeal:add_crop({
 | 
			
		||||
	{ nodename_start, growing_steps, seed_name }
 | 
			
		||||
	{ nodename_start, growing_steps, seed_name, ignore_light }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
This command is used to add new crops for bonemeal to work on.
 | 
			
		||||
@@ -25,6 +25,7 @@ e.g.
 | 
			
		||||
bonemeal:add_crop({
 | 
			
		||||
	{"farming:cotton_", 8, "farming:seed_cotton"},
 | 
			
		||||
	{"farming:wheat_", 8, "farming:seed_wheat"},
 | 
			
		||||
	{"mymod:dark_wheat_", 8, "mymod:dark_wheat_seed", true}, -- can grow in darkness
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -32,7 +33,7 @@ Adding Saplings
 | 
			
		||||
---------------
 | 
			
		||||
 | 
			
		||||
bonemeal:add_sapling({
 | 
			
		||||
	{ sapling_node, function, soil_type[sand, dirt, nodename] }
 | 
			
		||||
	{ sapling_node, function, soil_type["sand", "dirt", nodename, "group:"], ignore_light }
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
This command will add new saplings for bonemeal to grow on sand, soil or a
 | 
			
		||||
@@ -41,6 +42,7 @@ specified node type.
 | 
			
		||||
bonemeal:add_sapling({
 | 
			
		||||
	{"ethereal:palm_sapling", ethereal.grow_palm_tree, "soil"},
 | 
			
		||||
	{"ethereal:palm_sapling", ethereal.grow_palm_tree, "sand"},
 | 
			
		||||
	{"mymod:dark_tree", mymod.dark_tree, "group:soil", true}, -- can grow in darkness
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -7,3 +7,8 @@ technic_worldgen?
 | 
			
		||||
lucky_block?
 | 
			
		||||
flowers?
 | 
			
		||||
dye?
 | 
			
		||||
ferns?
 | 
			
		||||
dryplants?
 | 
			
		||||
df_trees?
 | 
			
		||||
df_farming?
 | 
			
		||||
df_primordial_items?
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										125
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										125
									
								
								init.lua
									
									
									
									
									
								
							@@ -62,7 +62,7 @@ local saplings = {
 | 
			
		||||
	{"default:blueberry_bush_sapling", default.grow_blueberry_bush, "soil"},
 | 
			
		||||
	{"default:pine_bush_sapling", default.grow_pine_bush, "soil"},
 | 
			
		||||
	{"default:cactus", cactus_grow, "sand"},
 | 
			
		||||
	{"default:papyrus", papyrus_grow, "soil"},
 | 
			
		||||
	{"default:papyrus", papyrus_grow, "soil"}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- helper tables ( "" denotes a blank item )
 | 
			
		||||
@@ -86,7 +86,8 @@ minetest.after(0.1, function()
 | 
			
		||||
		if def.groups
 | 
			
		||||
		and def.groups.flower
 | 
			
		||||
		and not node:find("waterlily")
 | 
			
		||||
		and not node:find("xdecor:potted_") then
 | 
			
		||||
		and not node:find("xdecor:potted_")
 | 
			
		||||
		and not node:find("df_farming:") then
 | 
			
		||||
			flowers[#flowers + 1] = node
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
@@ -95,12 +96,15 @@ end)
 | 
			
		||||
 | 
			
		||||
-- default biomes deco
 | 
			
		||||
local deco = {
 | 
			
		||||
	{"default:dirt", green_grass, flowers},
 | 
			
		||||
	{"default:dirt_with_grass", green_grass, flowers},
 | 
			
		||||
	{"default:dry_dirt", dry_grass, {}},
 | 
			
		||||
	{"default:dry_dirt_with_dry_grass", dry_grass, {}},
 | 
			
		||||
	{"default:dirt_with_dry_grass", dry_grass, flowers},
 | 
			
		||||
	{"default:sand", {}, {"default:dry_shrub", "", "", ""} },
 | 
			
		||||
	{"default:desert_sand", {}, {"default:dry_shrub", "", "", ""} },
 | 
			
		||||
	{"default:silver_sand", {}, {"default:dry_shrub", "", "", ""} },
 | 
			
		||||
	{"default:dirt_with_rainforest_litter", {}, {"default:junglegrass", "", "", ""}}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@@ -150,7 +154,7 @@ end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- sapling check
 | 
			
		||||
local function check_sapling(pos, nodename)
 | 
			
		||||
local function check_sapling(pos, sapling_node, light_ok)
 | 
			
		||||
 | 
			
		||||
	-- what is sapling placed on?
 | 
			
		||||
	local under =  minetest.get_node({
 | 
			
		||||
@@ -164,36 +168,36 @@ local function check_sapling(pos, nodename)
 | 
			
		||||
	-- check list for sapling and function
 | 
			
		||||
	for n = 1, #saplings do
 | 
			
		||||
 | 
			
		||||
		if saplings[n][1] == nodename then
 | 
			
		||||
		if saplings[n][1] == sapling_node then
 | 
			
		||||
 | 
			
		||||
			grow_on = saplings[n][3]
 | 
			
		||||
			grow_on = saplings[n][3] or ""
 | 
			
		||||
 | 
			
		||||
			-- sapling grows on top of specific node
 | 
			
		||||
			if grow_on
 | 
			
		||||
			and grow_on ~= "soil"
 | 
			
		||||
			and grow_on ~= "sand"
 | 
			
		||||
			and grow_on == under.name then
 | 
			
		||||
			-- backwards compatibility, add 'group:' to older grouping
 | 
			
		||||
			if grow_on == "soil" or grow_on == "sand" then
 | 
			
		||||
				grow_on = "group:" .. grow_on
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			-- sapling grows on top of specific node group
 | 
			
		||||
			if grow_on:find("group:") then
 | 
			
		||||
 | 
			
		||||
				local group = grow_on:split(":")[2]
 | 
			
		||||
 | 
			
		||||
				if minetest.get_item_group(under.name, group) > 0 then
 | 
			
		||||
					can_grow = true
 | 
			
		||||
				end
 | 
			
		||||
 | 
			
		||||
			-- sapling grows on specific node
 | 
			
		||||
			elseif grow_on == under.name then
 | 
			
		||||
				can_grow = true
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			-- sapling grows on top of soil (default)
 | 
			
		||||
			if can_grow == nil
 | 
			
		||||
			and (grow_on == nil or grow_on == "soil")
 | 
			
		||||
			and minetest.get_item_group(under.name, "soil") > 0 then
 | 
			
		||||
				can_grow = true
 | 
			
		||||
			end
 | 
			
		||||
			-- check if we can grow sapling at current light level
 | 
			
		||||
			if can_grow and (light_ok or saplings[n][4] == true) then
 | 
			
		||||
 | 
			
		||||
			-- sapling grows on top of sand
 | 
			
		||||
			if can_grow == nil
 | 
			
		||||
			and grow_on == "sand"
 | 
			
		||||
			and minetest.get_item_group(under.name, "sand") > 0 then
 | 
			
		||||
				can_grow = true
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			-- check if we can grow sapling
 | 
			
		||||
			if can_grow then
 | 
			
		||||
				particle_effect(pos)
 | 
			
		||||
 | 
			
		||||
				grow_tree(pos, saplings[n][2])
 | 
			
		||||
 | 
			
		||||
				return true
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
@@ -202,33 +206,50 @@ end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- crops check
 | 
			
		||||
local function check_crops(pos, nodename, strength)
 | 
			
		||||
local function check_crops(pos, nodename, strength, light_ok)
 | 
			
		||||
 | 
			
		||||
	local mod, crop, stage, nod, def
 | 
			
		||||
 | 
			
		||||
	-- grow registered crops
 | 
			
		||||
	for n = 1, #crops do
 | 
			
		||||
 | 
			
		||||
		if nodename:find(crops[n][1])
 | 
			
		||||
		or nodename == crops[n][3] then
 | 
			
		||||
		-- check if crop can grow in current light level
 | 
			
		||||
		if (light_ok or crops[n][4] == true)
 | 
			
		||||
		and (nodename:find(crops[n][1])
 | 
			
		||||
		or nodename == crops[n][3]) then
 | 
			
		||||
 | 
			
		||||
			-- separate mod and node name
 | 
			
		||||
			mod = nodename:split(":")[1] .. ":"
 | 
			
		||||
			crop = nodename:split(":")[2]
 | 
			
		||||
 | 
			
		||||
			-- get stage number or set to 0 for seed
 | 
			
		||||
			stage = tonumber( crop:split("_")[2] ) or 0
 | 
			
		||||
			if crop:split("_")[3] then
 | 
			
		||||
				stage = crop:split("_")[3]
 | 
			
		||||
			else
 | 
			
		||||
				stage = crop:split("_")[2]
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			stage = tonumber(stage) or 0
 | 
			
		||||
 | 
			
		||||
			stage = min(stage + strength, crops[n][2])
 | 
			
		||||
 | 
			
		||||
			-- check for place_param setting
 | 
			
		||||
			nod = crops[n][1] .. stage
 | 
			
		||||
			def = minetest.registered_nodes[nod]
 | 
			
		||||
 | 
			
		||||
			-- make sure crop exists or isn't fully grown already
 | 
			
		||||
			if not def or nod == nodename then
 | 
			
		||||
				return false
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			def = def and def.place_param2 or 0
 | 
			
		||||
 | 
			
		||||
			minetest.set_node(pos, {name = nod, param2 = def})
 | 
			
		||||
 | 
			
		||||
			particle_effect(pos)
 | 
			
		||||
 | 
			
		||||
			minetest.get_node_timer(pos):start(10) -- restart any timers
 | 
			
		||||
 | 
			
		||||
			return true
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
@@ -241,33 +262,21 @@ local function check_soil(pos, nodename, strength)
 | 
			
		||||
	-- set radius according to strength
 | 
			
		||||
	local side = strength - 1
 | 
			
		||||
	local tall = max(strength - 2, 0)
 | 
			
		||||
	local floor
 | 
			
		||||
	local groups = minetest.registered_items[nodename]
 | 
			
		||||
		and minetest.registered_items[nodename].groups or {}
 | 
			
		||||
 | 
			
		||||
	-- only place decoration on one type of surface
 | 
			
		||||
	if groups.soil then
 | 
			
		||||
		floor = {"group:soil"}
 | 
			
		||||
	elseif groups.sand then
 | 
			
		||||
		floor = {"group:sand"}
 | 
			
		||||
	else
 | 
			
		||||
		floor = {nodename}
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- get area of land with free space above
 | 
			
		||||
	local dirt = minetest.find_nodes_in_area_under_air(
 | 
			
		||||
		{x = pos.x - side, y = pos.y - tall, z = pos.z - side},
 | 
			
		||||
		{x = pos.x + side, y = pos.y + tall, z = pos.z + side}, floor)
 | 
			
		||||
		{x = pos.x + side, y = pos.y + tall, z = pos.z + side}, {nodename})
 | 
			
		||||
 | 
			
		||||
	-- set default grass and decoration
 | 
			
		||||
	local grass = green_grass
 | 
			
		||||
	local decor = flowers
 | 
			
		||||
	local grass, decor
 | 
			
		||||
 | 
			
		||||
	-- choose grass and decoration to use on dirt patch
 | 
			
		||||
	for n = 1, #deco do
 | 
			
		||||
 | 
			
		||||
		-- do we have a grass match?
 | 
			
		||||
		if nodename == deco[n][1] then
 | 
			
		||||
 | 
			
		||||
			grass = deco[n][2] or {}
 | 
			
		||||
			decor = deco[n][3] or {}
 | 
			
		||||
		end
 | 
			
		||||
@@ -320,7 +329,7 @@ end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- add to sapling list
 | 
			
		||||
-- {sapling node, schematic or function name, "soil"|"sand"|specific_node}
 | 
			
		||||
-- {sapling node, schematic or function name, "soil"|"sand"|specific_node|"group:"}
 | 
			
		||||
--e.g. {"default:sapling", default.grow_new_apple_tree, "soil"}
 | 
			
		||||
 | 
			
		||||
function bonemeal:add_sapling(list)
 | 
			
		||||
@@ -469,19 +478,20 @@ function bonemeal:on_use(pos, strength, node)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- light check depending on strength (strength of 4 = no light needed)
 | 
			
		||||
	local light_ok = true
 | 
			
		||||
 | 
			
		||||
	if (minetest.get_node_light(pos) or 0) < (12 - (strength * 3)) then
 | 
			
		||||
		return
 | 
			
		||||
		light_ok = nil
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- check for tree growth if pointing at sapling
 | 
			
		||||
	if minetest.get_item_group(node.name, "sapling") > 0
 | 
			
		||||
	and random(5 - strength) == 1 then
 | 
			
		||||
		check_sapling(pos, node.name)
 | 
			
		||||
	-- check for sapling growth
 | 
			
		||||
	if random(5 - strength) == 1
 | 
			
		||||
	and check_sapling(pos, node.name, light_ok) then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- check for crop growth
 | 
			
		||||
	if check_crops(pos, node.name, strength) then
 | 
			
		||||
	if check_crops(pos, node.name, strength, light_ok) then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
@@ -611,37 +621,33 @@ minetest.register_craft({
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"group:bone", "group:bone", "group:bone"},
 | 
			
		||||
		{"bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water"},
 | 
			
		||||
		{"bucket:bucket_water", "default:torch", "bucket:bucket_water"},
 | 
			
		||||
		{"bucket:bucket_water", "default:torch", "bucket:bucket_water"}
 | 
			
		||||
	},
 | 
			
		||||
	replacements = {
 | 
			
		||||
		{"bucket:bucket_water", "bucket:bucket_empty 5"},
 | 
			
		||||
		{"bucket:bucket_water", "bucket:bucket_empty 5"}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- bonemeal (from bone)
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
--	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:bonemeal 2",
 | 
			
		||||
	recipe = {{"group:bone"}}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- bonemeal (from player bones)
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
--	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:bonemeal 4",
 | 
			
		||||
	recipe = {{"bones:bones"}}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- bonemeal (from coral skeleton)
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
--	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:bonemeal 2",
 | 
			
		||||
	recipe = {{"default:coral_skeleton"}}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- mulch
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
--	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:mulch 4",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"group:tree", "group:leaves", "group:leaves"},
 | 
			
		||||
@@ -651,7 +657,6 @@ minetest.register_craft({
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
--	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:mulch",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"group:seed", "group:seed", "group:seed"},
 | 
			
		||||
@@ -662,7 +667,6 @@ minetest.register_craft({
 | 
			
		||||
 | 
			
		||||
-- fertiliser
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
--	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:fertiliser 2",
 | 
			
		||||
	recipe = {{"bonemeal:bonemeal", "bonemeal:mulch"}}
 | 
			
		||||
})
 | 
			
		||||
@@ -691,4 +695,5 @@ end
 | 
			
		||||
dofile(path .. "/mods.lua")
 | 
			
		||||
dofile(path .. "/lucky_block.lua")
 | 
			
		||||
 | 
			
		||||
print (S("[MOD] bonemeal loaded"))
 | 
			
		||||
 | 
			
		||||
print ("[MOD] bonemeal loaded")
 | 
			
		||||
 
 | 
			
		||||
@@ -22,8 +22,7 @@ if minetest.get_modpath("lucky_block") then
 | 
			
		||||
		{"nod", "default:chest", 0, {
 | 
			
		||||
			{name = "bonemeal:mulch", max = 20},
 | 
			
		||||
			{name = "bonemeal:bonemeal", max = 15},
 | 
			
		||||
			{name = "bonemeal:fertiliser", max = 10},
 | 
			
		||||
		}},
 | 
			
		||||
			{name = "bonemeal:fertiliser", max = 10}
 | 
			
		||||
		}}
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										2
									
								
								mod.conf
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								mod.conf
									
									
									
									
									
								
							@@ -1,4 +1,4 @@
 | 
			
		||||
name = bonemeal
 | 
			
		||||
depends = default
 | 
			
		||||
optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye
 | 
			
		||||
optional_depends = intllib, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants, df_trees, df_farming, df_primordial_items
 | 
			
		||||
description = Adds bone and bonemeal giving the ability to quickly grow plants and saplings.
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										140
									
								
								mods.lua
									
									
									
									
									
								
							
							
						
						
									
										140
									
								
								mods.lua
									
									
									
									
									
								
							@@ -3,9 +3,8 @@
 | 
			
		||||
if minetest.get_modpath("animalmaterials") then
 | 
			
		||||
 | 
			
		||||
	minetest.register_craft({
 | 
			
		||||
		type = "shapeless",
 | 
			
		||||
		output = "bonemeal:bonemeal 2",
 | 
			
		||||
		recipe = {"animalmaterials:bone"}
 | 
			
		||||
		recipe = {{"animalmaterials:bone"}}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
@@ -115,13 +114,11 @@ if minetest.get_modpath("moretrees") then
 | 
			
		||||
		{"moretrees:apple_tree_sapling", moretrees.spawn_apple_tree_object, "soil"},
 | 
			
		||||
		{"moretrees:oak_sapling", moretrees.spawn_oak_object, "soil"},
 | 
			
		||||
		{"moretrees:sequoia_sapling", moretrees.spawn_sequoia_object, "soil"},
 | 
			
		||||
		--{"moretrees:birch_sapling", moretrees.spawn_birch_object, "soil"},
 | 
			
		||||
		{"moretrees:birch_sapling", moretrees.grow_birch, "soil"},
 | 
			
		||||
		{"moretrees:palm_sapling", moretrees.spawn_palm_object, "soil"},
 | 
			
		||||
		{"moretrees:palm_sapling", moretrees.spawn_palm_object, "sand"},
 | 
			
		||||
		{"moretrees:date_palm_sapling", moretrees.spawn_date_palm_object, "soil"},
 | 
			
		||||
		{"moretrees:date_palm_sapling", moretrees.spawn_date_palm_object, "sand"},
 | 
			
		||||
		--{"moretrees:spruce_sapling", moretrees.spawn_spruce_object, "soil"},
 | 
			
		||||
		{"moretrees:spruce_sapling", moretrees.grow_spruce, "soil"},
 | 
			
		||||
		{"moretrees:cedar_sapling", moretrees.spawn_cedar_object, "soil"},
 | 
			
		||||
		{"moretrees:poplar_sapling", moretrees.spawn_poplar_object, "soil"},
 | 
			
		||||
@@ -155,6 +152,29 @@ if minetest.get_modpath("caverealms") then
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
local function y_func(grow_func)
 | 
			
		||||
	return function(pos)
 | 
			
		||||
		grow_func({x = pos.x, y = pos.y - 1, z = pos.z})
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("ferns") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"ferns:sapling_giant_tree_fern", y_func(abstract_ferns.grow_giant_tree_fern), "soil"},
 | 
			
		||||
		{"ferns:sapling_giant_tree_fern", y_func(abstract_ferns.grow_giant_tree_fern), "sand"},
 | 
			
		||||
		{"ferns:sapling_tree_fern", y_func(abstract_ferns.grow_tree_fern), "soil"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("dryplants") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"dryplants:reedmace_sapling", y_func(abstract_dryplants.grow_reedmace), "soil"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("dye") then
 | 
			
		||||
 | 
			
		||||
	local bonemeal_dyes = {
 | 
			
		||||
@@ -170,3 +190,115 @@ if minetest.get_modpath("dye") then
 | 
			
		||||
		})
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("df_trees") then
 | 
			
		||||
 | 
			
		||||
	local function spore_tree_fix(pos)
 | 
			
		||||
		minetest.set_node(pos, {name = "air"})
 | 
			
		||||
		df_trees.spawn_spore_tree(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function fungiwood_fix(pos)
 | 
			
		||||
		minetest.set_node(pos, {name = "air"})
 | 
			
		||||
		df_trees.spawn_fungiwood(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function tunnel_fix(pos)
 | 
			
		||||
		minetest.set_node(pos, {name = "air"})
 | 
			
		||||
		df_trees.spawn_tunnel_tube(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"df_trees:black_cap_sapling", df_trees.spawn_black_cap, "soil", true},
 | 
			
		||||
		{"df_trees:fungiwood_sapling", fungiwood_fix, "soil", true},
 | 
			
		||||
		{"df_trees:goblin_cap_sapling", df_trees.spawn_goblin_cap, "soil", true},
 | 
			
		||||
		{"df_trees:spore_tree_sapling", spore_tree_fix, "soil", true},
 | 
			
		||||
		{"df_trees:tower_cap_sapling", df_trees.spawn_tower_cap, "soil", true},
 | 
			
		||||
		{"df_trees:tunnel_tube_sapling", tunnel_fix, "soil", true},
 | 
			
		||||
		{"df_trees:nether_cap_sapling", df_trees.spawn_nether_cap, "group:nether_cap", true},
 | 
			
		||||
		{"df_trees:nether_cap_sapling", df_trees.spawn_nether_cap, "group:cools_lava", true}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("df_farming") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_crop({
 | 
			
		||||
		{"df_farming:cave_wheat_", 8, "df_farming:cave_wheat_seed", true},
 | 
			
		||||
		{"df_farming:dimple_cup_", 4, "df_farming:dimple_cup_seed", true},
 | 
			
		||||
		{"df_farming:pig_tail_", 8, "df_farming:pig_tail_seed", true},
 | 
			
		||||
		{"df_farming:plump_helmet_", 4, "df_farming:plump_helmet_spawn", true},
 | 
			
		||||
		{"df_farming:quarry_bush_", 5, "df_farming:quarry_bush_seed", true},
 | 
			
		||||
		{"df_farming:sweet_pod_", 6, "df_farming:sweet_pod_seed", true}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("df_primordial_items") then
 | 
			
		||||
 | 
			
		||||
	local function mush_fix(pos)
 | 
			
		||||
		minetest.set_node(pos, {name = "air"})
 | 
			
		||||
		mapgen_helper.place_schematic(pos,
 | 
			
		||||
			df_primordial_items.get_primordial_mushroom(), (math.random(1,4)-1)*90)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function fern_fix(pos)
 | 
			
		||||
		minetest.set_node(pos, {name = "air"})
 | 
			
		||||
		local rotations = {0, 90, 180, 270}
 | 
			
		||||
		mapgen_helper.place_schematic(pos,
 | 
			
		||||
			df_primordial_items.get_fern_schematic(), rotations[math.random(1,#rotations)])
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function blood_fix(pos)
 | 
			
		||||
		df_trees.grow_blood_thorn(pos, minetest.get_node(pos))
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"df_primordial_items:jungle_mushroom_sapling",
 | 
			
		||||
			df_primordial_items.spawn_jungle_mushroom, "soil", true},
 | 
			
		||||
		{"df_primordial_items:jungletree_sapling",
 | 
			
		||||
			df_primordial_items.spawn_jungle_tree, "soil", true},
 | 
			
		||||
		{"df_primordial_items:mush_sapling", mush_fix, "soil", true},
 | 
			
		||||
		{"df_primordial_items:fern_sapling", fern_fix, "soil", true},
 | 
			
		||||
		{"df_trees:blood_thorn", blood_fix, "sand", true}
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	local jgrass = {
 | 
			
		||||
		"df_primordial_items:jungle_grass_1",
 | 
			
		||||
		"df_primordial_items:jungle_grass_2",
 | 
			
		||||
		"df_primordial_items:jungle_grass_3",
 | 
			
		||||
		"df_primordial_items:fern_1",
 | 
			
		||||
		"df_primordial_items:fern_2",
 | 
			
		||||
		"", "", "", ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	local jdeco = {
 | 
			
		||||
		"df_primordial_items:jungle_mushroom_1",
 | 
			
		||||
		"df_primordial_items:jungle_mushroom_2",
 | 
			
		||||
		"df_primordial_items:glow_plant_1",
 | 
			
		||||
		"df_primordial_items:glow_plant_2",
 | 
			
		||||
		"df_primordial_items:glow_plant_3",
 | 
			
		||||
		"", "", ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_deco({
 | 
			
		||||
		{"df_primordial_items:dirt_with_jungle_grass", jgrass, jdeco}
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	local fgrass = {
 | 
			
		||||
		"df_primordial_items:fungal_grass_1",
 | 
			
		||||
		"df_primordial_items:fungal_grass_2",
 | 
			
		||||
		"", "", "", ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	local fdeco = {
 | 
			
		||||
		"df_primordial_items:glow_orb_stalks",
 | 
			
		||||
		"df_primordial_items:glow_pods",
 | 
			
		||||
		"", "", ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_deco({
 | 
			
		||||
		{"df_primordial_items:dirt_with_mycelium", fgrass, fdeco}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user