Compare commits

...

20 Commits

Author SHA1 Message Date
a200c9913e add mangrove sapling and mud deco 2025-06-30 16:53:59 +01:00
be412804df fix y_func 2025-05-05 12:52:11 +01:00
d6893aae07 change minetest. to core. 2025-05-04 10:44:49 +01:00
81f36673d3 tidy and tweak code 2025-05-03 11:35:31 +01:00
c2d76b779d add ukrainian translation (thx Fromkaniv) 2025-03-15 16:36:27 +00:00
0d852bff0a add coniferous litter deco, fix df_caverns saplings 2024-07-23 12:35:48 +01:00
2a4ddd96db fix recipe type 2024-05-14 08:00:46 +01:00
09fa9d6251 add new ethereal brown mushroom sapling 2024-05-07 07:36:53 +01:00
4f8ca6a0a5 add spore grass to mushroom dirt decorations 2023-11-11 07:39:42 +00:00
c4ac6f8490 use 1x bonemeal item with every sapling chance 2023-10-27 08:12:47 +01:00
8e929e5a1c remove default dependency, add mineclone support 2023-09-01 12:27:23 +01:00
7c89cd6b70 edit mod.conf 2023-08-10 18:58:40 +01:00
862fd2bb1c using mulch on dry_dirt makes it dry_dirt_with_dry_grass 2023-08-10 18:56:27 +01:00
2db3f4b026 5.x 2023-08-08 18:08:25 +01:00
6d21268470 if no meta dont change bush 2023-07-24 07:21:55 +01:00
10dbedd1e8 add bush_classic default if no meta found 2023-07-23 19:10:24 +01:00
34e8c4a106 added bush_classics support 2023-07-23 18:57:09 +01:00
8b98f5e497 update readme (thx mckaygerhard) 2023-06-10 18:06:37 +01:00
ef937049d2 Bones must be cooked to give bonemeal, player bones craft into 2x bones. 2023-06-10 08:01:13 +01:00
6abbd5fb5e add basandra sapling 2023-06-08 16:00:18 +01:00
14 changed files with 462 additions and 309 deletions

147
README.md
View File

