forked from mtcontrib/bonemeal
		
	Compare commits
	
		
			71 Commits
		
	
	
		
			nalc-1.2.0
			...
			master
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					a200c9913e | ||
| 
						 | 
					be412804df | ||
| 
						 | 
					d6893aae07 | ||
| 
						 | 
					81f36673d3 | ||
| 
						 | 
					c2d76b779d | ||
| 
						 | 
					0d852bff0a | ||
| 
						 | 
					2a4ddd96db | ||
| 
						 | 
					09fa9d6251 | ||
| 
						 | 
					4f8ca6a0a5 | ||
| 
						 | 
					c4ac6f8490 | ||
| 
						 | 
					8e929e5a1c | ||
| 
						 | 
					7c89cd6b70 | ||
| 
						 | 
					862fd2bb1c | ||
| 
						 | 
					2db3f4b026 | ||
| 
						 | 
					6d21268470 | ||
| 
						 | 
					10dbedd1e8 | ||
| 
						 | 
					34e8c4a106 | ||
| 
						 | 
					8b98f5e497 | ||
| 
						 | 
					ef937049d2 | ||
| 
						 | 
					6abbd5fb5e | ||
| 
						 | 
					e57dc18818 | ||
| 
						 | 
					a93fc5da3d | ||
| 
						 | 
					a1e5d541c4 | ||
| 
						 | 
					0c0f9d1e89 | ||
| 
						 | 
					73082b9fac | ||
| 
						 | 
					2fdc3f09b7 | ||
| 
						 | 
					1935d348c1 | ||
| 
						 | 
					8ccf4a591a | ||
| 
						 | 
					30bd1d708c | ||
| 
						 | 
					b07c76c407 | ||
| 
						 | 
					77fee3c7e1 | ||
| 
						 | 
					b9cf957dcc | ||
| 
						 | 
					9049dbfefa | ||
| 
						 | 
					757b85d02f | ||
| 
						 | 
					70c51d18bb | ||
| 
						 | 
					d459c60d6d | ||
| 
						 | 
					1f4c1a1fd7 | ||
| 
						 | 
					9ceeb63c8a | ||
| 
						 | 
					1315e2cc5f | ||
| 
						 | 
					4a0eddef02 | ||
| 
						 | 
					e163e815d6 | ||
| 
						 | 
					08ed68a8b7 | ||
| 
						 | 
					1a1c49ba06 | ||
| 
						 | 
					996094dd5c | ||
| 
						 | 
					bb34fbae3d | ||
| 
						 | 
					5f81c3dfa2 | ||
| 
						 | 
					804343f7c0 | ||
| 
						 | 
					4c50a02a0e | ||
| 
						 | 
					79f9cb3294 | ||
| 
						 | 
					2d7dbc735c | ||
| 
						 | 
					b6b40c558a | ||
| 
						 | 
					75ec006643 | ||
| 
						 | 
					b5819d022e | ||
| 
						 | 
					05e211a037 | ||
| 
						 | 
					807388d632 | ||
| 
						 | 
					634d1496aa | ||
| 
						 | 
					8fc57f7746 | ||
| 
						 | 
					308baf3a17 | ||
| 
						 | 
					587e0fbf02 | ||
| 
						 | 
					30d0c02d8c | ||
| 
						 | 
					2ec1168292 | ||
| 
						 | 
					1aba553059 | ||
| 
						 | 
					fefe122dc9 | ||
| 
						 | 
					5ce62f46e7 | ||
| 
						 | 
					77c02f1b7a | ||
| 
						 | 
					130fffbf97 | ||
| 
						 | 
					a5a4798aed | ||
| 
						 | 
					ebbec592bf | ||
| 
						 | 
					19df0b4036 | ||
| 
						 | 
					e6eaea544c | ||
| 
						 | 
					e4a0a9bfe9 | 
							
								
								
									
										213
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										213
									
								
								README.md
									
									
									
									
									
								
							@@ -1,37 +1,200 @@
 | 
			
		||||
Bonemeal mod [bonemeal]
 | 
			
		||||
minetest mod Bonemeal
 | 
			
		||||
=====================
 | 
			
		||||
 | 
			
		||||
FARM mod that helps and featured the farming to quickly grow samplings, crops, grass, etc
 | 
			
		||||
 | 
			
		||||
Information
 | 
			
		||||
-----------
 | 
			
		||||
 | 
			
		||||
Bonemeal is crushed from bones found in dirt or by using player bones, Mulch is
 | 
			
		||||
made from a tree trunk surrounded by leaves and Fertiliser is a mix of both,
 | 
			
		||||
each of which can be used to quickly grow saplings, crops and grass/decoration,
 | 
			
		||||
papyrus on top of dirt and cactus on sand.
 | 
			
		||||
 | 
			
		||||
Support for ethereal saplings/crops, farming redo crops and moretrees saplings are included.
 | 
			
		||||
 | 
			
		||||

 | 
			
		||||
 | 
			
		||||
## Technical info
 | 
			
		||||
 | 
			
		||||
This mod is named `bonemeal` and must be installed with such name.
 | 
			
		||||
 | 
			
		||||
This mod adds four new items into the game, bones which can be dug from normal
 | 
			
		||||
dirt which can be made into bonemeal, mulch which is is crafted using a tree and
 | 
			
		||||
8x leaves, and fertiliser which is a mixture of them both.
 | 
			
		||||
dirt which can be cooked into bonemeal, mulch which is is crafted using a tree
 | 
			
		||||
and 8x leaves, and fertiliser which is a mixture of them both.
 | 
			
		||||
 | 
			
		||||
Each item can be used on saplings and crops for a chance to grow them quicker as
 | 
			
		||||
well as dirt which will generate random grass, flowers or whichever decoration
 | 
			
		||||
is registered.
 | 
			
		||||
Each item can be used on saplings and crops for a chance to grow them quicker
 | 
			
		||||
as well as dirt which will generate random grass, flowers or whichever
 | 
			
		||||
decoration is registered.
 | 
			
		||||
 | 
			
		||||
Mulch has a strength of 1, Bonemeal 2 and Fertiliser 3 which means the stronger
 | 
			
		||||
Mulch has a strength of 1, Bonemeal 2 and Fertiliser 3. This means the stronger
 | 
			
		||||
the item, the more chance of growing saplings in low light, making crops sprout
 | 
			
		||||
quicker or simply decorate a larger area with grass and flowers.
 | 
			
		||||
 | 
			
		||||
The api.txt document shows how to add your own saplings, crops and grasses to
 | 
			
		||||
the list by using one of the 3 commands included and the mod.lua file gives you
 | 
			
		||||
many examples by using some of the popular mods available.
 | 
			
		||||
#### Dependencies
 | 
			
		||||
 | 
			
		||||
Dependencies: default
 | 
			
		||||
 | 
			
		||||
Optional Dependencies: farming, ethereal, moretrees, lucky_block, moretrees, flowers, dye, ferns, dryplants, df_trees, df_farming, df_primordial_items, everness
 | 
			
		||||
 | 
			
		||||
Lucky Blocks: 6
 | 
			
		||||
 | 
			
		||||
#### API
 | 
			
		||||
 | 
			
		||||
The [`api.txt`](api.txt) document shows how to add your own saplings,
 | 
			
		||||
crops and grasses to the list by using one of the 3 commands included and
 | 
			
		||||
the [`mod.lua`](mod.lua) file gives you many examples by using some of the
 | 
			
		||||
popular mods available.
 | 
			
		||||
 | 
			
		||||
https://forum.minetest.net/viewtopic.php?f=9&t=16446
 | 
			
		||||
 | 
			
		||||
Changelog:
 | 
			
		||||
#### Nodes
 | 
			
		||||
 | 
			
		||||
- 0.1 - Initial release
 | 
			
		||||
- 0.2 - Added global on_use function for bonemeal growth
 | 
			
		||||
- 0.3 - Added strength to on_use global for new items (mulch and fertiliser)
 | 
			
		||||
- 0.4 - Added Intllib support and fr.txt file
 | 
			
		||||
- 0.5 - Added support for default bush and acacia bush saplings
 | 
			
		||||
- 0.6 - Using newer functions, Minetest 0.4.16 and above needed to run
 | 
			
		||||
- 0.7 - Can be used on papyrus and cactus now, added coral recipe, api addition
 | 
			
		||||
- 0.8 - Added support for farming redo's new garlic, pepper and onion crops
 | 
			
		||||
- 0.9 - Added support for farming redo's pea and beetroot crops, checks for place_param
 | 
			
		||||
- 1.0 - add_deco() now adds to existing item list while set_deco() replaces item list (thanks h-v-smacker)
 | 
			
		||||
- 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)
 | 
			
		||||
| Node name               | description  | notes |
 | 
			
		||||
| ----------------------- | ------------ | --------------------------------------------------- |
 | 
			
		||||
| bonemeal:mulch          | Mulch        | fertilizer to make grow plants and seeds faster     |
 | 
			
		||||
| bonemeal:bonemeal       | Bone Meal    | 2 x fertilizer to make grow plants and seeds faster |
 | 
			
		||||
| bonemeal:fertiliser     | Fertiliser   | 3 x fertilizer to make grow plants and seeds faster |
 | 
			
		||||
