Compare commits

...

84 Commits

Author SHA1 Message Date
bri cassa 53aefab9a2 Merge remote-tracking branch 'upstream/master' 2023-12-13 20:56:53 +01:00
bri cassa a5421172d7 Merge remote-tracking branch 'upstream/master' 2023-11-22 23:20:53 +01:00
tenplus1 4f8ca6a0a5 add spore grass to mushroom dirt decorations 2023-11-11 07:39:42 +00:00
tenplus1 c4ac6f8490 use 1x bonemeal item with every sapling chance 2023-10-27 08:12:47 +01:00
tenplus1 8e929e5a1c remove default dependency, add mineclone support 2023-09-01 12:27:23 +01:00
tenplus1 7c89cd6b70 edit mod.conf 2023-08-10 18:58:40 +01:00
tenplus1 862fd2bb1c using mulch on dry_dirt makes it dry_dirt_with_dry_grass 2023-08-10 18:56:27 +01:00
tenplus1 2db3f4b026 5.x 2023-08-08 18:08:25 +01:00
tenplus1 6d21268470 if no meta dont change bush 2023-07-24 07:21:55 +01:00
tenplus1 10dbedd1e8 add bush_classic default if no meta found 2023-07-23 19:10:24 +01:00
tenplus1 34e8c4a106 added bush_classics support 2023-07-23 18:57:09 +01:00
bri cassa 31cf1abfcd Merge remote-tracking branch 'upstream/master' 2023-06-11 15:06:48 +02:00
tenplus1 8b98f5e497 update readme (thx mckaygerhard) 2023-06-10 18:06:37 +01:00
tenplus1 ef937049d2 Bones must be cooked to give bonemeal, player bones craft into 2x bones. 2023-06-10 08:01:13 +01:00
tenplus1 6abbd5fb5e add basandra sapling 2023-06-08 16:00:18 +01:00
bri cassa 0a9668fff1 Merge remote-tracking branch 'upstream/master' 2023-06-05 22:55:07 +02:00
tenplus1 e57dc18818 only take item when used on bonemeal node 2023-05-11 07:11:23 +01:00
tenplus1 a93fc5da3d add Everness support (thx imre84) 2023-05-08 17:47:32 +01:00
tenplus1 a1e5d541c4 add rice seed 2023-04-28 09:18:11 +01:00
tenplus1 0c0f9d1e89 can bonemeal barley, hemp, rye, oat, mint, sunflower seeds 2023-04-28 08:56:49 +01:00
tenplus1 73082b9fac readme updated, thanks eschan145 2023-03-27 11:01:32 +01:00
tenplus1 2fdc3f09b7 code tidy 2023-03-10 14:46:38 +00:00
tenplus1 1935d348c1 add 'bonemeal.disable_deathbones_recipe' setting 2023-01-11 18:55:21 +00:00
tenplus1 8ccf4a591a add moretrees' poplar small sapling 2022-12-19 10:56:31 +00:00
tenplus1 30bd1d708c fix bonemeal take item on every use 2022-11-30 15:24:50 +00:00
tenplus1 b07c76c407 update license.txt 2022-11-28 09:23:40 +00:00
tenplus1 77fee3c7e1 change barley steps to 8 2022-11-14 18:06:20 +00:00
tenplus1 b9cf957dcc tidy helper function 2022-11-03 08:53:52 +00:00
tenplus1 9049dbfefa add helper function and new screenshot 2022-11-02 14:30:24 +00:00
tenplus1 757b85d02f add ginger 2022-10-28 12:21:42 +01:00
tenplus1 70c51d18bb update rhubarb and strawberry growth 2022-09-15 08:04:07 +01:00
tenplus1 d459c60d6d added farming's asparagus, spinach, eggplant 2022-09-13 12:24:23 +01:00
bri cassa d357709339 Merge remote-tracking branch 'upstream/master' 2022-08-26 14:53:18 +02:00
tenplus1 1f4c1a1fd7 fix df_trees tunnel tube growth 2022-07-24 08:34:46 +01:00
tenplus1 9ceeb63c8a add df_trees blood thorn, add df_primordial_items fungal deco 2022-07-24 08:29:15 +01:00
tenplus1 1315e2cc5f add df_primordial_items and tweak surface detection for decorations 2022-07-08 09:21:32 +01:00
tenplus1 4a0eddef02 add df_primordial_items saplings 2022-07-01 14:36:36 +01:00
tenplus1 e163e815d6 add missing nether cap entry 2022-07-01 12:32:38 +01:00
tenplus1 08ed68a8b7 added dfcavern's nether cap 2022-07-01 11:26:00 +01:00
tenplus1 1a1c49ba06 add ignore_light flag to crop and sapling growth, tidy code 2022-07-01 11:20:06 +01:00
tenplus1 996094dd5c fix fungiwood sapling, restart any crop timers 2022-06-30 13:00:50 +01:00
tenplus1 bb34fbae3d tweak crop growth, add df_farming crops 2022-06-30 12:48:18 +01:00
tenplus1 5f81c3dfa2 add initial support for dfcavern saplings 2022-06-30 09:12:11 +01:00
bri cassa 131024ee97 Merge remote-tracking branch 'upstream/master' 2022-05-27 18:28:29 +02:00
tenplus1 804343f7c0 fix large cactus seedling growth 2022-05-08 10:29:10 +01:00
tenplus1 4c50a02a0e change of jungle grass on rainforest litter (thx nixnoxus) 2022-03-19 07:55:03 +00:00
bri cassa 52a3856f26 Merge remote-tracking branch 'upstream/master' 2022-01-22 19:58:01 +01:00
tenplus1 79f9cb3294 support for fern saplings in plantlife mod (thanks nixnoxus) 2022-01-12 08:19:42 +00:00
bri cassa 52ada84c58 Merge remote-tracking branch 'upstream/master' 2021-10-04 21:31:30 +02:00
tenplus1 2d7dbc735c added sunflowers to list 2021-09-28 14:04:25 +01:00
bri cassa a920032dd5 Merge remote-tracking branch 'upstream/master' 2021-08-31 19:44:56 +02:00
tenplus1 b6b40c558a add giant redwood sapling support 2021-08-20 11:24:56 +01:00
bri cassa d534523a1d Merge remote-tracking branch 'upstream/master' 2021-06-20 17:03:28 +02:00
tenplus1 75ec006643 dry grass grows on dry dirt 2021-06-20 08:06:35 +01:00
bri cassa acea1713b7 Merge remote-tracking branch 'upstream/master' 2021-04-17 13:42:29 +02:00
tenplus1 b5819d022e reduce shapeless crafts 2021-04-13 21:00:25 +01:00
bri cassa 1a9c67b1e3 Merge remote-tracking branch 'upstream/master' 2021-04-04 20:56:38 +02:00
tenplus1 05e211a037 can grow cactus and papyrus 2021-04-01 11:51:55 +01:00
bri cassa fdc62f06b0 Merge remote-tracking branch 'upstream/master' 2021-03-12 12:15:29 +01:00
tenplus1 807388d632 add parsley and artichoke 2021-03-11 09:49:20 +00:00
Sys Quatre 2658577776 Merge remote-tracking branch 'upstream/master' 2021-02-23 21:14:06 +01:00
tenplus1 634d1496aa ignore xdecor's flowerpots when adding flowers 2021-02-20 15:52:36 +00:00
tenplus1 8fc57f7746 tweak flower addition to wait until mods loaded 2021-02-20 15:33:03 +00:00
Sys Quatre 7c106254d2 Merge remote-tracking branch 'upstream/master' 2021-01-23 12:53:15 +01:00
tenplus1 308baf3a17 update mod.conf info 2021-01-21 09:53:40 +00:00
Sys Quatre b50f533579 Merge remote-tracking branch 'upstream/master' 2021-01-15 21:08:57 +01:00
tenplus1 587e0fbf02 added german translation (thanks rti) 2021-01-13 10:27:02 +00:00
Sys Quatre 2c90275687 Merge remote-tracking branch 'upstream/master' 2020-12-15 23:25:43 +01:00
tenplus1 30d0c02d8c only use bonemeal items when actually used. 2020-12-13 18:17:11 +00:00
tenplus1 2ec1168292 add vanilla and soy 2020-12-13 10:36:06 +00:00
tenplus1 1aba553059 amend pepper stages 2020-12-13 09:20:21 +00:00
tenplus1 fefe122dc9 added olive and lemon trees 2020-12-12 20:05:25 +00:00
tenplus1 5ce62f46e7 add blackberry and lettuce 2020-12-10 15:35:18 +00:00
Sys Quatre 93a46c05a6 Merge remote-tracking branch 'upstream/master' 2020-11-10 20:00:23 +01:00
tenplus1 77c02f1b7a added recipe 9x seed = 1x mulch 2020-11-10 18:00:11 +00:00
Sys Quatre afc6d7ef12 Merge remote-tracking branch 'upstream/master' 2020-08-30 12:51:47 +02:00
tenplus1 130fffbf97 mt5.x translations added/updated (thanks dacmot) 2020-08-30 08:12:21 +01:00
Sys Quatre b604ca39da Merge remote-tracking branch 'upstream/master' 2020-08-04 20:48:01 +02:00
tenplus1 a5a4798aed rename creative check function 2020-08-03 20:27:47 +01:00
Sys Quatre 97f4b11110 Merge remote-tracking branch 'upstream/master' 2020-07-17 22:45:16 +02:00
TenPlus1 ebbec592bf fix loaded translations 2020-07-08 21:10:36 +01:00
TenPlus1 19df0b4036 add locales for minetest 5.x translation 2020-07-08 21:06:13 +01:00
TenPlus1 e6eaea544c update translation check, added spanish and italian locale 2020-07-08 14:05:34 +01:00
TenPlus1 e4a0a9bfe9 add cabbage support 2020-07-01 19:23:47 +01:00
22 changed files with 765 additions and 339 deletions

