nssf+nsspf - mod add to provide good fungies and fruits biomes

master
mckaygerhard 2023-06-18 12:21:55 -04:00
parent 4d4cdfe05d
commit 1bad13334f
99 changed files with 2575 additions and 0 deletions

View File

@ -51,6 +51,7 @@ To download you can play this game with the following minetest engines:
* sfinv_home as `sfinv` we already integrated the `sfinv_home` mod into the default `sfinv` mod
* NPXcoot
* nssf as `nssf` [mods/nssf](mods/nssf) from https://git.minetest.io/minenux/minetest-mod-nssf
* nsspf as `nsspf` [mods/nsspf](mods/nsspf) from https://git.minetest.io/minenux/minetest-mod-nsspf
* armors and stuff mods
* 3d_armor and shields [mods/3d_armor](mods/3d_armor) https://codeberg.org/minenux/minetest-mod-3d_armor
* player stuffs:

1
mods/nssm Symbolic link
View File

@ -0,0 +1 @@
/home/general/Minetest/tenplus1-nssm

2
mods/nsspf/License.txt Normal file
View File

@ -0,0 +1,2 @@
License for the code: LGPLv2.1 or later
License for all the models, textures and sound: CC BY-SA 4.0

177
mods/nsspf/README.md Normal file
View File