| bonemeal:bone           | Bone         | cook to made fertilizers, found into dirt rarelly   |
 | 
			
		||||
| bone:bone               | Player bones | cook to made fertilizers, found into dirt rarelly   |
 | 
			
		||||
| bonemeal:gelatin_powder | Gelatin Powder | made from bones                             |
 | 
			
		||||
 | 
			
		||||
Lucky Blocks: 6
 | 
			
		||||
#### Crafts
 | 
			
		||||
 | 
			
		||||
* bonemeal:gelatin_powder 4
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{"group:bone", "group:bone", "group:bone"},
 | 
			
		||||
	{"bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water"},
 | 
			
		||||
	{"bucket:bucket_water", "default:torch", "bucket:bucket_water"}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* bonemeal:bonemeal 2
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{{"group:bone"}}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* bonemeal:bonemeal 4
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{{"bones:bones"}}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* bonemeal:bonemeal 2
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{{"default:coral_skeleton"}}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* bonemeal:mulch 4
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{"group:tree", "group:leaves", "group:leaves"},
 | 
			
		||||
	{"group:leaves", "group:leaves", "group:leaves"},
 | 
			
		||||
	{"group:leaves", "group:leaves", "group:leaves"}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* bonemeal:mulch
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{"group:seed", "group:seed", "group:seed"},
 | 
			
		||||
	{"group:seed", "group:seed", "group:seed"},
 | 
			
		||||
	{"group:seed", "group:seed", "group:seed"}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
* fertiliser 2
 | 
			
		||||
 | 
			
		||||
```
 | 
			
		||||
	{{"bonemeal:bonemeal", "bonemeal:mulch"}}
 | 
			
		||||
```
 | 
			
		||||
 | 
			
		||||
## Changelog
 | 
			
		||||
 | 
			
		||||
#### Version 0.1
 | 
			
		||||
 | 
			
		||||
* Initial release
 | 
			
		||||
 | 
			
		||||
#### Version 0.2
 | 
			
		||||
 | 
			
		||||
* Added global `on_use` function for bonemeal growth
 | 
			
		||||
 | 
			
		||||
#### Version 0.3
 | 
			
		||||
 | 
			
		||||
* Added strength to `on_use` global for new items (mulch and fertiliser)
 | 
			
		||||
 | 
			
		||||
#### Version 0.4
 | 
			
		||||
 | 
			
		||||
* Added `Intllib` support and `fr.txt` file for French translation.
 | 
			
		||||
 | 
			
		||||
#### Version 0.5
 | 
			
		||||
 | 
			
		||||
* Added support for default bush and acacia bush saplings
 | 
			
		||||
 | 
			
		||||
#### Version 0.6
 | 
			
		||||
 | 
			
		||||
* Using newer functions. This means Minetest 0.4.16 and above needed to run
 | 
			
		||||
 | 
			
		||||
#### Version 0.7
 | 
			
		||||
 | 
			
		||||
* Can be used on papyrus and cactus now
 | 
			
		||||
* Added coral recipe
 | 
			
		||||
* API addition
 | 
			
		||||
 | 
			
		||||
#### Version 0.8
 | 
			
		||||
 | 
			
		||||
* Added support for farming redo's new garlic
 | 
			
		||||
* Added pepper and onion crops
 | 
			
		||||
 | 
			
		||||
#### Version 0.9
 | 
			
		||||
 | 
			
		||||
* Added support for farming redo's pea and beetroot crops
 | 
			
		||||
* Checks for `place_param`
 | 
			
		||||
 | 
			
		||||
#### Version 1.0
 | 
			
		||||
 | 
			
		||||
* `add_deco()` now adds to existing item list while `set_deco()` replaces item
 | 
			
		||||
  list (thanks `h-v-smacker`)
 | 
			
		||||
 | 
			
		||||
#### Version 1.1
 | 
			
		||||
 | 
			
		||||
* Added `{can_bonemeal=1}` group for special nodes
 | 
			
		||||
 | 
			
		||||
#### Version 1.2
 | 
			
		||||
 | 
			
		||||
* Added support for Minetest 5.0 cactus seedling, blueberry bush sapling and
 | 
			
		||||
  emergent jungle tree saplings, additional flowers and pine bush sapling
 | 
			
		||||
 | 
			
		||||
#### Version 1.3
 | 
			
		||||
 | 
			
		||||
* Added ability to craft dye from mulch, bonemeal and fertiliser (thanks
 | 
			
		||||
  `orbea`)
 | 
			
		||||
 | 
			
		||||
#### Version 1.4
 | 
			
		||||
 | 
			
		||||
* Added support for fern saplings from `plantlife` mod (thanks `nixnoxus`)
 | 
			
		||||
 | 
			
		||||
#### Version 1.5
 | 
			
		||||
 | 
			
		||||
* Added support for farming redo's asparagus, eggplant, spinach
 | 
			
		||||
 | 
			
		||||
#### Version 1.6
 | 
			
		||||
 | 
			
		||||
* Added helper function for position and protection check
 | 
			
		||||
* Added ginger support
 | 
			
		||||
* Added moretrees poplar sapling
 | 
			
		||||
 | 
			
		||||
#### Version 1.7
 | 
			
		||||
 | 
			
		||||
* Added farming redo's barley, hemp, rye, oat, mint, sunflower, rice seeds
 | 
			
		||||
* Added Everness saplings
 | 
			
		||||
* Update readme (thanks mckaygerhard)
 | 
			
		||||
* Recipe changes, player bones craft into 2x bones, bones must be cooked to
 | 
			
		||||
  give bonemeal
 | 
			
		||||
* Added bushes_classic support
 | 
			
		||||
 | 
			
		||||
## LICENSE
 | 
			
		||||
 | 
			
		||||
Licence: Code is MIT, Media is CC0
 | 
			
		||||
 | 
			
		||||
(c) Tenplus1
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										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
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -1,9 +0,0 @@
 | 
			
		||||
default
 | 
			
		||||
intllib?
 | 
			
		||||
farming?
 | 
			
		||||
ethereal?
 | 
			
		||||
moretrees?
 | 
			
		||||
technic_worldgen?
 | 
			
		||||
lucky_block?
 | 
			
		||||
flowers?
 | 
			
		||||
dye?
 | 
			
		||||
@@ -1 +0,0 @@
 | 
			
		||||
Adds bone and bonemeal giving the ability to quickly grow plants and saplings.
 | 
			
		||||
							
								
								
									
										573
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										573
									
								
								init.lua
									
									
									
									
									
								
							@@ -1,104 +1,45 @@
 | 
			
		||||
 | 
			
		||||
bonemeal = {}
 | 
			
		||||
-- MineClonia / VoxeLibre check
 | 
			
		||||
 | 
			
		||||
local path = minetest.get_modpath("bonemeal")
 | 
			
		||||
local mcl = core.get_modpath("mcl_core")
 | 
			
		||||
 | 
			
		||||
-- global
 | 
			
		||||
 | 
			
		||||
