despawn mushrooms

This commit is contained in:
flux 2019-11-21 03:25:32 +00:00
parent 368037f5aa
commit 02b65e6d1c
2 changed files with 492 additions and 474 deletions

View File

@ -7,7 +7,7 @@ minetest.register_node("nsspf:boletus_edulis", {
paramtype = 'light', paramtype = 'light',
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"boletus_edulis.png"}, tiles = {"boletus_edulis.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_timer = function(pos, elapsed) on_timer = function(pos, elapsed)
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
@ -63,7 +63,7 @@ minetest.register_node("nsspf:boletus_edulis_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:boletus_edulis_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:boletus_edulis_fungusdirt", "default:dirt") end
@ -80,7 +80,7 @@ minetest.register_node("nsspf:cantharellus_cibarius", {
return return
end, end,
tiles = {"cantharellus_cibarius.png"}, tiles = {"cantharellus_cibarius.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
selection_box = { selection_box = {
type = 'fixed', type = 'fixed',
@ -130,7 +130,7 @@ minetest.register_node("nsspf:cantharellus_cibarius_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:cantharellus_cibarius_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:cantharellus_cibarius_fungusdirt", "default:dirt") end
@ -144,7 +144,7 @@ minetest.register_node("nsspf:suillus_grevillei", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"suillus_grevillei.png"}, tiles = {"suillus_grevillei.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -197,7 +197,7 @@ minetest.register_node("nsspf:suillus_grevillei_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:suillus_grevillei_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:suillus_grevillei_fungusdirt", "default:dirt") end
@ -211,7 +211,7 @@ minetest.register_node("nsspf:morchella_conica", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"morchella_conica.png"}, tiles = {"morchella_conica.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -264,7 +264,7 @@ minetest.register_node("nsspf:morchella_conica_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:morchella_conica_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:morchella_conica_fungusdirt", "default:dirt") end
@ -278,7 +278,7 @@ minetest.register_node("nsspf:russula_xerampelina", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"russula_xerampelina.png"}, tiles = {"russula_xerampelina.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-8), on_use = minetest.item_eat(-8),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -331,7 +331,7 @@ minetest.register_node("nsspf:russula_xerampelina_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:russula_xerampelina_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:russula_xerampelina_fungusdirt", "default:dirt") end
@ -345,7 +345,7 @@ minetest.register_node("nsspf:boletus_pinophilus", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"boletus_pinophilus.png"}, tiles = {"boletus_pinophilus.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -401,7 +401,7 @@ minetest.register_node("nsspf:boletus_pinophilus_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:boletus_pinophilus_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:boletus_pinophilus_fungusdirt", "default:dirt") end
@ -415,7 +415,7 @@ minetest.register_node("nsspf:boletus_satanas", {
on_timer = function(pos, elapsed) on_timer = function(pos, elapsed)
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-20), on_use = minetest.item_eat(-20),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -468,7 +468,7 @@ minetest.register_node("nsspf:boletus_satanas_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:boletus_satanas_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:boletus_satanas_fungusdirt", "default:dirt") end
@ -482,7 +482,7 @@ minetest.register_node("nsspf:amanita_phalloides", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"amanita_phalloides.png"}, tiles = {"amanita_phalloides.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-20), on_use = minetest.item_eat(-20),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -535,7 +535,7 @@ minetest.register_node("nsspf:amanita_muscaria_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:amanita_muscaria_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:amanita_muscaria_fungusdirt", "default:dirt") end
@ -549,7 +549,7 @@ minetest.register_node("nsspf:amanita_muscaria", {
on_timer = function(pos, elapsed) on_timer = function(pos, elapsed)
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-20), on_use = minetest.item_eat(-20),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -602,7 +602,7 @@ minetest.register_node("nsspf:amanita_phalloides_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:amanita_phalloides_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:amanita_phalloides_fungusdirt", "default:dirt") end
@ -621,7 +621,7 @@ minetest.register_node("nsspf:tuber_melanosporum_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:tuber_melanosporum_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:tuber_melanosporum_fungusdirt", "default:dirt") end
@ -640,7 +640,7 @@ minetest.register_node("nsspf:tuber_magnatum_pico_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:tuber_magnatum_pico_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:tuber_magnatum_pico_fungusdirt", "default:dirt") end
@ -659,7 +659,7 @@ minetest.register_node("nsspf:tuber_borchii_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:tuber_borchii_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:tuber_borchii_fungusdirt", "default:dirt") end
@ -678,7 +678,7 @@ minetest.register_node("nsspf:terfezia_arenaria_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:terfezia_arenaria_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:terfezia_arenaria_fungusdirt", "default:dirt") end
@ -694,7 +694,7 @@ minetest.register_node("nsspf:fistulina_hepatica", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"fistulina_hepatica.png"}, tiles = {"fistulina_hepatica.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(4), on_use = minetest.item_eat(4),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -742,7 +742,7 @@ minetest.register_node("nsspf:armillaria_mellea", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"armillaria_mellea.png"}, tiles = {"armillaria_mellea.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(2), on_use = minetest.item_eat(2),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -768,7 +768,7 @@ minetest.register_node("nsspf:fomes_fomentarius", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"fomes_fomentarius.png"}, tiles = {"fomes_fomentarius.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-1), on_use = minetest.item_eat(-1),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -816,7 +816,7 @@ minetest.register_node("nsspf:mycena_chlorophos", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"mycena_chlorophos.png"}, tiles = {"mycena_chlorophos.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-2), on_use = minetest.item_eat(-2),
selection_box = { selection_box = {
type = 'fixed', type = 'fixed',
@ -861,7 +861,7 @@ minetest.register_node("nsspf:mycena_chlorophos_light", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"mycena_chlorophos_light.png"}, tiles = {"mycena_chlorophos_light.png"},
groups = {snappy=3, not_in_creative_inventory=1}, groups = {snappy=3, not_in_creative_inventory=1, nsspf_mushroom=1},
light_source = 8, light_source = 8,
drop ="nsspf:mycena_chlorophos", drop ="nsspf:mycena_chlorophos",
on_use = minetest.item_eat(-2), on_use = minetest.item_eat(-2),
@ -889,7 +889,7 @@ minetest.register_node("nsspf:panellus_pusillus", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"panellus_pusillus.png"}, tiles = {"panellus_pusillus.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-2), on_use = minetest.item_eat(-2),
selection_box = { selection_box = {
type = 'fixed', type = 'fixed',
@ -934,7 +934,7 @@ minetest.register_node("nsspf:panellus_pusillus_light", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"panellus_pusillus_light.png"}, tiles = {"panellus_pusillus_light.png"},
groups = {snappy=3, not_in_creative_inventory=1}, groups = {snappy=3, not_in_creative_inventory=1, nsspf_mushroom=1},
light_source = 8, light_source = 8,
drop = "nsspf:panellus_pusillus", drop = "nsspf:panellus_pusillus",
on_use = minetest.item_eat(-2), on_use = minetest.item_eat(-2),
@ -964,7 +964,7 @@ minetest.register_node("nsspf:macrolepiota_procera", {
on_timer = function(pos, elapsed) on_timer = function(pos, elapsed)
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(3), on_use = minetest.item_eat(3),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1017,7 +1017,7 @@ minetest.register_node("nsspf:macrolepiota_procera_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:macrolepiota_procera_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:macrolepiota_procera_fungusdirt", "default:dirt") end
@ -1031,7 +1031,7 @@ minetest.register_node("nsspf:psilocybe_cubensis", {
on_timer = function(pos, elapsed) on_timer = function(pos, elapsed)
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-7), on_use = minetest.item_eat(-7),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1084,7 +1084,7 @@ minetest.register_node("nsspf:psilocybe_cubensis_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:psilocybe_cubensis_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:psilocybe_cubensis_fungusdirt", "default:dirt") end
@ -1098,7 +1098,7 @@ minetest.register_node("nsspf:lycoperdon_pyriforme", {
paramtype = 'light', paramtype = 'light',
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"lycoperdon_pyriforme.png"}, tiles = {"lycoperdon_pyriforme.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(8), on_use = minetest.item_eat(8),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1151,7 +1151,7 @@ minetest.register_node("nsspf:lycoperdon_pyriforme_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:lycoperdon_pyriforme_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:lycoperdon_pyriforme_fungusdirt", "default:dirt") end
@ -1165,7 +1165,7 @@ minetest.register_node("nsspf:gyromitra_esculenta", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"gyromitra_esculenta.png"}, tiles = {"gyromitra_esculenta.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-20), on_use = minetest.item_eat(-20),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1218,7 +1218,7 @@ minetest.register_node("nsspf:gyromitra_esculenta_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:gyromitra_esculenta_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:gyromitra_esculenta_fungusdirt", "default:dirt") end
@ -1232,7 +1232,7 @@ minetest.register_node("nsspf:coprinus_atramentarius", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"coprinus_atramentarius.png"}, tiles = {"coprinus_atramentarius.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-13), on_use = minetest.item_eat(-13),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1285,7 +1285,7 @@ minetest.register_node("nsspf:coprinus_atramentarius_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:coprinus_atramentarius_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:coprinus_atramentarius_fungusdirt", "default:dirt") end
@ -1301,7 +1301,7 @@ minetest.register_node("nsspf:lentinus_strigosus", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"lentinus_strigosus.png"}, tiles = {"lentinus_strigosus.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1349,7 +1349,7 @@ minetest.register_node("nsspf:ganoderma_lucidum", {
paramtype = 'light', paramtype = 'light',
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"ganoderma_lucidum.png"}, tiles = {"ganoderma_lucidum.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(14), on_use = minetest.item_eat(14),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1397,7 +1397,7 @@ minetest.register_node("nsspf:marasmius_haematocephalus", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"marasmius_haematocephalus.png"}, tiles = {"marasmius_haematocephalus.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-1), on_use = minetest.item_eat(-1),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1445,7 +1445,7 @@ minetest.register_node("nsspf:clitocybula_azurea", {
minetest.set_node(pos, {name="air"}) minetest.set_node(pos, {name="air"})
end, end,
tiles = {"clitocybula_azurea.png"}, tiles = {"clitocybula_azurea.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-6), on_use = minetest.item_eat(-6),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1495,7 +1495,7 @@ minetest.register_node("nsspf:clitocybe_glacialis", {
paramtype = 'light', paramtype = 'light',
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"clitocybe_glacialis.png"}, tiles = {"clitocybe_glacialis.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(1), on_use = minetest.item_eat(1),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1548,7 +1548,7 @@ minetest.register_node("nsspf:clitocybe_glacialis_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:clitocybe_glacialis_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:clitocybe_glacialis_fungusdirt", "default:dirt") end
@ -1562,7 +1562,7 @@ minetest.register_node("nsspf:hygrophorus_goetzii", {
paramtype = 'light', paramtype = 'light',
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"hygrophorus_goetzii.png"}, tiles = {"hygrophorus_goetzii.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-4), on_use = minetest.item_eat(-4),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1615,7 +1615,7 @@ minetest.register_node("nsspf:hygrophorus_goetzii_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:hygrophorus_goetzii_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:hygrophorus_goetzii_fungusdirt", "default:dirt") end
@ -1629,7 +1629,7 @@ minetest.register_node("nsspf:plectania_nannfeldtii", {
end, end,
paramtype2 = 'facedir', paramtype2 = 'facedir',
tiles = {"plectania_nannfeldtii.png"}, tiles = {"plectania_nannfeldtii.png"},
groups = {snappy=3}, groups = {snappy=3, nsspf_mushroom=1},
on_use = minetest.item_eat(-20), on_use = minetest.item_eat(-20),
on_place = function(itemstack, placer, pointed_thing) on_place = function(itemstack, placer, pointed_thing)
return return
@ -1682,7 +1682,7 @@ minetest.register_node("nsspf:plectania_nannfeldtii_fungusdirt", {
}, },
} }
}, },
groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1}, groups = {crumbly = 3, not_in_creative_inventory = 1, soil = 1, nsspf_dirt=1},
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:plectania_nannfeldtii_fungusdirt", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:plectania_nannfeldtii_fungusdirt", "default:dirt") end

868
spawn.lua
View File

@ -47,112 +47,112 @@ function nsspf_register_mycorrhizalmycelium (name, descr, tree, int, ch, spread)
end, end,
}) })
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {tree}, -- neighbors = {tree},
interval = 30*int, -- interval = 30*int,
chance = 200*ch, -- chance = 200*ch,
action = function(pos, node) -- action = function(pos, node)
local flag = 0 -- local flag = 0
for dx = -2,2 do -- for dx = -2,2 do
for dy = -2,1 do -- for dy = -2,1 do
for dz = -2,2 do -- for dz = -2,2 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit -- if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = 1 -- flag = 1
return -- return
end -- end
end -- end
end -- end
end -- end
--if no other mycelium have been found: -- --if no other mycelium have been found:
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"air","default:water_source"}, -- neighbors = {"air","default:water_source"},
interval = 1, -- interval = 1,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"}) -- minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_snow"}, -- neighbors = {"default:dirt_with_snow"},
interval = 1, -- interval = 1,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node(pos, {name="default:dirt"}) -- minetest.set_node(pos, {name="default:dirt"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_mycelium"}, -- neighbors = {"nsspf:"..name.."_mycelium"},
interval = 12*int, -- interval = 12*int,
chance = 10*ch, -- chance = 10*ch,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_grass"}, -- neighbors = {"default:dirt_with_grass"},
interval = 5*int, -- interval = 5*int,
chance = 1*ch, -- chance = 1*ch,
action = function(pos, node) -- action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+2, z=pos.z} -- 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 pos2 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
local nn = minetest.get_node(pos2).name -- local nn = minetest.get_node(pos2).name
if (n== "air" or n=="group:flora") and nn== "default:dirt_with_grass" then -- if (n== "air" or n=="group:flora") and nn== "default:dirt_with_grass" then
minetest.set_node(pos1, {name = "nsspf:"..name}) -- minetest.set_node(pos1, {name = "nsspf:"..name})
minetest.get_node_timer(pos1):start(300) -- minetest.get_node_timer(pos1):start(300)
end -- end
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"nsspf:"..name.."_mycelium"}, -- neighbors = {"nsspf:"..name.."_mycelium"},
interval = 10, -- interval = 10,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
local flag = 0 -- local flag = 0
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit -- if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1 -- flag = flag+1
end -- end
end -- end
end -- end
end -- end
if flag > spread then -- if flag > spread then
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name -- local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then -- 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.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300) -- minetest.get_node_timer(pos2):start(300)
end -- end
end -- end
end -- end
end -- end
end -- end
end -- end
}) --})
end end
@ -178,40 +178,40 @@ function nsspf_register_tuber (name, descr, tree, int, ch, gnam, spread)
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:"..name.."_tuber_mycelium", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:"..name.."_tuber_mycelium", "default:dirt") end
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {tree}, -- neighbors = {tree},
interval = 30*int, -- interval = 30*int,
chance = 300*ch, -- chance = 300*ch,
action = function(pos, node) -- action = function(pos, node)
local flag = 0 -- local flag = 0
for dx = -2,2 do -- for dx = -2,2 do
for dy = -2,1 do -- for dy = -2,1 do
for dz = -2,2 do -- for dz = -2,2 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit -- if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = 1 -- flag = 1
return -- return
end -- end
end -- end
end -- end
end -- end
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_tuber_mycelium"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_tuber_mycelium"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_tuber_mycelium"}, -- nodenames = {"nsspf:"..name.."_tuber_mycelium"},
neighbors = {"air","default:water_source"}, -- neighbors = {"air","default:water_source"},
interval = 1, -- interval = 1,
chance = 1, -- chance = 1,
action = -- action =
function(pos, node) -- function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"}) -- minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
}) --})
minetest.register_node("nsspf:"..name.."_fruit", { minetest.register_node("nsspf:"..name.."_fruit", {
description = descr.." Truffle", description = descr.." Truffle",
@ -221,15 +221,15 @@ function nsspf_register_tuber (name, descr, tree, int, ch, gnam, spread)
}) })
if tubelib then tubelib_addons1.register_ground_node("nsspf:"..name.."_fruit", "default:dirt") end if tubelib then tubelib_addons1.register_ground_node("nsspf:"..name.."_fruit", "default:dirt") end
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_tuber_mycelium"}, -- neighbors = {"nsspf:"..name.."_tuber_mycelium"},
interval = 12*int, -- interval = 12*int,
chance = 6*ch, -- chance = 6*ch,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_tuber_mycelium"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_tuber_mycelium"})
end -- end
}) --})
minetest.register_craftitem("nsspf:"..name, { minetest.register_craftitem("nsspf:"..name, {
description = descr, description = descr,
@ -245,50 +245,50 @@ function nsspf_register_tuber (name, descr, tree, int, ch, gnam, spread)
end, end,
}) })
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_tuber_mycelium"}, -- neighbors = {"nsspf:"..name.."_tuber_mycelium"},
interval = 12*int, -- interval = 12*int,
chance = 8*ch, -- chance = 8*ch,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_fruit"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_fruit"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_tuber_mycelium"}, -- nodenames = {"nsspf:"..name.."_tuber_mycelium"},
neighbors = {"nsspf:"..name.."_tuber_mycelium"}, -- neighbors = {"nsspf:"..name.."_tuber_mycelium"},
interval = 10, -- interval = 10,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
local flag = 0 -- local flag = 0
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit -- if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1 -- flag = flag+1
end -- end
end -- end
end -- end
end -- end
if flag > spread then -- if flag > spread then
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name -- local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then -- 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.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300) -- minetest.get_node_timer(pos2):start(300)
end -- end
end -- end
end -- end
end -- end
end -- end
end -- end
}) --})
end end
@ -300,20 +300,20 @@ nsspf_register_tuber ("terfezia_arenaria","Terfezia arenaria","default:acacia_tr
function nssbf_register_saprotrophicontrees (name, descr, tree, int, ch) function nssbf_register_saprotrophicontrees (name, descr, tree, int, ch)
minetest.register_abm({ --minetest.register_abm({
nodenames = {tree}, -- nodenames = {tree},
neighbors = {"air"}, -- neighbors = {"air"},
interval = 20*int, -- interval = 20*int,
chance = 40*ch, -- chance = 40*ch,
action = function(pos, node) -- action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y, z=pos.z-1} -- local pos1 = {x=pos.x, y=pos.y, z=pos.z-1}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n == 'air' then -- if n == 'air' then
minetest.set_node({x = pos.x, y = pos.y, z = pos.z-1}, {name = "nsspf:"..name}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z-1}, {name = "nsspf:"..name})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
end -- end
}) --})
end end
@ -339,15 +339,15 @@ set_fluo = function (pos)
end end
end end
minetest.register_abm({ --minetest.register_abm({
nodenames = { "nsspf:mycena_chlorophos", "nsspf:mycena_chlorophos_light"}, -- nodenames = { "nsspf:mycena_chlorophos", "nsspf:mycena_chlorophos_light"},
interval = OPEN_CHECK, -- interval = OPEN_CHECK,
chance = 1, -- chance = 1,
--
action = function(pos, node, active_object_count, active_object_count_wider) -- action = function(pos, node, active_object_count, active_object_count_wider)
set_fluo(pos) -- set_fluo(pos)
end -- end
}) --})
set_fluor = function (pos) set_fluor = function (pos)
if (minetest.get_node_light(pos, nil) < 10) and ((minetest.get_timeofday() < 19500) or (minetest.get_timeofday() > 5000)) then if (minetest.get_node_light(pos, nil) < 10) and ((minetest.get_timeofday() < 19500) or (minetest.get_timeofday() > 5000)) then
@ -357,15 +357,15 @@ set_fluor = function (pos)
end end
end end
minetest.register_abm({ --minetest.register_abm({
nodenames = { "nsspf:panellus_pusillus", "nsspf:panellus_pusillus_light" }, -- nodenames = { "nsspf:panellus_pusillus", "nsspf:panellus_pusillus_light" },
interval = OPEN_CHECK, -- interval = OPEN_CHECK,
chance = 1, -- chance = 1,
--
action = function(pos, node, active_object_count, active_object_count_wider) -- action = function(pos, node, active_object_count, active_object_count_wider)
set_fluor(pos) -- set_fluor(pos)
end -- end
}) --})
--Saprotrophic fungi that grow on the ground --Saprotrophic fungi that grow on the ground
@ -387,92 +387,92 @@ function nsspf_register_saprotrophicground (name, descr, int, ch, spread)
end, end,
}) })
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_grass"}, -- neighbors = {"default:dirt_with_grass"},
interval = 3*int, -- interval = 3*int,
chance = 1*ch, -- chance = 1*ch,
action = function(pos, node) -- action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+2, z=pos.z} -- 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 pos2 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
local nn = minetest.get_node(pos2).name -- local nn = minetest.get_node(pos2).name
if (n== "air" or n=="group:flora") and nn== "default:dirt_with_grass" then -- if (n== "air" or n=="group:flora") and nn== "default:dirt_with_grass" then
minetest.set_node(pos1, {name = "nsspf:"..name}) -- minetest.set_node(pos1, {name = "nsspf:"..name})
minetest.get_node_timer(pos1):start(300) -- minetest.get_node_timer(pos1):start(300)
end -- end
end -- end
}) --})
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_mycelium"}, -- neighbors = {"nsspf:"..name.."_mycelium"},
interval = 6*int, -- interval = 6*int,
chance = 7+ch, -- chance = 7+ch,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt_with_grass"}, -- nodenames = {"default:dirt_with_grass"},
neighbors = {"air"}, -- neighbors = {"air"},
interval = 18*int, -- interval = 18*int,
chance = 4500*ch, -- chance = 4500*ch,
action = function(pos, node) -- action = function(pos, node)
local pos3 = {x=pos.x, y=pos.y-1, z=pos.z} -- local pos3 = {x=pos.x, y=pos.y-1, z=pos.z}
local n = minetest.get_node(pos3).name -- local n = minetest.get_node(pos3).name
if n== "default:dirt" then -- if n== "default:dirt" then
minetest.set_node(pos3, {name = "nsspf:"..name.."_mycelium"}) -- minetest.set_node(pos3, {name = "nsspf:"..name.."_mycelium"})
end -- end
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"air","default:water_source"}, -- neighbors = {"air","default:water_source"},
interval = 1, -- interval = 1,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"}) -- minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"nsspf:"..name.."_mycelium"}, -- neighbors = {"nsspf:"..name.."_mycelium"},
interval = 10, -- interval = 10,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
local flag = 0 -- local flag = 0
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit -- if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1 -- flag = flag+1
end -- end
end -- end
end -- end
end -- end
if flag > spread then -- if flag > spread then
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name -- local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then -- 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.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300) -- minetest.get_node_timer(pos2):start(300)
end -- end
end -- end
end -- end
end -- end
end -- end
end -- end
}) --})
end end
nsspf_register_saprotrophicground ('macrolepiota_procera','Macrolepiota procera', 10, 12, 10) nsspf_register_saprotrophicground ('macrolepiota_procera','Macrolepiota procera', 10, 12, 10)
@ -483,51 +483,51 @@ nsspf_register_saprotrophicground ('gyromitra_esculenta','Gyromitra esculenta',
--jungle fungi --jungle fungi
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:jungletree"}, -- nodenames = {"default:jungletree"},
neighbors = {"air"}, -- neighbors = {"air"},
interval = 180.0, -- interval = 180.0,
chance = 600, -- chance = 600,
action = function(pos, node) -- action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} -- local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(pos1).name -- local n = minetest.env:get_node(pos1).name
if n == 'air' then -- if n == 'air' then
minetest.set_node({x = pos.x, y = pos.y+1, z = pos.z}, {name = "nsspf:marasmius_haematocephalus"}) -- minetest.set_node({x = pos.x, y = pos.y+1, z = pos.z}, {name = "nsspf:marasmius_haematocephalus"})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
end -- end
}) --})
--
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:jungletree"}, -- nodenames = {"default:jungletree"},
neighbors = {"air"}, -- neighbors = {"air"},
interval = 180.0, -- interval = 180.0,
chance = 450, -- chance = 450,
action = function(pos, node) -- action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+1, z=pos.z} -- local pos1 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.env:get_node(pos1).name -- local n = minetest.env:get_node(pos1).name
if n == 'air' then -- if n == 'air' then
minetest.set_node({x = pos.x, y = pos.y+1, z = pos.z}, {name = "nsspf:lentinus_strigosus"}) -- minetest.set_node({x = pos.x, y = pos.y+1, z = pos.z}, {name = "nsspf:lentinus_strigosus"})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
end -- end
}) --})
--snowbank fungi --snowbank fungi
function nsspf_register_snowbankfungi (name, descr, int, ch, spread) function nsspf_register_snowbankfungi (name, descr, int, ch, spread)
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"air"}, -- neighbors = {"air"},
interval = 1, -- interval = 1,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"}) -- minetest.set_node(pos, {name="nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos):start(300) -- minetest.get_node_timer(pos):start(300)
end -- end
}) --})
minetest.register_node("nsspf:"..name.."_mycelium", { minetest.register_node("nsspf:"..name.."_mycelium", {
description = descr, description = descr,
@ -544,81 +544,81 @@ function nsspf_register_snowbankfungi (name, descr, int, ch, spread)
end, end,
}) })
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"default:dirt_with_snow"}, -- neighbors = {"default:dirt_with_snow"},
interval = 2*int, -- interval = 2*int,
chance = 3*ch, -- chance = 3*ch,
action = function(pos, node) -- action = function(pos, node)
local pos1 = {x=pos.x, y=pos.y+2, z=pos.z} -- 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 pos2 = {x=pos.x, y=pos.y+1, z=pos.z}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
local nn = minetest.get_node(pos2).name -- local nn = minetest.get_node(pos2).name
if (n== "air" or n== "default:snow") and nn== "default:dirt_with_snow" then -- if (n== "air" or n== "default:snow") and nn== "default:dirt_with_snow" then
minetest.set_node(pos1, {name = "nsspf:"..name}) -- minetest.set_node(pos1, {name = "nsspf:"..name})
minetest.get_node_timer(pos1):start(300) -- minetest.get_node_timer(pos1):start(300)
end -- end
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt_with_snow"}, -- nodenames = {"default:dirt_with_snow"},
neighbors = {"air", "default:snow"}, -- neighbors = {"air", "default:snow"},
interval = 18*int, -- interval = 18*int,
chance = 5500*ch, -- chance = 5500*ch,
action = function(pos, node) -- action = function(pos, node)
local pos3 = {x=pos.x, y=pos.y-1, z=pos.z} -- local pos3 = {x=pos.x, y=pos.y-1, z=pos.z}
local n = minetest.get_node(pos3).name -- local n = minetest.get_node(pos3).name
if n== "default:dirt" then -- if n== "default:dirt" then
minetest.set_node(pos3, {name = "nsspf:"..name.."_mycelium"}) -- minetest.set_node(pos3, {name = "nsspf:"..name.."_mycelium"})
end -- end
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"default:dirt"}, -- nodenames = {"default:dirt"},
neighbors = {"nsspf:"..name.."_mycelium"}, -- neighbors = {"nsspf:"..name.."_mycelium"},
interval = 12*int, -- interval = 12*int,
chance = 10*ch, -- chance = 10*ch,
action = function(pos, node) -- action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"}) -- minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "nsspf:"..name.."_mycelium"})
end -- end
}) --})
--
minetest.register_abm({ --minetest.register_abm({
nodenames = {"nsspf:"..name.."_mycelium"}, -- nodenames = {"nsspf:"..name.."_mycelium"},
neighbors = {"nsspf:"..name.."_mycelium"}, -- neighbors = {"nsspf:"..name.."_mycelium"},
interval = 10, -- interval = 10,
chance = 1, -- chance = 1,
action = function(pos, node) -- action = function(pos, node)
local flag = 0 -- local flag = 0
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos1 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local n = minetest.get_node(pos1).name -- local n = minetest.get_node(pos1).name
if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit -- if n and string.match(n,"mycelium") then -- if the name contains "mycelium" then exit
flag = flag+1 -- flag = flag+1
end -- end
end -- end
end -- end
end -- end
if flag > spread then -- if flag > spread then
for dx = -4,4 do -- for dx = -4,4 do
for dy = -4,1 do -- for dy = -4,1 do
for dz = -4,4 do -- for dz = -4,4 do
local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz} -- local pos2 = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
local k = minetest.get_node(pos2).name -- local k = minetest.get_node(pos2).name
if k and string.match(k,"mycelium") then -- 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.set_node({x = pos2.x, y = pos2.y, z = pos2.z}, {name = "nsspf:"..name.."_fungusdirt"})
minetest.get_node_timer(pos2):start(300) -- minetest.get_node_timer(pos2):start(300)
end -- end
end -- end
end -- end
end -- end
end -- end
end -- end
}) --})
end end
@ -645,3 +645,21 @@ if minetest.settings:get('nsspf.allow_default_mushrooms') ~= 'true' then
end end
}) })
end end
----------------------------------
minetest.register_lbm({
label = "Despawn nsspf mushrooms",
name = "nsspf:despawn_mushrooms",
nodenames = {"group:nsspf_mushroom"},
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "air"})
end
})
minetest.register_lbm({
label = "Despawn nsspf dirt",
name = "nsspf:despawn_dirt",
nodenames = {"group:nsspf_dirt"},
action = function(pos, node)
minetest.set_node({x = pos.x, y = pos.y, z = pos.z}, {name = "default:dirt"})
end
})