mirror of
https://codeberg.org/tenplus1/bonemeal.git
synced 2025-05-07 03:30:32 +02:00
tidy and tweak code
This commit is contained in:
parent
c2d76b779d
commit
81f36673d3
139
init.lua
139
init.lua
@ -1,47 +1,42 @@
|
|||||||
|
|
||||||
|
-- MineClonia / VoxeLibre check
|
||||||
|
|
||||||
|
local mcl = minetest.get_modpath("mcl_core")
|
||||||
|
|
||||||
|
-- global
|
||||||
|
|
||||||
bonemeal = {
|
bonemeal = {
|
||||||
item_list = {
|
item_list = {
|
||||||
bucket_water = "bucket:bucket_water",
|
bucket_water = mcl and "mcl_buckets:bucket_water" or "bucket:bucket_water",
|
||||||
bucket_empty = "bucket:bucket_empty",
|
bucket_empty = mcl and "mcl_buckets:bucker_empty" or "bucket:bucket_empty",
|
||||||
dirt = "default:dirt",
|
dirt = mcl and "mcl_core:dirt" or "default:dirt",
|
||||||
torch = "default:torch",
|
torch = mcl and "mcl_torches:torch" or "default:torch",
|
||||||
coral = "default:coral_skeleton"
|
coral = mcl and "mcl_ocean:dead_horn_coral_block" or "default:coral_skeleton"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
-- translation support and vars
|
||||||
|
|
||||||
|
local S = minetest.get_translator("bonemeal")
|
||||||
local a = bonemeal.item_list
|
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 path = minetest.get_modpath("bonemeal")
|
||||||
local min, max, random = math.min, math.max, math.random
|
local min, max, random = math.min, math.max, math.random
|
||||||
|
|
||||||
-- translation support
|
-- creative check helper
|
||||||
local S = minetest.get_translator("bonemeal")
|
|
||||||
|
|
||||||
-- creative check
|
|
||||||
local creative_mode_cache = minetest.settings:get_bool("creative_mode")
|
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 minetest.check_player_privs(name, {creative = true})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- API tables
|
||||||
|
|
||||||
local crops = {}
|
local crops = {}
|
||||||
local saplings = {}
|
local saplings = {}
|
||||||
local deco = {}
|
local deco = {}
|
||||||
|
|
||||||
--
|
-- particle effect
|
||||||
-- local functions
|
|
||||||
--
|
|
||||||
|
|
||||||
-- particles
|
|
||||||
local function particle_effect(pos)
|
local function particle_effect(pos)
|
||||||
|
|
||||||
minetest.add_particlespawner({
|
minetest.add_particlespawner({
|
||||||
@ -62,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
|
|
||||||
minetest.remove_node(pos)
|
minetest.remove_node(pos)
|
||||||
minetest.spawn_tree(pos, object)
|
minetest.spawn_tree(pos, object) -- grow L-system tree
|
||||||
|
|
||||||
elseif type(object) == "string" and minetest.registered_nodes[object] then
|
elseif type(object) == "string" and minetest.registered_nodes[object] then
|
||||||
|
|
||||||
-- place node
|
minetest.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, strength, 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 = minetest.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
|
||||||
|
|
||||||
@ -138,8 +126,8 @@ local function check_sapling(pos, sapling_node, strength, 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
|
||||||
@ -189,8 +177,8 @@ local function check_crops(pos, nodename, strength, light_ok)
|
|||||||
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
|
||||||
@ -265,14 +253,12 @@ local function check_soil(pos, nodename, strength)
|
|||||||
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
|
||||||
@ -281,9 +267,7 @@ local function use_checks(user, pointed_thing)
|
|||||||
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
|
||||||
@ -298,9 +282,7 @@ local function use_checks(user, pointed_thing)
|
|||||||
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:"}
|
||||||
@ -313,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
|
||||||
@ -324,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
|
||||||
@ -347,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
|
||||||
@ -366,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
|
||||||
@ -377,8 +357,7 @@ function bonemeal:add_deco(list)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
list[l] = false
|
list[l] = false ; break
|
||||||
break
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -388,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
|
||||||
@ -415,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 minetest.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
|
||||||
@ -437,25 +414,19 @@ 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
|
elseif node.name == "default:dry_dirt" and strength == 1 then
|
||||||
|
|
||||||
minetest.set_node(pos, {name = "default:dry_dirt_with_dry_grass"})
|
minetest.set_node(pos, {name = "default:dry_dirt_with_dry_grass"})
|
||||||
|
|
||||||
particle_effect(pos)
|
particle_effect(pos) ; return true
|
||||||
|
|
||||||
return true
|
|
||||||
end
|
end
|
||||||
|
|
||||||
-- grow grass and flowers
|
-- grow grass and flowers
|
||||||
@ -486,13 +457,10 @@ function bonemeal:on_use(pos, strength, node)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--= Items
|
||||||
--
|
|
||||||
-- items
|
|
||||||
--
|
|
||||||
|
|
||||||
|
|
||||||
-- mulch (strength 1)
|
-- mulch (strength 1)
|
||||||
|
|
||||||
minetest.register_craftitem("bonemeal:mulch", {
|
minetest.register_craftitem("bonemeal:mulch", {
|
||||||
description = S("Mulch"),
|
description = S("Mulch"),
|
||||||
inventory_image = "bonemeal_mulch.png",
|
inventory_image = "bonemeal_mulch.png",
|
||||||
@ -517,8 +485,8 @@ minetest.register_craftitem("bonemeal:mulch", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-- bonemeal (strength 2)
|
-- bonemeal (strength 2)
|
||||||
|
|
||||||
minetest.register_craftitem("bonemeal:bonemeal", {
|
minetest.register_craftitem("bonemeal:bonemeal", {
|
||||||
description = S("Bone Meal"),
|
description = S("Bone Meal"),
|
||||||
inventory_image = "bonemeal_item.png",
|
inventory_image = "bonemeal_item.png",
|
||||||
@ -543,8 +511,8 @@ minetest.register_craftitem("bonemeal:bonemeal", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-- fertiliser (strength 3)
|
-- fertiliser (strength 3)
|
||||||
|
|
||||||
minetest.register_craftitem("bonemeal:fertiliser", {
|
minetest.register_craftitem("bonemeal:fertiliser", {
|
||||||
description = S("Fertiliser"),
|
description = S("Fertiliser"),
|
||||||
inventory_image = "bonemeal_fertiliser.png",
|
inventory_image = "bonemeal_fertiliser.png",
|
||||||
@ -569,8 +537,8 @@ minetest.register_craftitem("bonemeal:fertiliser", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
-- bone
|
-- bone
|
||||||
|
|
||||||
minetest.register_craftitem("bonemeal:bone", {
|
minetest.register_craftitem("bonemeal:bone", {
|
||||||
description = S("Bone"),
|
description = S("Bone"),
|
||||||
inventory_image = "bonemeal_bone.png",
|
inventory_image = "bonemeal_bone.png",
|
||||||
@ -578,18 +546,17 @@ minetest.register_craftitem("bonemeal:bone", {
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- gelatin powder
|
-- gelatin powder
|
||||||
|
|
||||||
minetest.register_craftitem("bonemeal:gelatin_powder", {
|
minetest.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({
|
minetest.register_craft({
|
||||||
output = "bonemeal:gelatin_powder 4",
|
output = "bonemeal:gelatin_powder 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -603,6 +570,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- bonemeal (from bone)
|
-- bonemeal (from bone)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
type = "cooking",
|
type = "cooking",
|
||||||
output = "bonemeal:bonemeal 2",
|
output = "bonemeal:bonemeal 2",
|
||||||
@ -611,6 +579,7 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- bonemeal (from player bones)
|
-- bonemeal (from player bones)
|
||||||
|
|
||||||
if minetest.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
|
if minetest.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -620,12 +589,14 @@ if minetest.settings:get_bool("bonemeal.disable_deathbones_recipe") ~= true then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- bonemeal (from coral skeleton)
|
-- bonemeal (from coral skeleton)
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "bonemeal:bonemeal 2",
|
output = "bonemeal:bonemeal 2",
|
||||||
recipe = {{a.coral}}
|
recipe = {{a.coral}}
|
||||||
})
|
})
|
||||||
|
|
||||||
-- mulch
|
-- mulch
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
output = "bonemeal:mulch 4",
|
output = "bonemeal:mulch 4",
|
||||||
recipe = {
|
recipe = {
|
||||||
@ -645,12 +616,14 @@ minetest.register_craft({
|
|||||||
})
|
})
|
||||||
|
|
||||||
-- fertiliser
|
-- fertiliser
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.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
|
||||||
|
|
||||||
if minetest.registered_items[a.dirt] then
|
if minetest.registered_items[a.dirt] then
|
||||||
|
|
||||||
minetest.override_item(a.dirt, {
|
minetest.override_item(a.dirt, {
|
||||||
@ -670,9 +643,11 @@ if minetest.registered_items[a.dirt] then
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- add support for mods
|
-- add support for mods
|
||||||
|
|
||||||
dofile(path .. "/mods.lua")
|
dofile(path .. "/mods.lua")
|
||||||
|
|
||||||
-- lucky block support
|
-- lucky block support
|
||||||
|
|
||||||
if minetest.get_modpath("lucky_block") then
|
if minetest.get_modpath("lucky_block") then
|
||||||
dofile(path .. "/lucky_block.lua")
|
dofile(path .. "/lucky_block.lua")
|
||||||
end
|
end
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
-- add lucky blocks
|
-- helper function
|
||||||
|
|
||||||
local function growy(pos, player)
|
local function growy(pos, player)
|
||||||
|
|
||||||
@ -10,6 +10,7 @@ local function growy(pos, player)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- add lucky blocks
|
||||||
|
|
||||||
lucky_block:add_blocks({
|
lucky_block:add_blocks({
|
||||||
{"lig"},
|
{"lig"},
|
||||||
|
35
mods.lua
35
mods.lua
@ -1,5 +1,6 @@
|
|||||||
|
|
||||||
-- craft bones from animalmaterials into bonemeal
|
-- craft bones from animalmaterials into bonemeal
|
||||||
|
|
||||||
if minetest.get_modpath("animalmaterials") then
|
if minetest.get_modpath("animalmaterials") then
|
||||||
|
|
||||||
minetest.register_craft({
|
minetest.register_craft({
|
||||||
@ -8,6 +9,7 @@ if minetest.get_modpath("animalmaterials") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- default additions
|
||||||
|
|
||||||
if minetest.get_modpath("default") then
|
if minetest.get_modpath("default") then
|
||||||
|
|
||||||
@ -62,6 +64,7 @@ if minetest.get_modpath("default") then
|
|||||||
|
|
||||||
local flowers = {}
|
local flowers = {}
|
||||||
|
|
||||||
|
-- add flowers from other mods
|
||||||
minetest.after(0.1, function()
|
minetest.after(0.1, function()
|
||||||
|
|
||||||
for node, def in pairs(minetest.registered_nodes) do
|
for node, def in pairs(minetest.registered_nodes) do
|
||||||
@ -92,6 +95,7 @@ if minetest.get_modpath("default") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- default farming crops
|
||||||
|
|
||||||
if farming then
|
if farming then
|
||||||
|
|
||||||
@ -101,6 +105,7 @@ if farming then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- farming redo crops
|
||||||
|
|
||||||
if farming and farming.mod and farming.mod == "redo" then
|
if farming and farming.mod and farming.mod == "redo" then
|
||||||
|
|
||||||
@ -148,6 +153,7 @@ if farming and farming.mod and farming.mod == "redo" then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ethereal crops, saplings and grass
|
||||||
|
|
||||||
if minetest.get_modpath("ethereal") then
|
if minetest.get_modpath("ethereal") then
|
||||||
|
|
||||||
@ -195,6 +201,7 @@ if minetest.get_modpath("ethereal") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- moretrees saplings
|
||||||
|
|
||||||
if minetest.get_modpath("moretrees") then
|
if minetest.get_modpath("moretrees") then
|
||||||
|
|
||||||
@ -228,14 +235,18 @@ 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 minetest.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 minetest.get_modpath("caverealms") then
|
||||||
|
|
||||||
@ -253,6 +264,9 @@ if minetest.get_modpath("caverealms") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- ferns
|
||||||
|
|
||||||
|
if minetest.get_modpath("ferns") then
|
||||||
|
|
||||||
local function y_func(grow_func)
|
local function y_func(grow_func)
|
||||||
return function(pos)
|
return function(pos)
|
||||||
@ -260,15 +274,18 @@ local function y_func(grow_func)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if minetest.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
|
||||||
|
|
||||||
|
-- dryplants sapling
|
||||||
|
|
||||||
if minetest.get_modpath("dryplants") then
|
if minetest.get_modpath("dryplants") then
|
||||||
|
|
||||||
bonemeal:add_sapling({
|
bonemeal:add_sapling({
|
||||||
@ -276,6 +293,7 @@ if minetest.get_modpath("dryplants") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- add bonemeal dyes
|
||||||
|
|
||||||
if minetest.get_modpath("dye") then
|
if minetest.get_modpath("dye") then
|
||||||
|
|
||||||
@ -292,6 +310,7 @@ if minetest.get_modpath("dye") then
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- df_trees saplings
|
||||||
|
|
||||||
if minetest.get_modpath("df_trees") then
|
if minetest.get_modpath("df_trees") then
|
||||||
|
|
||||||
@ -335,6 +354,7 @@ if minetest.get_modpath("df_trees") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- df_farming crops
|
||||||
|
|
||||||
if minetest.get_modpath("df_farming") then
|
if minetest.get_modpath("df_farming") then
|
||||||
|
|
||||||
@ -348,6 +368,7 @@ if minetest.get_modpath("df_farming") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- df_primordial saplings and plants
|
||||||
|
|
||||||
if minetest.get_modpath("df_primordial_items") then
|
if minetest.get_modpath("df_primordial_items") then
|
||||||
|
|
||||||
@ -417,6 +438,7 @@ if minetest.get_modpath("df_primordial_items") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- everness saplings
|
||||||
|
|
||||||
if minetest.get_modpath("everness") then
|
if minetest.get_modpath("everness") then
|
||||||
|
|
||||||
@ -436,6 +458,7 @@ if minetest.get_modpath("everness") then
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
|
-- bush classic fruit
|
||||||
|
|
||||||
if minetest.get_modpath("bushes_classic") then
|
if minetest.get_modpath("bushes_classic") then
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user