213
README.md
View File

@ -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.
![](screenshot.jpg)
## 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

View File

@ -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
})

View File

@ -1,9 +0,0 @@
default
intllib?
farming?
ethereal?
moretrees?
technic_worldgen?
lucky_block?
flowers?
dye?

View File

@ -1 +0,0 @@
Adds bone and bonemeal giving the ability to quickly grow plants and saplings.

424
init.lua
View File

@ -1,100 +1,46 @@
bonemeal = {}
bonemeal = {
item_list = {
bucket_water = "buckets:bucket_water",
bucket_empty = "buckets:bucket_empty",
dirt = "default:dirt",
torch = "default:torch",
coral = "default:coral_skeleton"
}
}
local a = bonemeal.item_list
if minetest.get_modpath("mcl_core") then
a.bucket_water = "mcl_buckets:bucket_water"
a.bucket_empty = "mcl_buckets:bucker_empty"
a.dirt = "mcl_core:dirt"
a.torch = "mcl_torches:torch"
a.coral = "mcl_ocean:dead_horn_coral_block"
end
local path = minetest.get_modpath("bonemeal")
local min, max, random = math.min, math.max, math.random
-- Load support for intllib.
local S, NS = dofile(path .. "/intllib.lua")
-- translation support
local S = minetest.get_translator("bonemeal")
-- creative check
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function is_creative(name)
function bonemeal.is_creative(name)
return creative_mode_cache or minetest.check_player_privs(name, {creative = true})
end
-- default crops
local crops = {
{"farming:cotton_", 8, "farming:seed_cotton"},
{"farming:wheat_", 8, "farming:seed_wheat"}
}
-- 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 crops = {}
local saplings = {}
local deco = {}
--
-- local functions
--
-- particles
local function particle_effect(pos)
@ -111,7 +57,8 @@ local function particle_effect(pos)
maxexptime = 1,
minsize = 1,
maxsize = 3,
texture = "bonemeal_particle.png"
texture = "bonemeal_particle.png",
glow = 5
})
end
@ -120,15 +67,18 @@ end
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})
elseif type(object) == "function" then
-- function
object(pos)
end
@ -136,7 +86,7 @@ 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({
@ -150,37 +100,39 @@ 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
if math.random(5 - strength) == 1 then
grow_tree(pos, saplings[n][2])
end
return true
end
end
end
@ -188,34 +140,51 @@ 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)
return
minetest.get_node_timer(pos):start(10) -- restart any timers
return true
end
end
end
@ -227,33 +196,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
@ -265,15 +222,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
@ -290,7 +252,9 @@ local function check_soil(pos, nodename, strength)
-- if param2 not preset then get from existing node
if not def then
local node = minetest.get_node_or_nil(pos2)
def = node and node.param2 or 0
end
@ -302,11 +266,44 @@ local function check_soil(pos, nodename, strength)
end
-- helper function
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 = minetest.get_node(pos)
local def = minetest.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 minetest.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)
@ -402,9 +399,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
@ -436,38 +436,54 @@ function bonemeal:on_use(pos, strength, node)
if node.name == "default:papyrus" then
default.grow_papyrus(pos, node)
particle_effect(pos)
return
return true
elseif node.name == "default:cactus" then
default.grow_cactus(pos, node)
particle_effect(pos)
return
return true
elseif node.name == "default:dry_dirt" and strength == 1 then
minetest.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
check_soil(pos, node.name, strength)
return
return true
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)
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
@ -483,23 +499,19 @@ minetest.register_craftitem("bonemeal:mulch", {
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
@ -513,23 +525,19 @@ minetest.register_craftitem("bonemeal:bonemeal", {
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
@ -543,23 +551,19 @@ minetest.register_craftitem("bonemeal:fertiliser", {
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
@ -591,55 +595,64 @@ minetest.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",
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 minetest.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
minetest.register_craft({
output = "bonemeal:bone 2",
recipe = {{"bones:bones"}}
})
end
-- bonemeal (from coral skeleton)
minetest.register_craft({
type = "shapeless",
output = "bonemeal:bonemeal 2",
recipe = {"default:coral_skeleton"}
recipe = {{a.coral}}
})
-- mulch
minetest.register_craft({
type = "shapeless",
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"}
}
})
minetest.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"}
recipe = {{"bonemeal:bonemeal", "bonemeal:mulch"}}
})
-- add bones to dirt
-- NALC: add bones to dirt but without overriding a previous drop definition
-- from other mods.
local drop = minetest.registered_items["default:dirt"].drop
if drop then
table.insert(drop.items, 1, {items = {"bonemeal:bone"}, rarity = 30})
@ -658,8 +671,13 @@ else
}
end
-- add support for other mods
-- add support for mods
dofile(path .. "/mods.lua")
dofile(path .. "/lucky_block.lua")
print (S("[MOD] bonemeal loaded"))
-- lucky block support
if minetest.get_modpath("lucky_block") then
dofile(path .. "/lucky_block.lua")
end
print ("[MOD] Bonemeal loaded")

View File

@ -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

View File

@ -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
View 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
View File

@ -0,0 +1,6 @@
# textdomain:bonemeal
#Bone=
#Bone Meal=
#Fertiliser=
#Gelatin Powder=
#Mulch=

6
locale/bonemeal.es.tr Normal file
View 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
View 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
View 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
View File

@ -0,0 +1,6 @@
# textdomain:bonemeal
Bone=Кость
Bone Meal=Костная Мука
Fertiliser=Удобрение
#Gelatin Powder=
Mulch=Мульча

View File

@ -1,7 +0,0 @@
# init.lua
Mulch = Paillis
Bone Meal = Poudre d'os
Fertiliser = Engrais
Bone = Os
[MOD] bonemeal loaded = [MOD] bonemeal chargé

View File

@ -1,7 +0,0 @@
# init.lua
Mulch = Мульча
Bone Meal = Костная Мука
Fertiliser = Удобрение
Bone = Кость
[MOD] bonemeal loaded = [MOD] костная мука загружена

View File

@ -1,7 +0,0 @@
# init.lua
Mulch =
Bone Meal =
Fertiliser =
Bone =
[bonemeal] loaded =

View File

@ -11,19 +11,15 @@ local function growy(pos, player)
end
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}
}}
})