bonemeal = {
 | 
			
		||||
	item_list = {
 | 
			
		||||
		bucket_water = mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water",
 | 
			
		||||
		bucket_empty = mcl and "mcl_buckets:bucker_empty" or "bucket:bucket_empty",
 | 
			
		||||
		dirt = mcl and "mcl_core:dirt" or "default:dirt",
 | 
			
		||||
		torch = mcl and "mcl_torches:torch" or "default:torch",
 | 
			
		||||
		coral = mcl and "mcl_ocean:dead_horn_coral_block" or "default:coral_skeleton"
 | 
			
		||||
	}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- translation support and vars
 | 
			
		||||
 | 
			
		||||
local S = core.get_translator("bonemeal")
 | 
			
		||||
local a = bonemeal.item_list
 | 
			
		||||
local path = core.get_modpath("bonemeal")
 | 
			
		||||
local min, max, random = math.min, math.max, math.random
 | 
			
		||||
 | 
			
		||||
-- creative check helper
 | 
			
		||||
 | 
			
		||||
-- Load support for intllib.
 | 
			
		||||
local S, NS = dofile(path .. "/intllib.lua")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- creative check
 | 
			
		||||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
 | 
			
		||||
function is_creative(name)
 | 
			
		||||
	return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
 | 
			
		||||
local creative_mode_cache = core.settings:get_bool("creative_mode")
 | 
			
		||||
function bonemeal.is_creative(name)
 | 
			
		||||
	return creative_mode_cache or core.check_player_privs(name, {creative = true})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- API tables
 | 
			
		||||
 | 
			
		||||
-- default crops
 | 
			
		||||
local crops = {
 | 
			
		||||
	{"farming:cotton_", 8, "farming:seed_cotton"},
 | 
			
		||||
	{"farming:wheat_", 8, "farming:seed_wheat"}
 | 
			
		||||
}
 | 
			
		||||
local crops = {}
 | 
			
		||||
local saplings = {}
 | 
			
		||||
local deco = {}
 | 
			
		||||
 | 
			
		||||
-- particle effect
 | 
			
		||||
 | 
			
		||||
-- special pine check for nearby snow
 | 
			
		||||
local function pine_grow(pos)
 | 
			
		||||
 | 
			
		||||
	if minetest.find_node_near(pos, 1,
 | 
			
		||||
		{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
 | 
			
		||||
 | 
			
		||||
		default.grow_new_snowy_pine_tree(pos)
 | 
			
		||||
	else
 | 
			
		||||
		default.grow_new_pine_tree(pos)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- default saplings
 | 
			
		||||
local saplings = {
 | 
			
		||||
	{"default:sapling", default.grow_new_apple_tree, "soil"},
 | 
			
		||||
	{"default:junglesapling", default.grow_new_jungle_tree, "soil"},
 | 
			
		||||
	{"default:emergent_jungle_sapling", default.grow_new_emergent_jungle_tree, "soil"},
 | 
			
		||||
	{"default:acacia_sapling", default.grow_new_acacia_tree, "soil"},
 | 
			
		||||
	{"default:aspen_sapling", default.grow_new_aspen_tree, "soil"},
 | 
			
		||||
	{"default:pine_sapling", pine_grow, "soil"},
 | 
			
		||||
	{"default:bush_sapling", default.grow_bush, "soil"},
 | 
			
		||||
	{"default:acacia_bush_sapling", default.grow_acacia_bush, "soil"},
 | 
			
		||||
	{"default:large_cactus_seedling", default.grow_large_cactus, "sand"},
 | 
			
		||||
	{"default:blueberry_bush_sapling", default.grow_blueberry_bush, "soil"},
 | 
			
		||||
	{"default:pine_bush_sapling", default.grow_pine_bush, "soil"}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- helper tables ( "" denotes a blank item )
 | 
			
		||||
local green_grass = {
 | 
			
		||||
	"default:grass_2", "default:grass_3", "default:grass_4",
 | 
			
		||||
	"default:grass_5", "", ""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
local dry_grass = {
 | 
			
		||||
	"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
 | 
			
		||||
	"default:dry_grass_5", "", ""
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
-- add all in-game flowers except waterlily
 | 
			
		||||
local flowers = {}
 | 
			
		||||
 | 
			
		||||
for node, def in pairs(minetest.registered_nodes) do
 | 
			
		||||
 | 
			
		||||
	if def.groups.flower and not node:find("waterlily") then
 | 
			
		||||
		flowers[#flowers + 1] = node
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- add additional bakedclay flowers if enabled
 | 
			
		||||
if minetest.get_modpath("bakedclay") then
 | 
			
		||||
	flowers[#flowers + 1] = "bakedclay:delphinium"
 | 
			
		||||
	flowers[#flowers + 1] = "bakedclay:thistle"
 | 
			
		||||
	flowers[#flowers + 1] = "bakedclay:lazarus"
 | 
			
		||||
	flowers[#flowers + 1] = "bakedclay:mannagrass"
 | 
			
		||||
	flowers[#flowers + 1] = ""
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- default biomes deco
 | 
			
		||||
local deco = {
 | 
			
		||||
	{"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", "", "", ""} },
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--
 | 
			
		||||
-- local functions
 | 
			
		||||
--
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- particles
 | 
			
		||||
local function particle_effect(pos)
 | 
			
		||||
 | 
			
		||||
	minetest.add_particlespawner({
 | 
			
		||||
	core.add_particlespawner({
 | 
			
		||||
		amount = 4,
 | 
			
		||||
		time = 0.15,
 | 
			
		||||
		minpos = pos,
 | 
			
		||||
@@ -111,149 +52,153 @@ local function particle_effect(pos)
 | 
			
		||||
		maxexptime = 1,
 | 
			
		||||
		minsize = 1,
 | 
			
		||||
		maxsize = 3,
 | 
			
		||||
		texture = "bonemeal_particle.png"
 | 
			
		||||
		texture = "bonemeal_particle.png",
 | 
			
		||||
		glow = 5
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- tree type check
 | 
			
		||||
 | 
			
		||||
local function grow_tree(pos, object)
 | 
			
		||||
 | 
			
		||||
	if type(object) == "table" and object.axiom then
 | 
			
		||||
		-- grow L-system tree
 | 
			
		||||
		minetest.remove_node(pos)
 | 
			
		||||
		minetest.spawn_tree(pos, object)
 | 
			
		||||
 | 
			
		||||
	elseif type(object) == "string" and minetest.registered_nodes[object] then
 | 
			
		||||
		-- place node
 | 
			
		||||
		minetest.set_node(pos, {name = object})
 | 
			
		||||
		core.remove_node(pos)
 | 
			
		||||
		core.spawn_tree(pos, object) -- grow L-system tree
 | 
			
		||||
 | 
			
		||||
	elseif type(object) == "string" and core.registered_nodes[object] then
 | 
			
		||||
 | 
			
		||||
		core.set_node(pos, {name = object}) -- place node
 | 
			
		||||
 | 
			
		||||
	elseif type(object) == "function" then
 | 
			
		||||
		-- function
 | 
			
		||||
		object(pos)
 | 
			
		||||
 | 
			
		||||
		object(pos) -- execute function
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- sapling check
 | 
			
		||||
local function check_sapling(pos, nodename)
 | 
			
		||||
 | 
			
		||||
local function check_sapling(pos, sapling_node, strength, light_ok)
 | 
			
		||||
 | 
			
		||||
	-- what is sapling placed on?
 | 
			
		||||
	local under =  minetest.get_node({
 | 
			
		||||
		x = pos.x,
 | 
			
		||||
		y = pos.y - 1,
 | 
			
		||||
		z = pos.z
 | 
			
		||||
	})
 | 
			
		||||
	local under =  core.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
 | 
			
		||||
 | 
			
		||||
	local can_grow, grow_on
 | 
			
		||||
 | 
			
		||||
	-- 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 core.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
 | 
			
		||||
 | 
			
		||||
				if math.random(5 - strength) == 1 then
 | 
			
		||||
					grow_tree(pos, saplings[n][2])
 | 
			
		||||
				end
 | 
			
		||||
 | 
			
		||||
				return true
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
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]
 | 
			
		||||
			def = core.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})
 | 
			
		||||
			core.set_node(pos, {name = nod, param2 = def})
 | 
			
		||||
 | 
			
		||||
			particle_effect(pos)
 | 
			
		||||
 | 
			
		||||
			return
 | 
			
		||||
			core.get_node_timer(pos):start(10) -- restart any timers
 | 
			
		||||
 | 
			
		||||
			return true
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- check soil for specific decoration placement
 | 
			
		||||
 | 
			
		||||
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(
 | 
			
		||||
	local dirt = core.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
 | 
			
		||||
@@ -265,15 +210,20 @@ local function check_soil(pos, nodename, strength)
 | 
			
		||||
	for _, n in pairs(dirt) do
 | 
			
		||||
 | 
			
		||||
		if random(5) == 5 then
 | 
			
		||||
 | 
			
		||||
			if decor and #decor > 0 then
 | 
			
		||||
 | 
			
		||||
				-- place random decoration (rare)
 | 
			
		||||
				local dnum = #decor or 1
 | 
			
		||||
 | 
			
		||||
				nod = decor[random(dnum)] or ""
 | 
			
		||||
			end
 | 
			
		||||
		else
 | 
			
		||||
			if grass and #grass > 0 then
 | 
			
		||||
 | 
			
		||||
				-- place random grass (common)
 | 
			
		||||
				local dgra = #grass or 1
 | 
			
		||||
 | 
			
		||||
				nod = #grass > 0 and grass[random(dgra)] or ""
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
@@ -285,28 +235,57 @@ local function check_soil(pos, nodename, strength)
 | 
			
		||||
		if nod and nod ~= "" then
 | 
			
		||||
 | 
			
		||||
			-- get crop param2 value
 | 
			
		||||
			def = minetest.registered_nodes[nod]
 | 
			
		||||
			def = core.registered_nodes[nod]
 | 
			
		||||
			def = def and def.place_param2
 | 
			
		||||
 | 
			
		||||
			-- if param2 not preset then get from existing node
 | 
			
		||||
			if not def then
 | 
			
		||||
				local node = minetest.get_node_or_nil(pos2)
 | 
			
		||||
 | 
			
		||||
				local node = core.get_node_or_nil(pos2)
 | 
			
		||||
 | 
			
		||||
				def = node and node.param2 or 0
 | 
			
		||||
			end
 | 
			
		||||
 | 
			
		||||
			minetest.set_node(pos2, {name = nod, param2 = def})
 | 
			
		||||
			core.set_node(pos2, {name = nod, param2 = def})
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		particle_effect(pos2)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- helper function
 | 
			
		||||
 | 
			
		||||
-- global functions
 | 
			
		||||
local function use_checks(user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
	-- make sure we use on node
 | 
			
		||||
	if pointed_thing.type ~= "node" then return false end
 | 
			
		||||
 | 
			
		||||
	-- get position and node info
 | 
			
		||||
	local pos = pointed_thing.under
 | 
			
		||||
	local node = core.get_node(pos)
 | 
			
		||||
	local def = core.registered_items[node.name]
 | 
			
		||||
	local dirt = def and def.groups
 | 
			
		||||
 | 
			
		||||
	-- does node have groups set
 | 
			
		||||
	if not dirt then return false end
 | 
			
		||||
 | 
			
		||||
	-- if we're using on ground, move position up
 | 
			
		||||
	if dirt.soil or dirt.sand or dirt.can_bonemeal then
 | 
			
		||||
		pos = pointed_thing.above
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- check if protected
 | 
			
		||||
	if core.is_protected(pos, user:get_player_name()) then
 | 
			
		||||
		return false
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	return node
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--= Global functions
 | 
			
		||||
 | 
			
		||||
-- 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)
 | 
			
		||||
@@ -316,10 +295,10 @@ function bonemeal:add_sapling(list)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- add to crop list to force grow
 | 
			
		||||
-- {crop name start_, growth steps, seed node (if required)}
 | 
			
		||||
-- e.g. {"farming:wheat_", 8, "farming:seed_wheat"}
 | 
			
		||||
 | 
			
		||||
function bonemeal:add_crop(list)
 | 
			
		||||
 | 
			
		||||
	for n = 1, #list do
 | 
			
		||||
@@ -327,12 +306,12 @@ function bonemeal:add_crop(list)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- add grass and flower/plant decoration for specific dirt types
 | 
			
		||||
--  {dirt_node, {grass_nodes}, {flower_nodes}
 | 
			
		||||
-- e.g. {"default:dirt_with_dry_grass", dry_grass, flowers}
 | 
			
		||||
-- if an entry already exists for a given dirt type, it will add new entries and all empty
 | 
			
		||||
-- entries, allowing to both add decorations and decrease their frequency.
 | 
			
		||||
 | 
			
		||||
function bonemeal:add_deco(list)
 | 
			
		||||
 | 
			
		||||
	for l = 1, #list do
 | 
			
		||||
@@ -350,8 +329,7 @@ function bonemeal:add_deco(list)
 | 
			
		||||
						for _, entry in pairs(deco[n][2]) do
 | 
			
		||||
 | 
			
		||||
							if extra == entry then
 | 
			
		||||
								extra = false
 | 
			
		||||
								break
 | 
			
		||||
								extra = false ; break
 | 
			
		||||
							end
 | 
			
		||||
						end
 | 
			
		||||
					end
 | 
			
		||||
@@ -369,8 +347,7 @@ function bonemeal:add_deco(list)
 | 
			
		||||
						for __, entry in pairs(deco[n][3]) do
 | 
			
		||||
 | 
			
		||||
							if extra == entry then
 | 
			
		||||
								extra = false
 | 
			
		||||
								break
 | 
			
		||||
								extra = false ; break
 | 
			
		||||
							end
 | 
			
		||||
						end
 | 
			
		||||
					end
 | 
			
		||||
@@ -380,8 +357,7 @@ function bonemeal:add_deco(list)
 | 
			
		||||
					end
 | 
			
		||||
				end
 | 
			
		||||
 | 
			
		||||
				list[l] = false
 | 
			
		||||
				break
 | 
			
		||||
				list[l] = false ; break
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
@@ -391,9 +367,9 @@ function bonemeal:add_deco(list)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- definitively set a decration scheme
 | 
			
		||||
-- this function will either add a new entry as is, or replace the existing one
 | 
			
		||||
 | 
			
		||||
function bonemeal:set_deco(list)
 | 
			
		||||
 | 
			
		||||
	for l = 1, #list do
 | 
			
		||||
@@ -402,9 +378,12 @@ function bonemeal:set_deco(list)
 | 
			
		||||
 | 
			
		||||
			-- replace existing entry
 | 
			
		||||
			if list[l][1] == deco[n][1] then
 | 
			
		||||
 | 
			
		||||
				deco[n][2] = list[l][2]
 | 
			
		||||
				deco[n][3] = list[l][3]
 | 
			
		||||
 | 
			
		||||
				list[l] = false
 | 
			
		||||
 | 
			
		||||
				break
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
@@ -415,17 +394,15 @@ function bonemeal:set_deco(list)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- global on_use function for bonemeal
 | 
			
		||||
 | 
			
		||||
function bonemeal:on_use(pos, strength, node)
 | 
			
		||||
 | 
			
		||||
	-- get node pointed at
 | 
			
		||||
	local node = node or minetest.get_node(pos)
 | 
			
		||||
	local node = node or core.get_node(pos)
 | 
			
		||||
 | 
			
		||||
	-- return if nothing there
 | 
			
		||||
	if node.name == "ignore" then
 | 
			
		||||
		return
 | 
			
		||||
	end
 | 
			
		||||
	if node.name == "ignore" then return end
 | 
			
		||||
 | 
			
		||||
	-- make sure strength is between 1 and 4
 | 
			
		||||
	strength = strength or 1
 | 
			
		||||
@@ -436,228 +413,244 @@ function bonemeal:on_use(pos, strength, node)
 | 
			
		||||
	if node.name == "default:papyrus" then
 | 
			
		||||
 | 
			
		||||
		default.grow_papyrus(pos, node)
 | 
			
		||||
		particle_effect(pos)
 | 
			
		||||
		return
 | 
			
		||||
 | 
			
		||||
		particle_effect(pos) ; return true
 | 
			
		||||
 | 
			
		||||
	elseif node.name == "default:cactus" then
 | 
			
		||||
 | 
			
		||||
		default.grow_cactus(pos, node)
 | 
			
		||||
		particle_effect(pos)
 | 
			
		||||
		return
 | 
			
		||||
 | 
			
		||||
		particle_effect(pos) ; return true
 | 
			
		||||
 | 
			
		||||
	elseif node.name == "default:dry_dirt" and strength == 1 then
 | 
			
		||||
 | 
			
		||||
		core.set_node(pos, {name = "default:dry_dirt_with_dry_grass"})
 | 
			
		||||
 | 
			
		||||
		particle_effect(pos) ; return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- grow grass and flowers
 | 
			
		||||
	if minetest.get_item_group(node.name, "soil") > 0
 | 
			
		||||
	or minetest.get_item_group(node.name, "sand") > 0
 | 
			
		||||
	or minetest.get_item_group(node.name, "can_bonemeal") > 0 then
 | 
			
		||||
	if core.get_item_group(node.name, "soil") > 0
 | 
			
		||||
	or core.get_item_group(node.name, "sand") > 0
 | 
			
		||||
	or core.get_item_group(node.name, "can_bonemeal") > 0 then
 | 
			
		||||
 | 
			
		||||
		check_soil(pos, node.name, strength)
 | 
			
		||||
		return
 | 
			
		||||
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- light check depending on strength (strength of 4 = no light needed)
 | 
			
		||||
	if (minetest.get_node_light(pos) or 0) < (12 - (strength * 3)) then
 | 
			
		||||
		return
 | 
			
		||||
	local light_ok = true
 | 
			
		||||
 | 
			
		||||
	if (core.get_node_light(pos) or 0) < (12 - (strength * 3)) then
 | 
			
		||||
		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)
 | 
			
		||||
		return
 | 
			
		||||
	-- check for sapling growth
 | 
			
		||||
	if check_sapling(pos, node.name, strength, light_ok) then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- check for crop growth
 | 
			
		||||
	check_crops(pos, node.name, strength)
 | 
			
		||||
	if check_crops(pos, node.name, strength, light_ok) then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--
 | 
			
		||||
-- items
 | 
			
		||||
--
 | 
			
		||||
 | 
			
		||||
--= Items
 | 
			
		||||
 | 
			
		||||
-- mulch (strength 1)
 | 
			
		||||
minetest.register_craftitem("bonemeal:mulch", {
 | 
			
		||||
 | 
			
		||||
core.register_craftitem("bonemeal:mulch", {
 | 
			
		||||
	description = S("Mulch"),
 | 
			
		||||
	inventory_image = "bonemeal_mulch.png",
 | 
			
		||||
 | 
			
		||||
	on_use = function(itemstack, user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
		-- did we point at a node?
 | 
			
		||||
		if pointed_thing.type ~= "node" then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		-- use helper function to do checks and return position and node
 | 
			
		||||
		local node = use_checks(user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
		-- is area protected?
 | 
			
		||||
		if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		if node then
 | 
			
		||||
 | 
			
		||||
		-- take item if not in creative
 | 
			
		||||
		if not is_creative(user:get_player_name()) then
 | 
			
		||||
			itemstack:take_item()
 | 
			
		||||
		end
 | 
			
		||||
			-- call global on_use function with strength of 1
 | 
			
		||||
			local used = bonemeal:on_use(pointed_thing.under, 1, node)
 | 
			
		||||
 | 
			
		||||
		-- call global on_use function with strength of 1
 | 
			
		||||
		bonemeal:on_use(pointed_thing.under, 1)
 | 
			
		||||
			-- take item if not in creative
 | 
			
		||||
			if used and not bonemeal.is_creative(user:get_player_name()) then
 | 
			
		||||
				itemstack:take_item()
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		return itemstack
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- bonemeal (strength 2)
 | 
			
		||||
minetest.register_craftitem("bonemeal:bonemeal", {
 | 
			
		||||
 | 
			
		||||
core.register_craftitem("bonemeal:bonemeal", {
 | 
			
		||||
	description = S("Bone Meal"),
 | 
			
		||||
	inventory_image = "bonemeal_item.png",
 | 
			
		||||
 | 
			
		||||
	on_use = function(itemstack, user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
		-- did we point at a node?
 | 
			
		||||
		if pointed_thing.type ~= "node" then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		-- use helper function to do checks and return position and node
 | 
			
		||||
		local node = use_checks(user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
		-- is area protected?
 | 
			
		||||
		if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		if node then
 | 
			
		||||
 | 
			
		||||
		-- take item if not in creative
 | 
			
		||||
		if not is_creative(user:get_player_name()) then
 | 
			
		||||
			itemstack:take_item()
 | 
			
		||||
		end
 | 
			
		||||
			-- call global on_use function with strength of 2
 | 
			
		||||
			local used = bonemeal:on_use(pointed_thing.under, 2, node)
 | 
			
		||||
 | 
			
		||||
		-- call global on_use function with strength of 2
 | 
			
		||||
		bonemeal:on_use(pointed_thing.under, 2)
 | 
			
		||||
			-- take item if not in creative
 | 
			
		||||
			if used and not bonemeal.is_creative(user:get_player_name()) then
 | 
			
		||||
				itemstack:take_item()
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		return itemstack
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- fertiliser (strength 3)
 | 
			
		||||
minetest.register_craftitem("bonemeal:fertiliser", {
 | 
			
		||||
 | 
			
		||||
core.register_craftitem("bonemeal:fertiliser", {
 | 
			
		||||
	description = S("Fertiliser"),
 | 
			
		||||
	inventory_image = "bonemeal_fertiliser.png",
 | 
			
		||||
 | 
			
		||||
	on_use = function(itemstack, user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
		-- did we point at a node?
 | 
			
		||||
		if pointed_thing.type ~= "node" then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		-- use helper function to do checks and return position and node
 | 
			
		||||
		local node = use_checks(user, pointed_thing)
 | 
			
		||||
 | 
			
		||||
		-- is area protected?
 | 
			
		||||
		if minetest.is_protected(pointed_thing.under, user:get_player_name()) then
 | 
			
		||||
			return
 | 
			
		||||
		end
 | 
			
		||||
		if node then
 | 
			
		||||
 | 
			
		||||
		-- take item if not in creative
 | 
			
		||||
		if not is_creative(user:get_player_name()) then
 | 
			
		||||
			itemstack:take_item()
 | 
			
		||||
		end
 | 
			
		||||
			-- call global on_use function with strength of 3
 | 
			
		||||
			local used = bonemeal:on_use(pointed_thing.under, 3, node)
 | 
			
		||||
 | 
			
		||||
		-- call global on_use function with strength of 3
 | 
			
		||||
		bonemeal:on_use(pointed_thing.under, 3)
 | 
			
		||||
			-- take item if not in creative
 | 
			
		||||
			if used and not bonemeal.is_creative(user:get_player_name()) then
 | 
			
		||||
				itemstack:take_item()
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
 | 
			
		||||
		return itemstack
 | 
			
		||||
	end
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- bone
 | 
			
		||||
minetest.register_craftitem("bonemeal:bone", {
 | 
			
		||||
 | 
			
		||||
core.register_craftitem("bonemeal:bone", {
 | 
			
		||||
	description = S("Bone"),
 | 
			
		||||
	inventory_image = "bonemeal_bone.png",
 | 
			
		||||
	groups = {bone = 1}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- gelatin powder
 | 
			
		||||
minetest.register_craftitem("bonemeal:gelatin_powder", {
 | 
			
		||||
 | 
			
		||||
core.register_craftitem("bonemeal:gelatin_powder", {
 | 
			
		||||
	description = S("Gelatin Powder"),
 | 
			
		||||
	inventory_image = "bonemeal_gelatin_powder.png",
 | 
			
		||||
	groups = {food_gelatin = 1, flammable = 2}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--
 | 
			
		||||
-- crafting recipes
 | 
			
		||||
--
 | 
			
		||||
 | 
			
		||||
--= Recipes
 | 
			
		||||
 | 
			
		||||
-- gelatin powder
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
 | 
			
		||||
core.register_craft({
 | 
			
		||||
	output = "bonemeal:gelatin_powder 4",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"group:bone", "group:bone", "group:bone"},
 | 
			
		||||
		{"bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water"},
 | 
			
		||||
		{"bucket:bucket_water", "default:torch", "bucket:bucket_water"},
 | 
			
		||||
		{a.bucket_water, a.bucket_water, a.bucket_water},
 | 
			
		||||
		{a.bucket_water, a.torch, a.bucket_water}
 | 
			
		||||
	},
 | 
			
		||||
	replacements = {
 | 
			
		||||
		{"bucket:bucket_water", "bucket:bucket_empty 5"},
 | 
			
		||||
		{a.bucket_water, a.bucket_empty .. " 5"}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- bonemeal (from bone)
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	type = "shapeless",
 | 
			
		||||
 | 
			
		||||
core.register_craft({
 | 
			
		||||
	type = "cooking",
 | 
			
		||||
	output = "bonemeal:bonemeal 2",
 | 
			
		||||
	recipe = {"group:bone"}
 | 
			
		||||
	recipe = "group:bone",
 | 
			
		||||
	cooktime = 4
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- bonemeal (from player bones)
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:bonemeal 4",
 | 
			
		||||
	recipe = {"bones:bones"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
if core.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
 | 
			
		||||
 | 
			
		||||
	core.register_craft({
 | 
			
		||||
		output = "bonemeal:bone 2",
 | 
			
		||||
		recipe = {{"bones:bones"}}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- bonemeal (from coral skeleton)
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	type = "shapeless",
 | 
			
		||||
 | 
			
		||||
core.register_craft({
 | 
			
		||||
	output = "bonemeal:bonemeal 2",
 | 
			
		||||
	recipe = {"default:coral_skeleton"}
 | 
			
		||||
	recipe = {{a.coral}}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- mulch
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	type = "shapeless",
 | 
			
		||||
 | 
			
		||||
core.register_craft({
 | 
			
		||||
	output = "bonemeal:mulch 4",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		"group:tree", "group:leaves", "group:leaves",
 | 
			
		||||
		"group:leaves", "group:leaves", "group:leaves",
 | 
			
		||||
		"group:leaves", "group:leaves", "group:leaves"
 | 
			
		||||
		{"group:tree", "group:leaves", "group:leaves"},
 | 
			
		||||
		{"group:leaves", "group:leaves", "group:leaves"},
 | 
			
		||||
		{"group:leaves", "group:leaves", "group:leaves"}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
core.register_craft({
 | 
			
		||||
	output = "bonemeal:mulch",
 | 
			
		||||
	recipe = {
 | 
			
		||||
		{"group:seed", "group:seed", "group:seed"},
 | 
			
		||||
		{"group:seed", "group:seed", "group:seed"},
 | 
			
		||||
		{"group:seed", "group:seed", "group:seed"}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- fertiliser
 | 
			
		||||
minetest.register_craft({
 | 
			
		||||
	type = "shapeless",
 | 
			
		||||
	output = "bonemeal:fertiliser 2",
 | 
			
		||||
	recipe = {"bonemeal:bonemeal", "bonemeal:mulch"}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
core.register_craft({
 | 
			
		||||
	output = "bonemeal:fertiliser 2",
 | 
			
		||||
	recipe = {{"bonemeal:bonemeal", "bonemeal:mulch"}}
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- add bones to dirt
 | 
			
		||||
minetest.override_item("default:dirt", {
 | 
			
		||||
	drop = {
 | 
			
		||||
		max_items = 1,
 | 
			
		||||
		items = {
 | 
			
		||||
			{
 | 
			
		||||
				items = {"bonemeal:bone"},
 | 
			
		||||
				rarity = 40
 | 
			
		||||
			},
 | 
			
		||||
			{
 | 
			
		||||
				items = {"default:dirt"}
 | 
			
		||||
 | 
			
		||||
if core.registered_items[a.dirt] then
 | 
			
		||||
 | 
			
		||||
	core.override_item(a.dirt, {
 | 
			
		||||
		drop = {
 | 
			
		||||
			max_items = 1,
 | 
			
		||||
			items = {
 | 
			
		||||
				{
 | 
			
		||||
					items = {"bonemeal:bone"},
 | 
			
		||||
					rarity = 40
 | 
			
		||||
				},
 | 
			
		||||
				{
 | 
			
		||||
					items = {a.dirt}
 | 
			
		||||
				}
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
})
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- add support for mods
 | 
			
		||||
 | 
			
		||||
-- add support for other mods
 | 
			
		||||
dofile(path .. "/mods.lua")
 | 
			
		||||
dofile(path .. "/lucky_block.lua")
 | 
			
		||||
 | 
			
		||||
print (S("[MOD] bonemeal loaded"))
 | 
			
		||||
-- lucky block support
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("lucky_block") then
 | 
			
		||||
	dofile(path .. "/lucky_block.lua")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
print ("[MOD] Bonemeal loaded")
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										45
									
								
								intllib.lua
									
									
									
									
									
								
							
							
						
						
									
										45
									
								
								intllib.lua
									
									
									
									
									
								
							@@ -1,45 +0,0 @@
 | 
			
		||||
 | 
			
		||||
-- Fallback functions for when `intllib` is not installed.
 | 
			
		||||
-- Code released under Unlicense <http://unlicense.org>.
 | 
			
		||||
 | 
			
		||||
-- Get the latest version of this file at:
 | 
			
		||||
--   https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
 | 
			
		||||
 | 
			
		||||
local function format(str, ...)
 | 
			
		||||
	local args = { ... }
 | 
			
		||||
	local function repl(escape, open, num, close)
 | 
			
		||||
		if escape == "" then
 | 
			
		||||
			local replacement = tostring(args[tonumber(num)])
 | 
			
		||||
			if open == "" then
 | 
			
		||||
				replacement = replacement..close
 | 
			
		||||
			end
 | 
			
		||||
			return replacement
 | 
			
		||||
		else
 | 
			
		||||
			return "@"..open..num..close
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local gettext, ngettext
 | 
			
		||||
if minetest.get_modpath("intllib") then
 | 
			
		||||
	if intllib.make_gettext_pair then
 | 
			
		||||
		-- New method using gettext.
 | 
			
		||||
		gettext, ngettext = intllib.make_gettext_pair()
 | 
			
		||||
	else
 | 
			
		||||
		-- Old method using text files.
 | 
			
		||||
		gettext = intllib.Getter()
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- Fill in missing functions.
 | 
			
		||||
 | 
			
		||||
gettext = gettext or function(msgid, ...)
 | 
			
		||||
	return format(msgid, ...)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
 | 
			
		||||
	return format(n==1 and msgid or msgid_plural, ...)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
return gettext, ngettext
 | 
			
		||||
@@ -19,3 +19,6 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 | 
			
		||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 | 
			
		||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 | 
			
		||||
THE SOFTWARE.
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Textures by TenPlus1 (CC0)
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										6
									
								
								locale/bonemeal.de.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								locale/bonemeal.de.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
# textdomain:bonemeal
 | 
			
		||||
Bone=Knochen
 | 
			
		||||
Bone Meal=Knochenmehl
 | 
			
		||||
Fertiliser=Dünger
 | 
			
		||||
Gelatin Powder=Gelatinepulver
 | 
			
		||||
Mulch=Mulch
 | 
			
		||||
							
								
								
									
										6
									
								
								locale/bonemeal.en.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								locale/bonemeal.en.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
# textdomain:bonemeal
 | 
			
		||||
#Bone=
 | 
			
		||||
#Bone Meal=
 | 
			
		||||
#Fertiliser=
 | 
			
		||||
#Gelatin Powder=
 | 
			
		||||
#Mulch=
 | 
			
		||||
							
								
								
									
										6
									
								
								locale/bonemeal.es.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								locale/bonemeal.es.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
# textdomain:bonemeal
 | 
			
		||||
Bone=Hueso
 | 
			
		||||
Bone Meal=Comida de hueso
 | 
			
		||||
Fertiliser=Fertilizante
 | 
			
		||||
#Gelatin Powder=
 | 
			
		||||
Mulch=Mantillo
 | 
			
		||||
							
								
								
									
										6
									
								
								locale/bonemeal.fr.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								locale/bonemeal.fr.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
# textdomain:bonemeal
 | 
			
		||||
Bone=Os
 | 
			
		||||
Bone Meal=Poudre d'os
 | 
			
		||||
Fertiliser=Engrais
 | 
			
		||||
Gelatin Powder=Poudre de gélatine
 | 
			
		||||
Mulch=Paillis
 | 
			
		||||
							
								
								
									
										6
									
								
								locale/bonemeal.it.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								locale/bonemeal.it.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
# textdomain:bonemeal
 | 
			
		||||
Bone=Ossa
 | 
			
		||||
Bone Meal=Pasto osseo
 | 
			
		||||
Fertiliser=Fertilizzante
 | 
			
		||||
#Gelatin Powder=
 | 
			
		||||
Mulch=Pacciame
 | 
			
		||||
							
								
								
									
										6
									
								
								locale/bonemeal.ru.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										6
									
								
								locale/bonemeal.ru.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,6 @@
 | 
			
		||||
# textdomain:bonemeal
 | 
			
		||||
Bone=Кость
 | 
			
		||||
Bone Meal=Костная Мука
 | 
			
		||||
Fertiliser=Удобрение
 | 
			
		||||
#Gelatin Powder=
 | 
			
		||||
Mulch=Мульча
 | 
			
		||||
							
								
								
									
										10
									
								
								locale/bonemeal.uk.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								locale/bonemeal.uk.tr
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,10 @@
 | 
			
		||||
# textdomain: bonemeal
 | 
			
		||||
 | 
			
		||||
Bonemeal=Кісткове борошно
 | 
			
		||||
Adds bone and bonemeal giving the ability to quickly grow plants and saplings.=Додає кістки та кісткове борошно, що дає можливість швидко вирощувати рослини та саджанці.
 | 
			
		||||
 | 
			
		||||
Bone=Кістка
 | 
			
		||||
Bone Meal=Кісткове борошно
 | 
			
		||||
Fertiliser=Добриво
 | 
			
		||||
Gelatin Powder=Желатиновий порошок
 | 
			
		||||
Mulch=Мульча
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
# init.lua
 | 
			
		||||
 | 
			
		||||
Mulch = Paillis
 | 
			
		||||
Bone Meal = Poudre d'os
 | 
			
		||||
Fertiliser = Engrais
 | 
			
		||||
Bone = Os
 | 
			
		||||
[MOD] bonemeal loaded = [MOD] bonemeal chargé
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
# init.lua
 | 
			
		||||
 | 
			
		||||
Mulch = Мульча
 | 
			
		||||
Bone Meal = Костная Мука
 | 
			
		||||
Fertiliser = Удобрение
 | 
			
		||||
Bone = Кость
 | 
			
		||||
[MOD] bonemeal loaded = [MOD] костная мука загружена
 | 
			
		||||
@@ -1,7 +0,0 @@
 | 
			
		||||
# init.lua
 | 
			
		||||
 | 
			
		||||
Mulch = 
 | 
			
		||||
Bone Meal = 
 | 
			
		||||
Fertiliser = 
 | 
			
		||||
Bone = 
 | 
			
		||||
[bonemeal] loaded = 
 | 
			
		||||
@@ -1,29 +1,26 @@
 | 
			
		||||
 | 
			
		||||
-- add lucky blocks
 | 
			
		||||
-- helper function
 | 
			
		||||
 | 
			
		||||
local function growy(pos, player)
 | 
			
		||||
 | 
			
		||||
	local dpos = minetest.find_node_near(pos, 1, "group:soil")
 | 
			
		||||
	local dpos = core.find_node_near(pos, 1, "group:soil")
 | 
			
		||||
 | 
			
		||||
	if dpos then
 | 
			
		||||
		bonemeal:on_use(dpos, 5)
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- add lucky blocks
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("lucky_block") then
 | 
			
		||||
 | 
			
		||||
	lucky_block:add_blocks({
 | 
			
		||||
		{"lig"},
 | 
			
		||||
		{"dro", {"bonemeal:mulch"}, 10},
 | 
			
		||||
		{"dro", {"bonemeal:bonemeal"}, 10},
 | 
			
		||||
		{"dro", {"bonemeal:fertiliser"}, 10},
 | 
			
		||||
		{"cus", growy},
 | 
			
		||||
		{"nod", "default:chest", 0, {
 | 
			
		||||
			{name = "bonemeal:mulch", max = 20},
 | 
			
		||||
			{name = "bonemeal:bonemeal", max = 15},
 | 
			
		||||
			{name = "bonemeal:fertiliser", max = 10},
 | 
			
		||||
		}},
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
lucky_block:add_blocks({
 | 
			
		||||
	{"lig"},
 | 
			
		||||
	{"dro", {"bonemeal:mulch"}, 10},
 | 
			
		||||
	{"dro", {"bonemeal:bonemeal"}, 10},
 | 
			
		||||
	{"dro", {"bonemeal:fertiliser"}, 10},
 | 
			
		||||
	{"cus", growy},
 | 
			
		||||
	{"nod", "default:chest", 0, {
 | 
			
		||||
		{name = "bonemeal:mulch", max = 20},
 | 
			
		||||
		{name = "bonemeal:bonemeal", max = 15},
 | 
			
		||||
		{name = "bonemeal:fertiliser", max = 10}
 | 
			
		||||
	}}
 | 
			
		||||
})
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										5
									
								
								mod.conf
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								mod.conf
									
									
									
									
									
								
							@@ -1 +1,4 @@
 | 
			
		||||
name = bonemeal
 | 
			
		||||
name = bonemeal
 | 
			
		||||
description = Adds bone and bonemeal giving the ability to quickly grow plants and saplings.
 | 
			
		||||
optional_depends = default, mcl_core, lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants, df_trees, df_farming, df_primordial_items, everness
 | 
			
		||||
min_minetest_version = 5.0
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										381
									
								
								mods.lua
									
									
									
									
									
								
							
							
						
						
									
										381
									
								
								mods.lua
									
									
									
									
									
								
							@@ -1,14 +1,111 @@
 | 
			
		||||
 | 
			
		||||
-- craft bones from animalmaterials into bonemeal
 | 
			
		||||
if minetest.get_modpath("animalmaterials") then
 | 
			
		||||
 | 
			
		||||
	minetest.register_craft({
 | 
			
		||||
		type = "shapeless",
 | 
			
		||||
if core.get_modpath("animalmaterials") then
 | 
			
		||||
 | 
			
		||||
	core.register_craft({
 | 
			
		||||
		output = "bonemeal:bonemeal 2",
 | 
			
		||||
		recipe = {"animalmaterials:bone"}
 | 
			
		||||
		recipe = {{"animalmaterials:bone"}}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- default additions
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("default") then
 | 
			
		||||
 | 
			
		||||
	-- saplings
 | 
			
		||||
 | 
			
		||||
	local function pine_grow(pos)
 | 
			
		||||
 | 
			
		||||
		if core.find_node_near(pos, 1,
 | 
			
		||||
			{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
 | 
			
		||||
 | 
			
		||||
			default.grow_new_snowy_pine_tree(pos)
 | 
			
		||||
		else
 | 
			
		||||
			default.grow_new_pine_tree(pos)
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function cactus_grow(pos)
 | 
			
		||||
		default.grow_cactus(pos, core.get_node(pos))
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function papyrus_grow(pos)
 | 
			
		||||
		default.grow_papyrus(pos, core.get_node(pos))
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"default:sapling", default.grow_new_apple_tree, "soil"},
 | 
			
		||||
		{"default:junglesapling", default.grow_new_jungle_tree, "soil"},
 | 
			
		||||
		{"default:emergent_jungle_sapling", default.grow_new_emergent_jungle_tree, "soil"},
 | 
			
		||||
		{"default:acacia_sapling", default.grow_new_acacia_tree, "soil"},
 | 
			
		||||
		{"default:aspen_sapling", default.grow_new_aspen_tree, "soil"},
 | 
			
		||||
		{"default:pine_sapling", pine_grow, "soil"},
 | 
			
		||||
		{"default:bush_sapling", default.grow_bush, "soil"},
 | 
			
		||||
		{"default:acacia_bush_sapling", default.grow_acacia_bush, "soil"},
 | 
			
		||||
		{"default:large_cactus_seedling", default.grow_large_cactus, "sand"},
 | 
			
		||||
		{"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"}
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	-- decoration
 | 
			
		||||
 | 
			
		||||
	local green_grass = {
 | 
			
		||||
		"default:grass_2", "default:grass_3", "default:grass_4",
 | 
			
		||||
		"default:grass_5", "", ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	local dry_grass = {
 | 
			
		||||
		"default:dry_grass_2", "default:dry_grass_3", "default:dry_grass_4",
 | 
			
		||||
		"default:dry_grass_5", "", ""
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	local flowers = {}
 | 
			
		||||
 | 
			
		||||
	-- add flowers from other mods
 | 
			
		||||
	core.after(0.1, function()
 | 
			
		||||
 | 
			
		||||
		for node, def in pairs(core.registered_nodes) do
 | 
			
		||||
 | 
			
		||||
			if def.groups
 | 
			
		||||
			and def.groups.flower
 | 
			
		||||
			and not node:find("waterlily")
 | 
			
		||||
			and not node:find("seaweed")
 | 
			
		||||
			and not node:find("xdecor:potted_")
 | 
			
		||||
			and not node:find("df_farming:") then
 | 
			
		||||
				flowers[#flowers + 1] = node
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end)
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_deco({
 | 
			
		||||
		{"default:dirt", bonemeal.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", "", "", ""} },
 | 
			
		||||
		{"default:dirt_with_coniferous_litter", {}, {"default:fern_1", "default:fern_2",
 | 
			
		||||
			"default:fern_3", "", "", ""}}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- default farming crops
 | 
			
		||||
 | 
			
		||||
if farming then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_crop({
 | 
			
		||||
		{"farming:cotton_", 8, "farming:seed_cotton"},
 | 
			
		||||
		{"farming:wheat_", 8, "farming:seed_wheat"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- farming redo crops
 | 
			
		||||
 | 
			
		||||
if farming and farming.mod and farming.mod == "redo" then
 | 
			
		||||
 | 
			
		||||
@@ -26,25 +123,39 @@ if farming and farming.mod and farming.mod == "redo" then
 | 
			
		||||
		{"farming:cucumber_", 4},
 | 
			
		||||
		{"farming:potato_", 4},
 | 
			
		||||
		{"farming:grapes_", 8},
 | 
			
		||||
		{"farming:rhubarb_", 3},
 | 
			
		||||
		{"farming:barley_", 7},
 | 
			
		||||
		{"farming:hemp_", 8},
 | 
			
		||||
		{"farming:rhubarb_", 4},
 | 
			
		||||
		{"farming:barley_", 8, "farming:seed_barley"},
 | 
			
		||||
		{"farming:hemp_", 8, "farming:seed_hemp"},
 | 
			
		||||
		{"farming:chili_", 8},
 | 
			
		||||
		{"farming:garlic_", 5},
 | 
			
		||||
		{"farming:onion_", 5},
 | 
			
		||||
		{"farming:pepper_", 5},
 | 
			
		||||
		{"farming:pepper_", 7},
 | 
			
		||||
		{"farming:pineapple_", 8},
 | 
			
		||||
		{"farming:pea_", 5},
 | 
			
		||||
		{"farming:beetroot_", 5},
 | 
			
		||||
		{"farming:rye_", 8},
 | 
			
		||||
		{"farming:oat_", 8},
 | 
			
		||||
		{"farming:rice_", 8},
 | 
			
		||||
		{"farming:mint_", 4}
 | 
			
		||||
		{"farming:rye_", 8, "farming:seed_rye"},
 | 
			
		||||
		{"farming:oat_", 8, "farming:seed_oat"},
 | 
			
		||||
		{"farming:rice_", 8, "farming:seed_rice"},
 | 
			
		||||
		{"farming:mint_", 4, "farming:seed_mint"},
 | 
			
		||||
		{"farming:cabbage_", 6},
 | 
			
		||||
		{"farming:lettuce_", 5},
 | 
			
		||||
		{"farming:blackberry_", 4},
 | 
			
		||||
		{"farming:vanilla_", 8},
 | 
			
		||||
		{"farming:soy_", 7},
 | 
			
		||||
		{"farming:artichoke_", 5},
 | 
			
		||||
		{"farming:parsley_", 3},
 | 
			
		||||
		{"farming:sunflower_", 8, "farming:seed_sunflower"},
 | 
			
		||||
		{"farming:asparagus_", 5},
 | 
			
		||||
		{"farming:eggplant_", 4},
 | 
			
		||||
		{"farming:spinach_", 4},
 | 
			
		||||
		{"farming:ginger_", 4},
 | 
			
		||||
		{"ethereal:strawberry_", 8}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- ethereal crops, saplings and grass
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("ethereal") then
 | 
			
		||||
if core.get_modpath("ethereal") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_crop({
 | 
			
		||||
		{"ethereal:strawberry_", 8},
 | 
			
		||||
@@ -59,12 +170,18 @@ if minetest.get_modpath("ethereal") then
 | 
			
		||||
		{"ethereal:banana_tree_sapling", ethereal.grow_banana_tree, "soil"},
 | 
			
		||||
		{"ethereal:frost_tree_sapling", ethereal.grow_frost_tree, "soil"},
 | 
			
		||||
		{"ethereal:mushroom_sapling", ethereal.grow_mushroom_tree, "soil"},
 | 
			
		||||
		{"ethereal:mushroom_brown_sapling", ethereal.grow_mushroom_brown_tree, "soil"},
 | 
			
		||||
		{"ethereal:willow_sapling", ethereal.grow_willow_tree, "soil"},
 | 
			
		||||
		{"ethereal:redwood_sapling", ethereal.grow_redwood_tree, "soil"},
 | 
			
		||||
		{"ethereal:giant_redwood_sapling", ethereal.grow_giant_redwood_tree, "soil"},
 | 
			
		||||
		{"ethereal:orange_tree_sapling", ethereal.grow_orange_tree, "soil"},
 | 
			
		||||
		{"ethereal:bamboo_sprout", ethereal.grow_bamboo_tree, "soil"},
 | 
			
		||||
		{"ethereal:birch_sapling", ethereal.grow_birch_tree, "soil"},
 | 
			
		||||
		{"ethereal:sakura_sapling", ethereal.grow_sakura_tree, "soil"}
 | 
			
		||||
		{"ethereal:sakura_sapling", ethereal.grow_sakura_tree, "soil"},
 | 
			
		||||
		{"ethereal:lemon_tree_sapling", ethereal.grow_lemon_tree, "soil"},
 | 
			
		||||
		{"ethereal:olive_tree_sapling", ethereal.grow_olive_tree, "soil"},
 | 
			
		||||
		{"ethereal:basandra_bush_sapling", ethereal.grow_basandra_bush, "soil"},
 | 
			
		||||
		{"ethereal:mangrove_sapling", ethereal.grow_mangrove_tree, "soil"}
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	local grass = {"default:grass_3", "default:grass_4", "default:grass_5", ""}
 | 
			
		||||
@@ -77,20 +194,24 @@ if minetest.get_modpath("ethereal") then
 | 
			
		||||
			"flowers:tulip", "flowers:viola", "ethereal:strawberry_7"}},
 | 
			
		||||
		{"ethereal:gray_dirt", {}, {"ethereal:snowygrass", "", ""}},
 | 
			
		||||
		{"ethereal:cold_dirt", {}, {"ethereal:snowygrass", "", ""}},
 | 
			
		||||
		{"ethereal:mushroom_dirt", {}, {"flowers:mushroom_red", "flowers:mushroom_brown", "", "", ""}},
 | 
			
		||||
		{"ethereal:mushroom_dirt", {}, {"flowers:mushroom_red", "flowers:mushroom_brown",
 | 
			
		||||
				"ethereal:spore_grass", "ethereal:spore_grass", "", "", ""}},
 | 
			
		||||
		{"ethereal:jungle_dirt", grass, {"default:junglegrass", "", "", ""}},
 | 
			
		||||
		{"ethereal:grove_dirt", grass, {"ethereal:fern", "", "", ""}},
 | 
			
		||||
		{"ethereal:bamboo_dirt", grass, {}}
 | 
			
		||||
		{"ethereal:bamboo_dirt", grass, {}},
 | 
			
		||||
		{"ethereal:mud", {"default:fern_1", "default:fern_2", "default:fern_3", "", "",
 | 
			
		||||
			"default:grass_5", "default:junglegrass"}, {"ethereal:bamboo"}}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- moretrees saplings
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("moretrees") then
 | 
			
		||||
if core.get_modpath("moretrees") then
 | 
			
		||||
 | 
			
		||||
	-- special fir check for snow
 | 
			
		||||
	local function fir_grow(pos)
 | 
			
		||||
 | 
			
		||||
		if minetest.find_node_near(pos, 1,
 | 
			
		||||
		if core.find_node_near(pos, 1,
 | 
			
		||||
			{"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
 | 
			
		||||
 | 
			
		||||
			moretrees.grow_fir_snow(pos)
 | 
			
		||||
@@ -104,37 +225,40 @@ 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"},
 | 
			
		||||
		{"moretrees:poplar_small_sapling", moretrees.spawn_poplar_small_object, "soil"},
 | 
			
		||||
		{"moretrees:willow_sapling", moretrees.spawn_willow_object, "soil"},
 | 
			
		||||
		{"moretrees:rubber_tree_sapling", moretrees.spawn_rubber_tree_object, "soil"},
 | 
			
		||||
		{"moretrees:fir_sapling", fir_grow, "soil"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
elseif minetest.get_modpath("technic_worldgen") then
 | 
			
		||||
-- technic rubber tree
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("technic_worldgen") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"moretrees:rubber_tree_sapling", technic.rubber_tree_model, "soil"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- caverealms mushroom
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("caverealms") then
 | 
			
		||||
if core.get_modpath("caverealms") then
 | 
			
		||||
 | 
			
		||||
	local fil = minetest.get_modpath("caverealms") .. "/schematics/shroom.mts"
 | 
			
		||||
	local fil = core.get_modpath("caverealms") .. "/schematics/shroom.mts"
 | 
			
		||||
	local add_shroom = function(pos)
 | 
			
		||||
 | 
			
		||||
		minetest.swap_node(pos, {name = "air"})
 | 
			
		||||
		core.swap_node(pos, {name = "air"})
 | 
			
		||||
 | 
			
		||||
		minetest.place_schematic(
 | 
			
		||||
		core.place_schematic(
 | 
			
		||||
			{x = pos.x - 5, y = pos.y, z = pos.z - 5}, fil, 0, nil, false)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
@@ -143,15 +267,46 @@ if minetest.get_modpath("caverealms") then
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- helper
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("dye") then
 | 
			
		||||
local function y_func(grow_func)
 | 
			
		||||
	return function(pos)
 | 
			
		||||
		grow_func({x = pos.x, y = pos.y - 1, z = pos.z})
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
	local bonemeal_dyes = {
 | 
			
		||||
			bonemeal = "white", fertiliser = "green", mulch = "brown"}
 | 
			
		||||
-- ferns
 | 
			
		||||
 | 
			
		||||
if core.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
 | 
			
		||||
 | 
			
		||||
-- dryplants sapling
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("dryplants") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"dryplants:reedmace_sapling", y_func(abstract_dryplants.grow_reedmace), "soil"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- add bonemeal dyes
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("dye") then
 | 
			
		||||
 | 
			
		||||
	local bonemeal_dyes = {bonemeal = "white", fertiliser = "green", mulch = "brown"}
 | 
			
		||||
 | 
			
		||||
	for mat, dye in pairs(bonemeal_dyes) do
 | 
			
		||||
 | 
			
		||||
		minetest.register_craft({
 | 
			
		||||
		core.register_craft({
 | 
			
		||||
			output = "dye:" .. dye .. " 4",
 | 
			
		||||
			recipe = {
 | 
			
		||||
				{"bonemeal:" .. mat}
 | 
			
		||||
@@ -159,3 +314,171 @@ if minetest.get_modpath("dye") then
 | 
			
		||||
		})
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- df_trees saplings
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("df_trees") then
 | 
			
		||||
 | 
			
		||||
	local function spore_tree_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_spore_tree(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function fungiwood_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_fungiwood(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function tunnel_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_tunnel_tube(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function black_cap_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_black_cap(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function goblin_cap_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_goblin_cap(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function tower_cap_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_tower_cap(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function nether_cap_fix(pos)
 | 
			
		||||
		core.remove_node(pos) ; df_trees.spawn_nether_cap(pos)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"df_trees:black_cap_sapling", black_cap_fix, "soil", true},
 | 
			
		||||
		{"df_trees:fungiwood_sapling", fungiwood_fix, "soil", true},
 | 
			
		||||
		{"df_trees:goblin_cap_sapling", goblin_cap_fix, "soil", true},
 | 
			
		||||
		{"df_trees:spore_tree_sapling", spore_tree_fix, "soil", true},
 | 
			
		||||
		{"df_trees:tower_cap_sapling", tower_cap_fix, "soil", true},
 | 
			
		||||
		{"df_trees:tunnel_tube_sapling", tunnel_fix, "soil", true},
 | 
			
		||||
		{"df_trees:nether_cap_sapling", nether_cap_fix, "group:nether_cap", true},
 | 
			
		||||
		{"df_trees:nether_cap_sapling", nether_cap_fix, "group:cools_lava", true}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- df_farming crops
 | 
			
		||||
 | 
			
		||||
if core.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
 | 
			
		||||
 | 
			
		||||
-- df_primordial saplings and plants
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("df_primordial_items") then
 | 
			
		||||
 | 
			
		||||
	local function mush_fix(pos)
 | 
			
		||||
		core.set_node(pos, {name = "air"})
 | 
			
		||||
		mapgen_helper.place_schematic(pos,
 | 
			
		||||
			df_primordial_items.get_primordial_mushroom(), (math.random(4) - 1) * 90)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function fern_fix(pos)
 | 
			
		||||
		core.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(#rotations)])
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local function blood_fix(pos)
 | 
			
		||||
		df_trees.grow_blood_thorn(pos, core.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
 | 
			
		||||
 | 
			
		||||
-- everness saplings
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("everness") then
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"everness:baobab_sapling", Everness.grow_baobab_tree, "soil"},
 | 
			
		||||
		{"everness:coral_tree_bioluminescent_sapling",
 | 
			
		||||
				Everness.coral_tree_bioluminescent, "soil"},
 | 
			
		||||
		{"everness:coral_tree_sapling", Everness.grow_coral_tree, "soil"},
 | 
			
		||||
		{"everness:crystal_bush_sapling", Everness.grow_crystal_bush, "soil"},
 | 
			
		||||
		{"everness:crystal_tree_large_sapling", Everness.grow_crystal_large_tree, "soil"},
 | 
			
		||||
		{"everness:crystal_tree_sapling", Everness.grow_crystal_tree, "soil"},
 | 
			
		||||
		{"everness:cursed_bush_sapling", Everness.grow_cursed_bush, "soil"},
 | 
			
		||||
		{"everness:cursed_dream_tree_sapling", Everness.grow_cursed_dream_tree, "soil"},
 | 
			
		||||
		{"everness:dry_tree_sapling", Everness.grow_dry_tree, "soil"},
 | 
			
		||||
		{"everness:sequoia_tree_sapling", Everness.grow_sequoia_tree, "soil"},
 | 
			
		||||
		{"everness:willow_tree_sapling", Everness.grow_willow_tree, "soil"}
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- bush classic fruit
 | 
			
		||||
 | 
			
		||||
if core.get_modpath("bushes_classic") then
 | 
			
		||||
 | 
			
		||||
	local function grow_bush(pos)
 | 
			
		||||
 | 
			
		||||
		local meta = core.get_meta(pos)
 | 
			
		||||
		local bush_name = meta:get_string("bush_type")
 | 
			
		||||
 | 
			
		||||
		-- only change if meta found
 | 
			
		||||
		if meta and bush_name then
 | 
			
		||||
			core.swap_node(pos, {name = "bushes:" .. bush_name .. "_bush"})
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	bonemeal:add_sapling({
 | 
			
		||||
		{"bushes:fruitless_bush", grow_bush, "soil"},
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								screenshot.jpg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								screenshot.jpg
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 114 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								screenshot.png
									
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								screenshot.png
									
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 Before Width: | Height: | Size: 15 KiB  | 
							
								
								
									
										2
									
								
								settingtypes.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								settingtypes.txt
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,2 @@
 | 
			
		||||
# Disable recipe for bones:bones to craft into bonemeal
 | 
			
		||||
bonemeal.disable_deathbones_recipe (Disable recipe for death bones into bonemeal) bool false
 | 
			
		||||
		Reference in New Issue
	
	Block a user