@ -1,9 +1,26 @@
# Bonemeal minetest mod Bonemeal
=====================
**Name**: `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 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 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. 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 Each item can be used on saplings and crops for a chance to grow them quicker
@ -14,92 +31,170 @@ 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 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. quicker or simply decorate a larger area with grass and flowers.
The [`api.txt`](https://notabug.org/TenPlus1/bonemeal/src/master/api.txt) #### Dependencies
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 Dependencies: default
examples by using some of the popular mods available.
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 https://forum.minetest.net/viewtopic.php?f=9&t=16446
**Lucky Blocks**: 6 #### Nodes
| 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 |
#### 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 ## Changelog
### Version 0.1 #### Version 0.1
* Initial release * Initial release
### Version 0.2 #### Version 0.2
* Added global `on_use` function for bonemeal growth * Added global `on_use` function for bonemeal growth
### Version 0.3 #### Version 0.3
* Added strength to `on_use` global for new items (mulch and fertiliser) * Added strength to `on_use` global for new items (mulch and fertiliser)
### Version 0.4 #### Version 0.4
* Added `Intllib` support and `fr.txt` file for French translation. * Added `Intllib` support and `fr.txt` file for French translation.
### Version 0.5 #### Version 0.5
* Added support for default bush and acacia bush saplings * Added support for default bush and acacia bush saplings
### Version 0.6 #### Version 0.6
* Using newer functions. This means Minetest 0.4.16 and above needed to run * Using newer functions. This means Minetest 0.4.16 and above needed to run
### Version 0.7 #### Version 0.7
* Can be used on papyrus and cactus now * Can be used on papyrus and cactus now
* Added coral recipe * Added coral recipe
* API addition * API addition
### Version 0.8 #### Version 0.8
* Added support for farming redo's new garlic * Added support for farming redo's new garlic
* Added pepper and onion crops * Added pepper and onion crops
### Version 0.9 #### Version 0.9
* Added support for farming redo's pea and beetroot crops * Added support for farming redo's pea and beetroot crops
* Checks for `place_param` * Checks for `place_param`
### Version 1.0 #### Version 1.0
* `add_deco()` now adds to existing item list while `set_deco()` replaces item * `add_deco()` now adds to existing item list while `set_deco()` replaces item
list (thanks `h-v-smacker`) list (thanks `h-v-smacker`)
### Version 1.1 #### Version 1.1
* Added `{can_bonemeal=1}` group for special nodes * Added `{can_bonemeal=1}` group for special nodes
### Version 1.2 #### Version 1.2
* Added support for Minetest 5.0 cactus seedling, blueberry bush sapling and * Added support for Minetest 5.0 cactus seedling, blueberry bush sapling and
emergent jungle tree saplings, additional flowers and pine bush sapling emergent jungle tree saplings, additional flowers and pine bush sapling
### Version 1.3 #### Version 1.3
* Added ability to craft dye from mulch, bonemeal and fertiliser (thanks * Added ability to craft dye from mulch, bonemeal and fertiliser (thanks
`orbea`) `orbea`)
### Version 1.4 #### Version 1.4
* Added support for fern saplings from `plantlife` mod (thanks `nixnoxus`) * Added support for fern saplings from `plantlife` mod (thanks `nixnoxus`)
### Version 1.5 #### Version 1.5
* Added support for farming redo's asparagus, eggplant, spinach * Added support for farming redo's asparagus, eggplant, spinach
### Version 1.6 #### Version 1.6
* Added helper function for position and protection check * Added helper function for position and protection check
* Added ginger support * Added ginger support
* Added moretrees poplar sapling * Added moretrees poplar sapling
### Version 1.7 #### Version 1.7
* Added farming redo's barley, hemp, rye, oat, mint, sunflower, rice seeds * Added farming redo's barley, hemp, rye, oat, mint, sunflower, rice seeds
* Added Everness saplings * Added Everness saplings
* Update readme * 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

@ -1,14 +0,0 @@
default
farming?
ethereal?
moretrees?
technic_worldgen?
lucky_block?
flowers?
dye?
ferns?
dryplants?
df_trees?
df_farming?
df_primordial_items?
everness?

View File

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

352
init.lua
View File

@ -1,124 +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 local min, max, random = math.min, math.max, math.random
-- creative check helper
-- translation support local creative_mode_cache = core.settings:get_bool("creative_mode")
local S = function(s) return s end -- default boilerplate function
if minetest.get_translator ~= nil then
S = minetest.get_translator("bonemeal") -- 5.x translation function
end
-- creative check
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
function bonemeal.is_creative(name) function bonemeal.is_creative(name)
return creative_mode_cache or minetest.check_player_privs(name, {creative = true}) return creative_mode_cache or core.check_player_privs(name, {creative = true})
end end
-- API tables
-- default crops local crops = {}
local crops = { local saplings = {}
{"farming:cotton_", 8, "farming:seed_cotton"}, local deco = {}
{"farming:wheat_", 8, "farming:seed_wheat"}
}
-- 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
-- special function for cactus growth
local function cactus_grow(pos)
default.grow_cactus(pos, minetest.get_node(pos))
end
-- special function for papyrus growth
local function papyrus_grow(pos)
default.grow_papyrus(pos, minetest.get_node(pos))
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"},
{"default:cactus", cactus_grow, "sand"},
{"default:papyrus", papyrus_grow, "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", "", ""
}
-- loads mods then add all in-game flowers except waterlily
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("xdecor:potted_")
and not node:find("df_farming:") then
flowers[#flowers + 1] = node
end
end
end)
-- default biomes deco
local deco = {
{"default:dirt", green_grass, flowers},
{"default:dirt_with_grass", green_grass, flowers},
{"default:dry_dirt", dry_grass, {}},
{"default:dry_dirt_with_dry_grass", dry_grass, {}},
{"default:dirt_with_dry_grass", dry_grass, flowers},
{"default:sand", {}, {"default:dry_shrub", "", "", ""} },
{"default:desert_sand", {}, {"default:dry_shrub", "", "", ""} },
{"default:silver_sand", {}, {"default:dry_shrub", "", "", ""} },
{"default:dirt_with_rainforest_litter", {}, {"default:junglegrass", "", "", ""}}
}
--
-- local functions
--
-- particles
local function particle_effect(pos) local function particle_effect(pos)
minetest.add_particlespawner({ core.add_particlespawner({
amount = 4, amount = 4,
time = 0.15, time = 0.15,
minpos = pos, minpos = pos,
@ -136,38 +57,31 @@ local function particle_effect(pos)
}) })
end end
-- tree type check -- tree type check
local function grow_tree(pos, object) local function grow_tree(pos, object)
if type(object) == "table" and object.axiom then if type(object) == "table" and object.axiom then
-- grow L-system tree core.remove_node(pos)
minetest.remove_node(pos) core.spawn_tree(pos, object) -- grow L-system tree
minetest.spawn_tree(pos, object)
elseif type(object) == "string" and minetest.registered_nodes[object] then elseif type(object) == "string" and core.registered_nodes[object] then
-- place node core.set_node(pos, {name = object}) -- place node
minetest.set_node(pos, {name = object})
elseif type(object) == "function" then elseif type(object) == "function" then
-- function object(pos) -- execute function
object(pos)
end end
end end
-- sapling check -- sapling check
local function check_sapling(pos, sapling_node, light_ok)
local function check_sapling(pos, sapling_node, strength, light_ok)
-- what is sapling placed on? -- what is sapling placed on?
local under = minetest.get_node({ local under = core.get_node({x = pos.x, y = pos.y - 1, z = pos.z})
x = pos.x,
y = pos.y - 1,
z = pos.z
})
local can_grow, grow_on local can_grow, grow_on
@ -188,7 +102,7 @@ local function check_sapling(pos, sapling_node, light_ok)
local group = grow_on:split(":")[2] local group = grow_on:split(":")[2]
if minetest.get_item_group(under.name, group) > 0 then if core.get_item_group(under.name, group) > 0 then
can_grow = true can_grow = true
end end
@ -202,7 +116,9 @@ local function check_sapling(pos, sapling_node, light_ok)
particle_effect(pos) particle_effect(pos)
grow_tree(pos, saplings[n][2]) if math.random(5 - strength) == 1 then
grow_tree(pos, saplings[n][2])
end
return true return true
end end
@ -210,8 +126,8 @@ local function check_sapling(pos, sapling_node, light_ok)
end end
end end
-- crops check -- crops check
local function check_crops(pos, nodename, strength, light_ok) local function check_crops(pos, nodename, strength, light_ok)
local mod, crop, stage, nod, def local mod, crop, stage, nod, def
@ -241,7 +157,7 @@ local function check_crops(pos, nodename, strength, light_ok)
-- check for place_param setting -- check for place_param setting
nod = crops[n][1] .. stage 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 -- make sure crop exists or isn't fully grown already
if not def or nod == nodename then if not def or nod == nodename then
@ -250,19 +166,19 @@ local function check_crops(pos, nodename, strength, light_ok)
def = def and def.place_param2 or 0 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) particle_effect(pos)
minetest.get_node_timer(pos):start(10) -- restart any timers core.get_node_timer(pos):start(10) -- restart any timers
return true return true
end end
end end
end end
-- check soil for specific decoration placement -- check soil for specific decoration placement
local function check_soil(pos, nodename, strength) local function check_soil(pos, nodename, strength)
-- set radius according to strength -- set radius according to strength
@ -270,7 +186,7 @@ local function check_soil(pos, nodename, strength)
local tall = max(strength - 2, 0) local tall = max(strength - 2, 0)
-- get area of land with free space above -- 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},
{x = pos.x + side, y = pos.y + tall, z = pos.z + side}, {nodename}) {x = pos.x + side, y = pos.y + tall, z = pos.z + side}, {nodename})
@ -319,43 +235,39 @@ local function check_soil(pos, nodename, strength)
if nod and nod ~= "" then if nod and nod ~= "" then
-- get crop param2 value -- get crop param2 value
def = minetest.registered_nodes[nod] def = core.registered_nodes[nod]
def = def and def.place_param2 def = def and def.place_param2
-- if param2 not preset then get from existing node -- if param2 not preset then get from existing node
if not def then 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 def = node and node.param2 or 0
end end
minetest.set_node(pos2, {name = nod, param2 = def}) core.set_node(pos2, {name = nod, param2 = def})
end end
particle_effect(pos2) particle_effect(pos2)
end end
end end
-- helper function -- helper function
local function use_checks(user, pointed_thing) local function use_checks(user, pointed_thing)
-- make sure we use on node -- make sure we use on node
if pointed_thing.type ~= "node" then if pointed_thing.type ~= "node" then return false end
return false
end
-- get position and node info -- get position and node info
local pos = pointed_thing.under local pos = pointed_thing.under
local node = minetest.get_node(pos) local node = core.get_node(pos)
local def = minetest.registered_items[node.name] local def = core.registered_items[node.name]
local dirt = def and def.groups local dirt = def and def.groups
-- does node have groups set -- does node have groups set
if not dirt then if not dirt then return false end
return false
end
-- if we're using on ground, move position up -- if we're using on ground, move position up
if dirt.soil or dirt.sand or dirt.can_bonemeal then if dirt.soil or dirt.sand or dirt.can_bonemeal then
@ -363,16 +275,14 @@ local function use_checks(user, pointed_thing)
end end
-- check if protected -- check if protected
if minetest.is_protected(pos, user:get_player_name()) then if core.is_protected(pos, user:get_player_name()) then
return false return false
end end
return node return node
end end
--= Global functions
-- global functions
-- add to sapling list -- add to sapling list
-- {sapling node, schematic or function name, "soil"|"sand"|specific_node|"group:"} -- {sapling node, schematic or function name, "soil"|"sand"|specific_node|"group:"}
@ -385,10 +295,10 @@ function bonemeal:add_sapling(list)
end end
end end
-- add to crop list to force grow -- add to crop list to force grow
-- {crop name start_, growth steps, seed node (if required)} -- {crop name start_, growth steps, seed node (if required)}
-- e.g. {"farming:wheat_", 8, "farming:seed_wheat"} -- e.g. {"farming:wheat_", 8, "farming:seed_wheat"}
function bonemeal:add_crop(list) function bonemeal:add_crop(list)
for n = 1, #list do for n = 1, #list do
@ -396,12 +306,12 @@ function bonemeal:add_crop(list)
end end
end end
-- add grass and flower/plant decoration for specific dirt types -- add grass and flower/plant decoration for specific dirt types
-- {dirt_node, {grass_nodes}, {flower_nodes} -- {dirt_node, {grass_nodes}, {flower_nodes}
-- e.g. {"default:dirt_with_dry_grass", dry_grass, flowers} -- 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 -- 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. -- entries, allowing to both add decorations and decrease their frequency.
function bonemeal:add_deco(list) function bonemeal:add_deco(list)
for l = 1, #list do for l = 1, #list do
@ -419,8 +329,7 @@ function bonemeal:add_deco(list)
for _, entry in pairs(deco[n][2]) do for _, entry in pairs(deco[n][2]) do
if extra == entry then if extra == entry then
extra = false extra = false ; break
break
end end
end end
end end
@ -438,8 +347,7 @@ function bonemeal:add_deco(list)
for __, entry in pairs(deco[n][3]) do for __, entry in pairs(deco[n][3]) do
if extra == entry then if extra == entry then
extra = false extra = false ; break
break
end end
end end
end end
@ -449,8 +357,7 @@ function bonemeal:add_deco(list)
end end
end end
list[l] = false list[l] = false ; break
break
end end
end end
@ -460,9 +367,9 @@ function bonemeal:add_deco(list)
end end
end end
-- definitively set a decration scheme -- definitively set a decration scheme
-- this function will either add a new entry as is, or replace the existing one -- this function will either add a new entry as is, or replace the existing one
function bonemeal:set_deco(list) function bonemeal:set_deco(list)
for l = 1, #list do for l = 1, #list do
@ -487,17 +394,15 @@ function bonemeal:set_deco(list)
end end
end end
-- global on_use function for bonemeal -- global on_use function for bonemeal
function bonemeal:on_use(pos, strength, node) function bonemeal:on_use(pos, strength, node)
-- get node pointed at -- get node pointed at
local node = node or minetest.get_node(pos) local node = node or core.get_node(pos)
-- return if nothing there -- return if nothing there
if node.name == "ignore" then if node.name == "ignore" then return end
return
end
-- make sure strength is between 1 and 4 -- make sure strength is between 1 and 4
strength = strength or 1 strength = strength or 1
@ -509,23 +414,25 @@ function bonemeal:on_use(pos, strength, node)
default.grow_papyrus(pos, node) default.grow_papyrus(pos, node)
particle_effect(pos) particle_effect(pos) ; return true
return true
elseif node.name == "default:cactus" then elseif node.name == "default:cactus" then
default.grow_cactus(pos, node) default.grow_cactus(pos, node)
particle_effect(pos) particle_effect(pos) ; return true
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 end
-- grow grass and flowers -- grow grass and flowers
if minetest.get_item_group(node.name, "soil") > 0 if core.get_item_group(node.name, "soil") > 0
or minetest.get_item_group(node.name, "sand") > 0 or core.get_item_group(node.name, "sand") > 0
or minetest.get_item_group(node.name, "can_bonemeal") > 0 then or core.get_item_group(node.name, "can_bonemeal") > 0 then
check_soil(pos, node.name, strength) check_soil(pos, node.name, strength)
@ -535,13 +442,12 @@ function bonemeal:on_use(pos, strength, node)
-- light check depending on strength (strength of 4 = no light needed) -- light check depending on strength (strength of 4 = no light needed)
local light_ok = true local light_ok = true
if (minetest.get_node_light(pos) or 0) < (12 - (strength * 3)) then if (core.get_node_light(pos) or 0) < (12 - (strength * 3)) then
light_ok = nil light_ok = nil
end end
-- check for sapling growth -- check for sapling growth
if random(5 - strength) == 1 if check_sapling(pos, node.name, strength, light_ok) then
and check_sapling(pos, node.name, light_ok) then
return true return true
end end
@ -551,14 +457,11 @@ function bonemeal:on_use(pos, strength, node)
end end
end end
--= Items
--
-- items
--
-- mulch (strength 1) -- mulch (strength 1)
minetest.register_craftitem("bonemeal:mulch", {
core.register_craftitem("bonemeal:mulch", {
description = S("Mulch"), description = S("Mulch"),
inventory_image = "bonemeal_mulch.png", inventory_image = "bonemeal_mulch.png",
@ -582,9 +485,9 @@ minetest.register_craftitem("bonemeal:mulch", {
end end
}) })
-- bonemeal (strength 2) -- bonemeal (strength 2)
minetest.register_craftitem("bonemeal:bonemeal", {
core.register_craftitem("bonemeal:bonemeal", {
description = S("Bone Meal"), description = S("Bone Meal"),
inventory_image = "bonemeal_item.png", inventory_image = "bonemeal_item.png",
@ -608,9 +511,9 @@ minetest.register_craftitem("bonemeal:bonemeal", {
end end
}) })
-- fertiliser (strength 3) -- fertiliser (strength 3)
minetest.register_craftitem("bonemeal:fertiliser", {
core.register_craftitem("bonemeal:fertiliser", {
description = S("Fertiliser"), description = S("Fertiliser"),
inventory_image = "bonemeal_fertiliser.png", inventory_image = "bonemeal_fertiliser.png",
@ -634,63 +537,67 @@ minetest.register_craftitem("bonemeal:fertiliser", {
end end
}) })
-- bone -- bone
minetest.register_craftitem("bonemeal:bone", {
core.register_craftitem("bonemeal:bone", {
description = S("Bone"), description = S("Bone"),
inventory_image = "bonemeal_bone.png", inventory_image = "bonemeal_bone.png",
groups = {bone = 1} groups = {bone = 1}
}) })
-- gelatin powder -- gelatin powder
minetest.register_craftitem("bonemeal:gelatin_powder", {
core.register_craftitem("bonemeal:gelatin_powder", {
description = S("Gelatin Powder"), description = S("Gelatin Powder"),
inventory_image = "bonemeal_gelatin_powder.png", inventory_image = "bonemeal_gelatin_powder.png",
groups = {food_gelatin = 1, flammable = 2} groups = {food_gelatin = 1, flammable = 2}
}) })
--= Recipes
--
-- crafting recipes
--
-- gelatin powder -- gelatin powder
minetest.register_craft({
core.register_craft({
output = "bonemeal:gelatin_powder 4", output = "bonemeal:gelatin_powder 4",
recipe = { recipe = {
{"group:bone", "group:bone", "group:bone"}, {"group:bone", "group:bone", "group:bone"},
{"bucket:bucket_water", "bucket:bucket_water", "bucket:bucket_water"}, {a.bucket_water, a.bucket_water, a.bucket_water},
{"bucket:bucket_water", "default:torch", "bucket:bucket_water"} {a.bucket_water, a.torch, a.bucket_water}
}, },
replacements = { replacements = {
{"bucket:bucket_water", "bucket:bucket_empty 5"} {a.bucket_water, a.bucket_empty .. " 5"}
} }
}) })
-- bonemeal (from bone) -- bonemeal (from bone)
minetest.register_craft({
core.register_craft({
type = "cooking",
output = "bonemeal:bonemeal 2", output = "bonemeal:bonemeal 2",
recipe = {{"group:bone"}} recipe = "group:bone",
cooktime = 4
}) })
-- bonemeal (from player bones) -- bonemeal (from player bones)
if minetest.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
minetest.register_craft({ if core.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
output = "bonemeal:bonemeal 4",
core.register_craft({
output = "bonemeal:bone 2",
recipe = {{"bones:bones"}} recipe = {{"bones:bones"}}
}) })
end end
-- bonemeal (from coral skeleton) -- bonemeal (from coral skeleton)
minetest.register_craft({
core.register_craft({
output = "bonemeal:bonemeal 2", output = "bonemeal:bonemeal 2",
recipe = {{"default:coral_skeleton"}} recipe = {{a.coral}}
}) })
-- mulch -- mulch
minetest.register_craft({
core.register_craft({
output = "bonemeal:mulch 4", output = "bonemeal:mulch 4",
recipe = { recipe = {
{"group:tree", "group:leaves", "group:leaves"}, {"group:tree", "group:leaves", "group:leaves"},
@ -699,7 +606,7 @@ minetest.register_craft({
} }
}) })
minetest.register_craft({ core.register_craft({
output = "bonemeal:mulch", output = "bonemeal:mulch",
recipe = { recipe = {
{"group:seed", "group:seed", "group:seed"}, {"group:seed", "group:seed", "group:seed"},
@ -709,34 +616,39 @@ minetest.register_craft({
}) })
-- fertiliser -- fertiliser
minetest.register_craft({
core.register_craft({
output = "bonemeal:fertiliser 2", output = "bonemeal:fertiliser 2",
recipe = {{"bonemeal:bonemeal", "bonemeal:mulch"}} recipe = {{"bonemeal:bonemeal", "bonemeal:mulch"}}
}) })
-- add bones to dirt -- add bones to dirt
minetest.override_item("default:dirt", {
drop = { if core.registered_items[a.dirt] then
max_items = 1,
items = { core.override_item(a.dirt, {
{ drop = {
items = {"bonemeal:bone"}, max_items = 1,
rarity = 40 items = {
}, {
{ items = {"bonemeal:bone"},
items = {"default:dirt"} rarity = 40
},
{
items = {a.dirt}
}
} }
} }
} })
}) end
-- add support for mods
-- add support for other mods
dofile(path .. "/mods.lua") dofile(path .. "/mods.lua")
-- lucky block support -- lucky block support
if minetest.get_modpath("lucky_block") then
if core.get_modpath("lucky_block") then
dofile(path .. "/lucky_block.lua") dofile(path .. "/lucky_block.lua")
end end

View File

@ -1,5 +1,4 @@
# textdomain:bonemeal # textdomain:bonemeal
[MOD] bonemeal loaded=[MOD] bonemeal geladen
Bone=Knochen Bone=Knochen
Bone Meal=Knochenmehl Bone Meal=Knochenmehl
Fertiliser=Dünger Fertiliser=Dünger

View File

@ -1,5 +1,4 @@
# textdomain:bonemeal # textdomain:bonemeal
#[MOD] bonemeal loaded=
#Bone= #Bone=
#Bone Meal= #Bone Meal=
#Fertiliser= #Fertiliser=

View File

@ -1,5 +1,4 @@
# textdomain:bonemeal # textdomain:bonemeal
[MOD] bonemeal loaded=[MOD] bonemeal cargado
Bone=Hueso Bone=Hueso
Bone Meal=Comida de hueso Bone Meal=Comida de hueso
Fertiliser=Fertilizante Fertiliser=Fertilizante

View File

@ -1,5 +1,4 @@
# textdomain:bonemeal # textdomain:bonemeal
[MOD] bonemeal loaded=[MOD] bonemeal chargé
Bone=Os Bone=Os
Bone Meal=Poudre d'os Bone Meal=Poudre d'os
Fertiliser=Engrais Fertiliser=Engrais

View File

@ -1,5 +1,4 @@
# textdomain:bonemeal # textdomain:bonemeal
[MOD] bonemeal loaded=[MOD] bonemeal caricata
Bone=Ossa Bone=Ossa
Bone Meal=Pasto osseo Bone Meal=Pasto osseo
Fertiliser=Fertilizzante Fertiliser=Fertilizzante

View File

@ -1,5 +1,4 @@
# textdomain:bonemeal # textdomain:bonemeal
[MOD] bonemeal loaded=[MOD] костная мука загружена
Bone=Кость Bone=Кость
Bone Meal=Костная Мука Bone Meal=Костная Мука
Fertiliser=Удобрение Fertiliser=Удобрение

10
locale/bonemeal.uk.tr Normal file
View 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=Мульча

View File

@ -1,15 +1,16 @@
-- add lucky blocks -- helper function
local function growy(pos, player) 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 if dpos then
bonemeal:on_use(dpos, 5) bonemeal:on_use(dpos, 5)
end end
end end
-- add lucky blocks
lucky_block:add_blocks({ lucky_block:add_blocks({
{"lig"}, {"lig"},

View File

@ -1,4 +1,4 @@
name = bonemeal name = bonemeal
depends = default
optional_depends = lucky_block, farming, ethereal, moretrees, technic_worldgen, flowers, dye, ferns, dryplants, df_trees, df_farming, df_primordial_items, everness
description = Adds bone and bonemeal giving the ability to quickly grow plants and saplings. 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

232
mods.lua
View File

@ -1,13 +1,111 @@
-- craft bones from animalmaterials into bonemeal -- craft bones from animalmaterials into bonemeal
if minetest.get_modpath("animalmaterials") then
minetest.register_craft({ if core.get_modpath("animalmaterials") then
core.register_craft({
output = "bonemeal:bonemeal 2", output = "bonemeal:bonemeal 2",
recipe = {{"animalmaterials:bone"}} recipe = {{"animalmaterials:bone"}}
}) })
end 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 if farming and farming.mod and farming.mod == "redo" then
@ -55,8 +153,9 @@ if farming and farming.mod and farming.mod == "redo" then
}) })
end end
-- ethereal crops, saplings and grass
if minetest.get_modpath("ethereal") then if core.get_modpath("ethereal") then
bonemeal:add_crop({ bonemeal:add_crop({
{"ethereal:strawberry_", 8}, {"ethereal:strawberry_", 8},
@ -71,6 +170,7 @@ if minetest.get_modpath("ethereal") then
{"ethereal:banana_tree_sapling", ethereal.grow_banana_tree, "soil"}, {"ethereal:banana_tree_sapling", ethereal.grow_banana_tree, "soil"},
{"ethereal:frost_tree_sapling", ethereal.grow_frost_tree, "soil"}, {"ethereal:frost_tree_sapling", ethereal.grow_frost_tree, "soil"},
{"ethereal:mushroom_sapling", ethereal.grow_mushroom_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:willow_sapling", ethereal.grow_willow_tree, "soil"},
{"ethereal:redwood_sapling", ethereal.grow_redwood_tree, "soil"}, {"ethereal:redwood_sapling", ethereal.grow_redwood_tree, "soil"},
{"ethereal:giant_redwood_sapling", ethereal.grow_giant_redwood_tree, "soil"}, {"ethereal:giant_redwood_sapling", ethereal.grow_giant_redwood_tree, "soil"},
@ -79,7 +179,9 @@ if minetest.get_modpath("ethereal") then
{"ethereal:birch_sapling", ethereal.grow_birch_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:lemon_tree_sapling", ethereal.grow_lemon_tree, "soil"},
{"ethereal:olive_tree_sapling", ethereal.grow_olive_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", ""} local grass = {"default:grass_3", "default:grass_4", "default:grass_5", ""}
@ -92,20 +194,24 @@ if minetest.get_modpath("ethereal") then
"flowers:tulip", "flowers:viola", "ethereal:strawberry_7"}}, "flowers:tulip", "flowers:viola", "ethereal:strawberry_7"}},
{"ethereal:gray_dirt", {}, {"ethereal:snowygrass", "", ""}}, {"ethereal:gray_dirt", {}, {"ethereal:snowygrass", "", ""}},
{"ethereal:cold_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:jungle_dirt", grass, {"default:junglegrass", "", "", ""}},
{"ethereal:grove_dirt", grass, {"ethereal:fern", "", "", ""}}, {"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 end
-- moretrees saplings
if minetest.get_modpath("moretrees") then if core.get_modpath("moretrees") then
-- special fir check for snow -- special fir check for snow
local function fir_grow(pos) 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 {"default:snow", "default:snowblock", "default:dirt_with_snow"}) then
moretrees.grow_fir_snow(pos) moretrees.grow_fir_snow(pos)
@ -132,23 +238,27 @@ if minetest.get_modpath("moretrees") then
{"moretrees:rubber_tree_sapling", moretrees.spawn_rubber_tree_object, "soil"}, {"moretrees:rubber_tree_sapling", moretrees.spawn_rubber_tree_object, "soil"},
{"moretrees:fir_sapling", fir_grow, "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({ bonemeal:add_sapling({
{"moretrees:rubber_tree_sapling", technic.rubber_tree_model, "soil"} {"moretrees:rubber_tree_sapling", technic.rubber_tree_model, "soil"}
}) })
end 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) 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) {x = pos.x - 5, y = pos.y, z = pos.z - 5}, fil, 0, nil, false)
end end
@ -157,6 +267,7 @@ if minetest.get_modpath("caverealms") then
}) })
end end
-- helper
local function y_func(grow_func) local function y_func(grow_func)
return function(pos) return function(pos)
@ -164,30 +275,38 @@ local function y_func(grow_func)
end end
end end
if minetest.get_modpath("ferns") then -- ferns
if core.get_modpath("ferns") then
bonemeal:add_sapling({ bonemeal:add_sapling({
{"ferns:sapling_giant_tree_fern", y_func(abstract_ferns.grow_giant_tree_fern), "soil"}, {"ferns:sapling_giant_tree_fern",
{"ferns:sapling_giant_tree_fern", y_func(abstract_ferns.grow_giant_tree_fern), "sand"}, y_func(abstract_ferns.grow_giant_tree_fern), "soil"},
{"ferns:sapling_tree_fern", y_func(abstract_ferns.grow_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 end
if minetest.get_modpath("dryplants") then -- dryplants sapling
if core.get_modpath("dryplants") then
bonemeal:add_sapling({ bonemeal:add_sapling({
{"dryplants:reedmace_sapling", y_func(abstract_dryplants.grow_reedmace), "soil"} {"dryplants:reedmace_sapling", y_func(abstract_dryplants.grow_reedmace), "soil"}
}) })
end end
-- add bonemeal dyes
if minetest.get_modpath("dye") then if core.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 for mat, dye in pairs(bonemeal_dyes) do
minetest.register_craft({ core.register_craft({
output = "dye:" .. dye .. " 4", output = "dye:" .. dye .. " 4",
recipe = { recipe = {
{"bonemeal:" .. mat} {"bonemeal:" .. mat}
@ -196,38 +315,53 @@ if minetest.get_modpath("dye") then
end end
end end
-- df_trees saplings
if minetest.get_modpath("df_trees") then if core.get_modpath("df_trees") then
local function spore_tree_fix(pos) local function spore_tree_fix(pos)
minetest.set_node(pos, {name = "air"}) core.remove_node(pos) ; df_trees.spawn_spore_tree(pos)
df_trees.spawn_spore_tree(pos)
end end
local function fungiwood_fix(pos) local function fungiwood_fix(pos)
minetest.set_node(pos, {name = "air"}) core.remove_node(pos) ; df_trees.spawn_fungiwood(pos)
df_trees.spawn_fungiwood(pos)
end end
local function tunnel_fix(pos) local function tunnel_fix(pos)
minetest.set_node(pos, {name = "air"}) core.remove_node(pos) ; df_trees.spawn_tunnel_tube(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 end
bonemeal:add_sapling({ bonemeal:add_sapling({
{"df_trees:black_cap_sapling", df_trees.spawn_black_cap, "soil", true}, {"df_trees:black_cap_sapling", black_cap_fix, "soil", true},
{"df_trees:fungiwood_sapling", fungiwood_fix, "soil", true}, {"df_trees:fungiwood_sapling", fungiwood_fix, "soil", true},
{"df_trees:goblin_cap_sapling", df_trees.spawn_goblin_cap, "soil", true}, {"df_trees:goblin_cap_sapling", goblin_cap_fix, "soil", true},
{"df_trees:spore_tree_sapling", spore_tree_fix, "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:tower_cap_sapling", tower_cap_fix, "soil", true},
{"df_trees:tunnel_tube_sapling", tunnel_fix, "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", nether_cap_fix, "group:nether_cap", true},
{"df_trees:nether_cap_sapling", df_trees.spawn_nether_cap, "group:cools_lava", true} {"df_trees:nether_cap_sapling", nether_cap_fix, "group:cools_lava", true}
}) })
end end
-- df_farming crops
if minetest.get_modpath("df_farming") then if core.get_modpath("df_farming") then
bonemeal:add_crop({ bonemeal:add_crop({
{"df_farming:cave_wheat_", 8, "df_farming:cave_wheat_seed", true}, {"df_farming:cave_wheat_", 8, "df_farming:cave_wheat_seed", true},
@ -239,24 +373,25 @@ if minetest.get_modpath("df_farming") then
}) })
end end
-- df_primordial saplings and plants
if minetest.get_modpath("df_primordial_items") then if core.get_modpath("df_primordial_items") then
local function mush_fix(pos) local function mush_fix(pos)
minetest.set_node(pos, {name = "air"}) core.set_node(pos, {name = "air"})
mapgen_helper.place_schematic(pos, mapgen_helper.place_schematic(pos,
df_primordial_items.get_primordial_mushroom(), (math.random(4) - 1) * 90) df_primordial_items.get_primordial_mushroom(), (math.random(4) - 1) * 90)
end end
local function fern_fix(pos) local function fern_fix(pos)
minetest.set_node(pos, {name = "air"}) core.set_node(pos, {name = "air"})
local rotations = {0, 90, 180, 270} local rotations = {0, 90, 180, 270}
mapgen_helper.place_schematic(pos, mapgen_helper.place_schematic(pos,
df_primordial_items.get_fern_schematic(), rotations[math.random(#rotations)]) df_primordial_items.get_fern_schematic(), rotations[math.random(#rotations)])
end end
local function blood_fix(pos) local function blood_fix(pos)
df_trees.grow_blood_thorn(pos, minetest.get_node(pos)) df_trees.grow_blood_thorn(pos, core.get_node(pos))
end end
bonemeal:add_sapling({ bonemeal:add_sapling({
@ -308,8 +443,9 @@ if minetest.get_modpath("df_primordial_items") then
}) })
end end
-- everness saplings
if minetest.get_modpath("everness") then if core.get_modpath("everness") then
bonemeal:add_sapling({ bonemeal:add_sapling({
{"everness:baobab_sapling", Everness.grow_baobab_tree, "soil"}, {"everness:baobab_sapling", Everness.grow_baobab_tree, "soil"},
@ -326,3 +462,23 @@ if minetest.get_modpath("everness") then
{"everness:willow_tree_sapling", Everness.grow_willow_tree, "soil"} {"everness:willow_tree_sapling", Everness.grow_willow_tree, "soil"}
}) })
end 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