View File

@ -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

311
mods.lua
View File

@ -3,9 +3,99 @@
if minetest.get_modpath("animalmaterials") then
minetest.register_craft({
type = "shapeless",
output = "bonemeal:bonemeal 2",
recipe = {"animalmaterials:bone"}
recipe = {{"animalmaterials:bone"}}
})
end
if minetest.get_modpath("default") then
-- saplings
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
local function cactus_grow(pos)
default.grow_cactus(pos, minetest.get_node(pos))
end
local function papyrus_grow(pos)
default.grow_papyrus(pos, minetest.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 = {}
minetest.after(0.1, function()
for node, def in pairs(minetest.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", "", "", ""}}
})
end
if farming then
bonemeal:add_crop({
{"farming:cotton_", 8, "farming:seed_cotton"},
{"farming:wheat_", 8, "farming:seed_wheat"}
})
end
@ -26,20 +116,33 @@ 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
@ -61,10 +164,14 @@ if minetest.get_modpath("ethereal") then
{"ethereal:mushroom_sapling", ethereal.grow_mushroom_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"}
})
local grass = {"default:grass_3", "default:grass_4", "default:grass_5", ""}
@ -77,7 +184,8 @@ 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, {}}
@ -104,16 +212,15 @@ 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"}
@ -144,10 +251,32 @@ 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 = {
bonemeal = "white", fertiliser = "green", mulch = "brown"}
local bonemeal_dyes = {bonemeal = "white", fertiliser = "green", mulch = "brown"}
for mat, dye in pairs(bonemeal_dyes) do
@ -159,3 +288,153 @@ 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(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(#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
if minetest.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
if minetest.get_modpath("bushes_classic") then
local function grow_bush(pos)
local meta = minetest.get_meta(pos)
local bush_name = meta:get_string("bush_type")
-- only change if meta found
if meta and bush_name then
minetest.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

Binary file not shown.

After

Width:  |  Height:  |  Size: 114 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

2
settingtypes.txt Normal file
View 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