@ -0,0 +1,177 @@
Not So Simple Plants and Fungi
==============================
NSSPF mod that adds wild plants (fungies)
Information
------------
A mod that adds wild plants and fungi in order to give another
source of food without farming, but with possible dangerous if you
dont take care of thems. For now there are only 29 fungi and no plants.
You just have to walk around in the different biomes and gather the fungi.
All the fungi are taken from the real world and thay have their scientific names. Many of them are good to eat, but others can be lethal.
![](screenshot.png)
## Technical info
-----------------
There are 5 types of fungi:
* Ectomycorrhizal fungi: grows in association with the roots of trees, the mycelium grows in the ground and sometimes a mushroom will grow.
* There are also truffles, hard to find (truffles are produced underground)
* Saprobiontic fungi: divided in 4 categories distiguished by where they grow
* Jungle fungi grow on trees trunks in the jungle.
* Grass fungi grow as mycelium underground in grassland and sometimes produce a mushroom on the surface.
* Snowbank fungi act as grass fungi but under the snow.
* Tree fungi as jungle fungi grow on trees trunks of trees and pine trees.
For more information **check specific node list in the [nodes](#nodes) section**
below.
It is possible to farm the fungi with the spores. Exposed to air mycelium will
die and the dirt left may contain spores, dropped when digged.
For saprobiontic is necessary to click with the spores the ground (`dirt_with_grass` or `dirt_with_snow`)
to grow a new mycelium under the node. Ectomycorrhizal fungi spores need to
placed on the bottom of the right trunk of a tree, each fungus need a
specific tree.
Many mushrooms are hard to digest so it is better to cook them before eating,
in order to appreciate their nutritional value fully. Cooking could also
inactivate the toxin in poisonous fungi (only in some of them obviously!).
In other cases cooking may damage the beneficial propreties of the mushrooms
reducing their nutritional value.
#### Dependencies
* default
* nssm (optional)
* tnt (optional)
#### ABMs
Fungi are generated by ABM, so their growth will require some time.
This mod originally was made using many ABMs so may cause lag in low end devices.
#### Nodes
| node | Description | fuel | cooked |
| ------------------------------------ | ------------------------------ | ---- | ------------------ |
| nsspf:amadou | Amadou | yes | |
| nsspf:lasting_amadou | Lasting Amadou | yes | |
| nsspf:long_lasting_amadou | Long Lasting Amadou | yes | |
| nsspf:boletus_edulis | Boletus edulis | yes | yes |
| nsspf:cooked_boletus_edulis | Cooked Boletus edulis | | yes |
| nsspf:boletus_edulis_fungusdirt | Boletus edulis Dirt | | |
| nsspf:cantharellus_cibarius | Cantharellus cibarius | yes | yes |
| nsspf:cooked_cantharellus_cibarius | Cooked Cantharellus cibarius | | |
| nsspf:cantharellus_cibarius_fungusdirt | Cantharellus cibarius Dirt | | |
| nsspf:suillus_grevillei | Suillus grevillei | yes | yes |
| nsspf:cooked_suillus_grevillei | Cooked Suillus grevillei | | |
| nsspf:suillus_grevillei_fungusdirt | Suillus grevillei Dirt | | |
| nsspf:morchella_conica | Morchella conica | yes | yes |
| nsspf:cooked_morchella_conica | Cooked Morchella conica | | |
| nsspf:morchella_conica_fungusdirt | Morchella conica Dirt | | |
| nsspf:russula_xerampelina | Russula xerampelina | yes | yes |
| nsspf:cooked_russula_xerampelina | Cooked Russula xerampelina | | |
| nsspf:russula_xerampelina_fungusdirt | Russula xerampelina Dirt | | |
| nsspf:boletus_pinophilus | Boletus pinophilus | yes | yes |
| nsspf:cooked_boletus_pinophilus | Cooked Boletus pinophilus | | |
| nsspf:boletus_pinophilus_fungusdirt | Boletus pinophilus Dirt | | |
| nsspf:boletus_satanas | Boletus satanas | yes | yes |
| nsspf:cooked_boletus_satanas | Cooked Boletus satanas | | |
| nsspf:boletus_satanas_fungusdirt | Boletus satanas Dirt | | |
| nsspf:amanita_phalloides | Amanita phalloides | | yes |
| nsspf:cooked_amanita_phalloides | Cooked Amanita phalloides | | |
| nsspf:amanita_muscaria_fungusdirt | Amanita muscaria Dirt | | |
| nsspf:amanita_muscaria | Amanita muscaria | yes | yes |
| nsspf:cooked_amanita_muscaria | Cooked Amanita muscaria | | |
| nsspf:amanita_phalloides_fungusdirt | Amanita phalloides Dirt | | |
| nsspf:tuber_melanosporum_fungusdirt | Tuber melanosporum Dirt | | |
| nsspf:tuber_magnatum_pico_fungusdirt | Tuber magnatum pico Dirt | | |
| nsspf:tuber_borchii_fungusdirt | Tuber borchii Dirt | | |
| nsspf:terfezia_arenaria_fungusdirt | Terfezia arenaria Dirt | | |
| nsspf:fistulina_hepatica | Fistulina hepatica | yes | yes |
| nsspf:cooked_fistulina_hepatica | Cooked Fistulina hepatica | | |
| nsspf:armillaria_mellea | Armillaria mellea | yes | yes |
| nsspf:cooked_armillaria_mellea | Cooked Armillaria mellea | | |
| nsspf:fomes_fomentarius | Fomes fomentarius | | |
| nsspf:mycena_chlorophos | Mycena chlorophos | yes | yes |
| nsspf:cooked_mycena_chlorophos | Cooked Mycena chlorophos | | |
| nsspf:mycena_chlorophos_light | Nocturn Mycena chlorophos | | |
| nsspf:panellus_pusillus | Panellus pusillus | yes | yes |
| nsspf:cooked_panellus_pusillus | Cooked Panellus pusillus | | |
| nsspf:panellus_pusillus_light | Nocturn Panellus pusillus | | |
| nsspf:macrolepiota_procera | Macrolepiota procera | | yes |
| nsspf:cooked_macrolepiota_procera | Cooked Macrolepiota procera | | |
| nsspf:macrolepiota_procera_fungusdirt | Macrolepiota procera Dirt | yes | |
| nsspf:psilocybe_cubensis | Psilocybe cubensis | yes | |
| nsspf:cooked_psilocybe_cubensis | Cooked Psilocybe cubensis | | |
| nsspf:psilocybe_cubensis_fungusdirt | Psilocybe cubensis Dirt | | |
| nsspf:lycoperdon_pyriforme | Lycoperdon pyriforme | yes | yes |
| nsspf:cooked_lycoperdon_pyriforme | Cooked Lycoperdon pyriforme | | |
| nsspf:lycoperdon_pyriforme_fungusdirt | Lycoperdon pyriforme Dirt | | |
| nsspf:gyromitra_esculenta | Gyromitra esculenta | yes | yes |
| nsspf:cooked_gyromitra_esculenta | Cooked Gyromitra esculenta | | |
| nsspf:gyromitra_esculenta_fungusdirt | Gyromitra esculenta Dirt | | |
| nsspf:coprinus_atramentarius | Coprinus atramentarius | | yes |
| nsspf:cooked_coprinus_atramentarius | Cooked Coprinus atramentarius | | |
| nsspf:coprinus_atramentarius_fungusdirt | Coprinus atramentarius Dirt | | |
| nsspf:lentinus_strigosus | Lentinus strigosus | yes | yes |
| nsspf:cooked_lentinus_strigosus | Cooked Lentinus strigosus | | |
| nsspf:ganoderma_lucidum | Ganoderma lucidum | yes | yes |
| nsspf:cooked_ganoderma_lucidum | Cooked Ganoderma lucidum | | |
| nsspf:marasmius_haematocephalus | Marasmius haematocephalus | yes | yes |
| nsspf:cooked_marasmius_haematocephalus | Cooked Marasmius haematocephalus | | |
| nsspf:clitocybula_azurea | Clitocybula_azurea | yes | yes |
| nsspf:cooked_clitocybula_azurea | Cooked Clitocybula_azurea | | |
| nsspf:clitocybe_glacialis | Clitocybe glacialis | yes | yes |
| nsspf:cooked_clitocybe_glacialis | Cooked Clitocybe glacialis | | |
| nsspf:clitocybe_glacialis_fungusdirt | Clitocybe glacialis Dirt | | |
| nsspf:hygrophorus_goetzii | Hygrophorus goetzii | yes | yes |
| nsspf:cooked_hygrophorus_goetzii | Cooked Hygrophorus goetzii | | |
| nsspf:hygrophorus_goetzii_fungusdirt | Hygrophorus goetzii Dirt | | |
| nsspf:plectania_nannfeldtii | Plectania nannfeldtii | yes | yes |
| nsspf:cooked_plectania_nannfeldtii | Cooked Plectania nannfeldtii | | |
| nsspf:plectania_nannfeldtii_fungusdirt | Plectania nannfeldtii Dirt | | |
#### Crafts
nsspf:amadou
```
{'nsspf:fomes_fomentarius'}
```
nsspf:long_lasting_amadou',
```
{'nssm:black_powder', 'nsspf:amadou'
```
nsspf:lasting_amadou',
```
{'tnt:gunpowder', 'nsspf:amadou'},
```
#### Original information
https://forum.minetest.net/viewtopic.php?t=16345
## License:
(c) 2014-2016 NPXcoot
* LGPLv3 for the code
* CC BY-SA 4.0 for the models and textures
(c) 2023 mckaygerhard
* CC BY-SA NC 4.0 for additions, code fixed and improvements

3
mods/nsspf/depends.txt Normal file
View File

@ -0,0 +1,3 @@
default
nssm?
tnt?

View File

@ -0,0 +1 @@
NSSPF mod that adds wild plants (fungies)

15
mods/nsspf/init.lua Normal file
View File

@ -0,0 +1,15 @@
nsspf = {}
local mod = nsspf
mod.version = '20230616'
mod.mod_name = minetest.get_current_modname()
mod.path = minetest.get_modpath(mod.mod_name)
mod.world = minetest.get_worldpath()
mod.nssm = minetest.get_modpath("nssm")
mod.tnt = minetest.get_modpath("tnt")
mod.dat = {}
dofile(mod.path.."/mushrooms.lua")
dofile(mod.path.."/spawn.lua")
print("[MOD] loaded nsspf")

4
mods/nsspf/mod.conf Normal file
View File

@ -0,0 +1,4 @@
name = nsspf
depends = default
optional_depends = nssm, tnt
description = NSSPF mod that adds wild plants (fungies)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

1733
mods/nsspf/mushrooms.lua Normal file

File diff suppressed because it is too large Load Diff

BIN
mods/nsspf/screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 284 KiB

638
mods/nsspf/spawn.lua Normal file
View File

@ -0,0 +1,638 @@
function place_spore(itemstack, placer, pointed_thing, name, topoint, soilblock)
local pt = pointed_thing
-- check if pointing at a node
if not pt or pt.type ~= "node" then
return
end
local under = minetest.get_node(pt.under)
local uu = {x=pt.under.x, y=pt.under.y-1, z=pt.under.z}
-- return if any of the nodes is not registered
if not minetest.registered_nodes[under.name] then
return
end
-- if not protected then add node and remove 1 item from the itemstack
if not minetest.is_protected(pt.under, placer:get_player_name()) then
if (under.name == topoint) and (minetest.get_node(uu).name == soilblock) then
minetest.set_node(uu, {name = name})
minetest.sound_play("default_place_node", {pos = uu, gain = 1.0})
if not minetest.setting_getbool("creative_mode") then
itemstack:take_item()
end
return itemstack
end
end
end
function nsspf_register_mycorrhizalmycelium (name, descr, tree, int, ch, spread)
minetest.register_node("nsspf:"..name.."_mycelium", {
description = descr,
tiles = {"mycorrhizalmycelium.png"},
groups = {crumbly = 2, not_in_creative_inventory =1},
})
minetest.register_craftitem("nsspf:"..name.."_spores", {
description = descr.." Spores",
image = "spores.png",
on_place = function(itemstack, placer, pointed_thing)
return place_spore(itemstack, placer, pointed_thing, "nsspf:"..name.."_mycelium",tree, "default:dirt")
end,
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {tree},
interval = 30*int,
chance = 200*ch,
action = function(pos, node)
local flag = 0
for dx = -2,2 do
for dy = -2,1 do
for dz = -2,2 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = 1
return
end
end
end
end
--if no other mycelium have been found:
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"air","default:water_source"},
interval = 1,
chance = 1,
action = function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300)
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_snow"},
interval = 1,
chance = 1,
action = function(pos, node)
minetest.set_node(pos, {name="default:dirt"})
end
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_mycelium"},
interval = 12*int,
chance = 10*ch,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_grass"},
interval = 5*int,
chance = 1*ch,
action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+2, z=pos.z}
local pos2 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.get_node(pos1).name
local nn = minetest.get_node(pos2).name
if (n== "air" or n=="group:flora") and nn== "default:dirt_with_grass" then
minetest.set_node(pos1, {name = "nsspf:"..name})
minetest.get_node_timer(pos1):start(300)
end
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"nsspf:"..name.."_mycelium"},
interval = 10,
chance = 1,
action = function(pos, node)
local flag = 0
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1
end
end
end
end
if flag > spread then
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then
minetest.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300)
end
end
end
end
end
end
})
end
nsspf_register_mycorrhizalmycelium ('amanita_muscaria','Amanita muscaria Mycelium', "default:pine_tree", 10, 10, 8)
nsspf_register_mycorrhizalmycelium ('amanita_phalloides','Amanita phalloides Mycelium', "default:pine_tree", 16, 12, 8)
nsspf_register_mycorrhizalmycelium ('boletus_edulis','Boletus edulis Mycelium', "default:tree", 10, 10, 8)
nsspf_register_mycorrhizalmycelium ('boletus_satanas','Boletus satanas Mycelium', "default:tree", 12, 12, 8)
nsspf_register_mycorrhizalmycelium ('boletus_pinophilus','Boletus pinophilus Mycelium', "default:pine_tree", 12, 12, 8)
nsspf_register_mycorrhizalmycelium ('suillus_grevillei','Suillus grevillei Mycelium','default:pine_tree', 8, 8, 12)
nsspf_register_mycorrhizalmycelium ('russula_xerampelina','Russula xerampelina Mycelium', "default:pine_tree", 9, 9, 12)
nsspf_register_mycorrhizalmycelium ('cantharellus_cibarius','Cantherellus cibarius Mycelium', "default:pine_tree", 8, 8, 14)
nsspf_register_mycorrhizalmycelium ('morchella_conica','Morchella conica Mycelium', "default:aspen_tree", 10, 10, 8)
--tuber
function nsspf_register_tuber (name, descr, tree, int, ch, gnam, spread)
minetest.register_node("nsspf:"..name.."_tuber_mycelium", {
description = descr,
tiles = {"tuber_mycelium.png"},
groups = {crumbly = 2, not_in_creative_inventory =1},
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {tree},
interval = 30*int,
chance = 300*ch,
action = function(pos, node)
local flag = 0
for dx = -2,2 do
for dy = -2,1 do
for dz = -2,2 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = 1
return
end
end
end
end
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_tuber_mycelium"})
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_tuber_mycelium"},
neighbors = {"air","default:water_source"},
interval = 1,
chance = 1,
action =
function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300)
end
})
minetest.register_node("nsspf:"..name.."_fruit", {
description = descr.." Truffle",
tiles = {"default_dirt.png"},
drop = "nsspf:"..name,
groups = {crumbly = 3, not_in_creative_inventory =1},
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_tuber_mycelium"},
interval = 12*int,
chance = 6*ch,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_tuber_mycelium"})
end
})
minetest.register_craftitem("nsspf:"..name, {
description = descr,
on_use = minetest.item_eat(gnam),
image = name..".png",
})
minetest.register_craftitem("nsspf:"..name.."_spores", {
description = descr.." Spores",
image = "spores.png",
on_place = function(itemstack, placer, pointed_thing)
return place_spore(itemstack, placer, pointed_thing, "nsspf:"..name.."_tuber_mycelium",tree, "default:dirt")
end,
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_tuber_mycelium"},
interval = 12*int,
chance = 8*ch,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_fruit"})
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_tuber_mycelium"},
neighbors = {"nsspf:"..name.."_tuber_mycelium"},
interval = 10,
chance = 1,
action = function(pos, node)
local flag = 0
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1
end
end
end
end
if flag > spread then
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then
minetest.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300)
end
end
end
end
end
end
})
end
nsspf_register_tuber ("tuber_magnatum_pico","Tuber magnatum pico","default:tree", 14, 14, 20, 20)
nsspf_register_tuber ("tuber_melanosporum","Tuber melanosporum","default:tree", 12, 12, 16, 20)
nsspf_register_tuber ("tuber_borchii","Tuber borchii","default:aspen_tree", 10, 10, 12, 20)
nsspf_register_tuber ("terfezia_arenaria","Terfezia arenaria","default:acacia_tree", 11, 11, 12, 20)
function nssbf_register_saprotrophicontrees (name, descr, tree, int, ch)
minetest.register_abm({
nodenames = {tree},
neighbors = {"air"},
interval = 20*int,
chance = 40*ch,
action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y, z=pos.z-1}
local n = minetest.get_node(pos1).name
if n == 'air' then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z-1}, {name = "nsspf:"..name})
minetest.get_node_timer(pos):start(300)
end
end
})
end
nssbf_register_saprotrophicontrees ('armillaria_mellea', 'Armillaria mellea', 'default:tree', 16, 24)
nssbf_register_saprotrophicontrees ('panellus_pusillus', 'Panellus pusillus', 'default:tree', 23, 37)
nssbf_register_saprotrophicontrees ('fomes_fomentarius', 'Fomes fomentarius', 'default:aspen_tree', 13, 18)
nssbf_register_saprotrophicontrees ('fistulina_hepatica', 'Fistulina hepatica', 'default:pine_tree', 16, 24)
nssbf_register_saprotrophicontrees ('mycena_chlorophos', 'Mycena clorophos', 'default:dirt', 30, 43)
nssbf_register_saprotrophicontrees ('clitocybula_azurea', 'Clitocybula azurea', 'default:jungletree', 12, 28)
nssbf_register_saprotrophicontrees ('ganoderma_lucidum', 'Ganoderma lucidum', 'default:jungletree', 14, 28)
local OPEN_TIME_START = 0.2
local OPEN_TIME_END = 0.8
local OPEN_CHECK = 10
set_fluo = function (pos)
if (minetest.get_node_light(pos, nil) < 10) and ((minetest.get_timeofday() < 19500) or (minetest.get_timeofday() > 5000)) then
minetest.add_node(pos, { name = "nsspf:mycena_chlorophos_light" })
else
minetest.add_node(pos, { name = "nsspf:mycena_chlorophos" })
end
end
minetest.register_abm({
nodenames = { "nsspf:mycena_chlorophos", "nsspf:mycena_chlorophos_light"},
interval = OPEN_CHECK,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
set_fluo(pos)
end
})
set_fluor = function (pos)
if (minetest.get_node_light(pos, nil) < 10) and ((minetest.get_timeofday() < 19500) or (minetest.get_timeofday() > 5000)) then
minetest.env:add_node(pos, { name = "nsspf:panellus_pusillus_light" })
else
minetest.env:add_node(pos, { name = "nsspf:panellus_pusillus" })
end
end
minetest.register_abm({
nodenames = { "nsspf:panellus_pusillus", "nsspf:panellus_pusillus_light" },
interval = OPEN_CHECK,
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
set_fluor(pos)
end
})
--Saprotrophic fungi that grow on the ground
function nsspf_register_saprotrophicground (name, descr, int, ch, spread)
minetest.register_node("nsspf:"..name.."_mycelium", {
description = descr,
tiles = {"saprotrophic_mycelium.png"},
groups = {crumbly = 2, not_in_creative_inventory =1},
})
minetest.register_craftitem("nsspf:"..name.."_spores", {
description = descr.." Spores",
image = "spores.png",
on_place = function(itemstack, placer, pointed_thing)
return place_spore(itemstack, placer, pointed_thing, "nsspf:"..name.."_mycelium","default:dirt_with_grass", "default:dirt")
end,
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_grass"},
interval = 3*int,
chance = 1*ch,
action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+2, z=pos.z}
local pos2 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.get_node(pos1).name
local nn = minetest.get_node(pos2).name
if (n== "air" or n=="group:flora") and nn== "default:dirt_with_grass" then
minetest.set_node(pos1, {name = "nsspf:"..name})
minetest.get_node_timer(pos1):start(300)
end
end
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_mycelium"},
interval = 6*int,
chance = 7+ch,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end
})
minetest.register_abm({
nodenames = {"default:dirt_with_grass"},
neighbors = {"air"},
interval = 18*int,
chance = 4500*ch,
action = function(pos, node)
local pos3 = {x=pos.x, y=pos.y-1, z=pos.z}
local n = minetest.get_node(pos3).name
if n== "default:dirt" then
minetest.set_node(pos3, {name = "nsspf:"..name.."_mycelium"})
end
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"air","default:water_source"},
interval = 1,
chance = 1,
action = function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300)
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"nsspf:"..name.."_mycelium"},
interval = 10,
chance = 1,
action = function(pos, node)
local flag = 0
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1
end
end
end
end
if flag > spread then
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then
minetest.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300)
end
end
end
end
end
end
})
end
nsspf_register_saprotrophicground ('macrolepiota_procera','Macrolepiota procera', 10, 12, 10)
nsspf_register_saprotrophicground ('coprinus_atramentarius','Coprinus atramentarius', 16, 16, 6)
nsspf_register_saprotrophicground ('lycoperdon_pyriforme','Lycoperdon piriforme',10, 10, 8)
nsspf_register_saprotrophicground ('psilocybe_cubensis','Psilocybe cubensis', 20, 16, 12)
nsspf_register_saprotrophicground ('gyromitra_esculenta','Gyromitra esculenta', 12, 14, 8)
--jungle fungi
minetest.register_abm({
nodenames = {"default:jungletree"},
neighbors = {"air"},
interval = 180.0,
chance = 600,
action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(pos1).name
if n == 'air' then
minetest.set_node({x = pos.x, y = pos.y+1, z = pos.z}, {name = "nsspf:marasmius_haematocephalus"})
minetest.get_node_timer(pos):start(300)
end
end
})
minetest.register_abm({
nodenames = {"default:jungletree"},
neighbors = {"air"},
interval = 180.0,
chance = 450,
action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(pos1).name
if n == 'air' then
minetest.set_node({x = pos.x, y = pos.y+1, z = pos.z}, {name = "nsspf:lentinus_strigosus"})
minetest.get_node_timer(pos):start(300)
end
end
})
--snowbank fungi
function nsspf_register_snowbankfungi (name, descr, int, ch, spread)
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"air"},
interval = 1,
chance = 1,
action = function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300)
end
})
minetest.register_node("nsspf:"..name.."_mycelium", {
description = descr,
tiles = {"snowbank_mycelium.png"},
groups = {crumbly = 2, not_in_creative_inventory =1},
})
minetest.register_craftitem("nsspf:"..name.."_spores", {
description = descr.." Spores",
image = "spores.png",
on_place = function(itemstack, placer, pointed_thing)
return place_spore(itemstack, placer, pointed_thing, "nsspf:"..name.."_mycelium","default:dirt_with_snow", "default:dirt")
end,
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_snow"},
interval = 2*int,
chance = 3*ch,
action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+2, z=pos.z}
local pos2 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.get_node(pos1).name
local nn = minetest.get_node(pos2).name
if (n== "air" or n== "default:snow") and nn== "default:dirt_with_snow" then
minetest.set_node(pos1, {name = "nsspf:"..name})
minetest.get_node_timer(pos1):start(300)
end
end
})
minetest.register_abm({
nodenames = {"default:dirt_with_snow"},
neighbors = {"air", "default:snow"},
interval = 18*int,
chance = 5500*ch,
action = function(pos, node)
local pos3 = {x=pos.x, y=pos.y-1, z=pos.z}
local n = minetest.get_node(pos3).name
if n== "default:dirt" then
minetest.set_node(pos3, {name = "nsspf:"..name.."_mycelium"})
end
end
})
minetest.register_abm({
nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_mycelium"},
interval = 12*int,
chance = 10*ch,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end
})
minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"nsspf:"..name.."_mycelium"},
interval = 10,
chance = 1,
action = function(pos, node)
local flag = 0
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1
end
end
end
end
if flag > spread then
for dx = -4,4 do
for dy = -4,1 do
for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then
minetest.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300)
end
end
end
end
end
end
})
end
nsspf_register_snowbankfungi ('plectania_nannfeldtii','Plectania nannfeldtii', 18, 10, 8)
nsspf_register_snowbankfungi ('hygrophorus_goetzii','Hygrophorus goetzii', 16, 10, 6)
nsspf_register_snowbankfungi ('clitocybe_glacialis','Clitocybe glacialis', 15, 10, 6)
minetest.register_abm({
nodenames = {"flowers:mushroom_red"},
interval = 1,
chance = 1,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "air"})
end
})
minetest.register_abm({
nodenames = {"flowers:mushroom_brown"},
interval = 1,
chance = 1,
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "air"})
end
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 451 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 697 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 468 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 480 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 846 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 827 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 916 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 927 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 982 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 868 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B