code:
# textdomain: df_trees

### black_cap.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Black Cap=Schwarze Kappe
Black Cap Gills=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Black Cap Planks=Black Cap Planken
Black Cap Spawn=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Black Cap Stem=Schwarzer Kappenstiel

### blood_thorn.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Blood Thorn Planks=Blutdornbretter
Blood Thorn Spike=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Blood Thorn Stem=Blutdornstamm
Dead Blood Thorn Spike=
Dead Blood Thorn Stem=

### doc.lua ###

@1 have an unusual biochemistry that allows them to somehow subsist on ambient heat, in violation of all known laws of thermodynamics. They grow deep underground in frigid, icy caverns that should by all rights be volcanic.=

@1 wood, in addition to being a beautiful blue hue, retains the odd heat-draining ability of living icecaps and is able to quickly freeze nearby water solid.=

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
A torchspine alternates between active and quiescent phases and emits dim light when active. They can be harvested for torches, and their embers sprout into new torchspines when placed on flammable surfaces.=Eine Fackel wechselt zwischen aktiver und ruhender Phase und gibt schwaches Licht ab, wenn sie aktiv ist. Sie können für Fackeln geerntet werden, und ihre Glut sprießt auf brennbaren Oberflächen zu neuen Fackelstacheln.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Aside from the artistic applications of its particularly dark color, black cap wood is a long-burning fuel source that's as good as coal for some applications. Black cap gills are oily and make for excellent torch fuel.=Abgesehen von den künstlerischen Anwendungen seiner besonders dunklen Farbe ist Schwarzkappenholz eine langbrennende Brennstoffquelle, die für einige Anwendungen so gut wie Kohle ist. Kiemen mit schwarzer Kappe sind ölig und sorgen für hervorragenden Brennerkraftstoff.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Blood thorns are the most vicious of underground flora, as befits their harsh environments. Found only in hot, dry caverns with sandy soil far from the surface world's organic bounty, blood thorns seek to supplement their nutrient supply with wickedly barbed hollow spines that actively drain fluids from whatever stray plant or creature they might impale.=Blutdornen sind die bösartigste unterirdische Flora, wie es sich für ihre raue Umgebung gehört. Blutdornen kommen nur in heißen, trockenen Höhlen mit sandigem Boden vor, weit entfernt von der organischen Prämie der Oberflächenwelt. Sie versuchen, ihre Nährstoffversorgung durch boshafte, hohle Stacheln zu ergänzen, die aktiv Flüssigkeiten aus streunenden Pflanzen oder Kreaturen ablassen, die sie aufspießen könnten.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Cyan Spindlestems are a sign of both copper and iron deposits nearby. Their glowing symbiotes can be extracted as a long-lived light source.=Cyan-Spindelstämme sind ein Zeichen für Kupfer- und Eisenvorkommen in der Nähe. Ihre leuchtenden Symbioten können als langlebige Lichtquelle extrahiert werden.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Fungiwood stalk is strong and very fine-grained, making smooth yellow-tinted lumber when cut. Fungiwood shelf is too fragile to be much use as anything other than fuel.=Der Pilzholzstiel ist stark und sehr feinkörnig, wodurch beim Schneiden glattes, gelb getöntes Holz entsteht. Das Pilzholzregal ist zu zerbrechlich, um als etwas anderes als Kraftstoff verwendet zu werden.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Goblin cap stem and cap material can be cut into wood of two different hues, a subdued cream and a bright orange-red.=Goblin-Kappenstiel und Kappenmaterial können in Holz in zwei verschiedenen Farbtönen geschnitten werden, einer gedämpften Creme und einem leuchtenden Orangerot.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Golden Spindlestems are a sign of rare and magical mineral deposits nearby. Their glowing symbiotes can be extracted as a strong and long-lived light source.=Goldene Spindelstämme sind ein Zeichen für seltene und magische Mineralvorkommen in der Nähe. Ihre leuchtenden Symbioten können als starke und langlebige Lichtquelle extrahiert werden.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Green Spindlestems are a sign of nearby copper deposits. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is not strong.=Grüne Spindelstämme sind ein Zeichen für nahegelegene Kupfervorkommen. Ihre leuchtenden Symbioten können als langlebige Lichtquelle extrahiert werden, obwohl das Leuchten nicht stark ist.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living blood thorn spikes remain harmful to creatures that touch them. If killed by bright light, they cause only passive damage to creatures that fall on them (as one would expect from an enormous spike).=Lebende Blutdornspitzen bleiben für Kreaturen, die sie berühren, schädlich. Wenn sie durch helles Licht getötet werden, verursachen sie nur passiven Schaden an Kreaturen, die auf sie fallen (wie man es von einer enormen Spitze erwarten würde).

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a cyan Spindlestem.=Lebender Extrakt aus der Kappe eines cyanfarbenen Spindlestems.
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a green Spindlestem.=Lebender Extrakt aus der Kappe eines grünen Spindlestems.
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a red Spindlestem.=Lebender Extrakt aus der Kappe eines roten Spindlestems.
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a yellow Spindlestem.=Lebender Extrakt aus der Kappe eines gelben Spindlestems.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Massive but squat, mature goblin cap mushrooms are the size of small cottages.=Massive, aber gedrungene, reife Koboldkappenpilze haben die Größe kleiner Hütten.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Red Spindlestems are a sign of nearby iron deposits - or perhaps Goblin Caps. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is weak.=Rote Spindelstämme sind ein Zeichen für nahegelegene Eisenvorkommen - oder vielleicht Goblin Caps. Ihre leuchtenden Symbioten können als langlebige Lichtquelle extrahiert werden, obwohl das Leuchten schwach ist.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spindlestems are too big to easily pluck by hand but too small to be called a proper tree. Nevertheless, they are a common and useful resource for underground travelers - particularly their glowing caps.=Spindelstämme sind zu groß, um leicht von Hand gepflückt zu werden, aber zu klein, um als richtiger Baum bezeichnet zu werden. Trotzdem sind sie eine häufige und nützliche Ressource für U-Bahn-Reisende - insbesondere für ihre leuchtenden Kappen.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore tree trunks can be cut into pale woody planks. The branching fibers and fruiting bodies are only useful as fuel.=Sporenbaumstämme können in blasse Holzbretter geschnitten werden. Die verzweigten Fasern und Fruchtkörper sind nur als Brennstoff nützlich.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore trees have a sturdy 'trunk' that supports a large spongy mesh of branching fibers, with embedded fruiting bodies that produce a copious amount of spores that gently rain down around the spore tree's base.=Sporenbäume haben einen stabilen "Stamm", der ein großes schwammiges Netz aus verzweigten Fasern trägt, mit eingebetteten Fruchtkörpern, die eine große Menge von Sporen produzieren, die sanft um die Basis des Sporenbaums regnen.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a brilliant yellow due to symbiotic microorganisms.=Die Kappe eines Spindlestems, die aufgrund symbiotischer Mikroorganismen leuchtend gelb leuchtet.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a soft green due to symbiotic microorganisms.=Die Kappe eines Spindlestems, die aufgrund symbiotischer Mikroorganismen sanft grün leuchtet.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a strong cyan due to symbiotic microorganisms.=Die Kappe eines Spindlestems, die aufgrund symbiotischer Mikroorganismen stark cyan leuchtet.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a weak red due to symbiotic microorganisms.=Die Kappe eines Spindlestems, die aufgrund symbiotischer Mikroorganismen schwach rot leuchtet.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, uncontaminated by any symbiotic luminescent microorganisms.=Die Kappe eines Spindlestems, die nicht durch symbiotische lumineszierende Mikroorganismen kontaminiert ist.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The dense black wood of these mushrooms is heavy and hard to work with, and has few remarkable properties.=Das dichte schwarze Holz dieser Pilze ist schwer und schwer zu verarbeiten und hat nur wenige bemerkenswerte Eigenschaften.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The king of the fungi, tower cap mushrooms grow to immense proportions.=Der König der Pilze, Turmkappenpilze, wachsen zu immensen Ausmaßen.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The spikes of a blood thorn can actually remain living long after they're severed from their parent stalk, a testament to their tenacity. As long as they remain alive they will continue to actively drain anything they puncture, though they don't grow.=Die Stacheln eines Blutdorns können tatsächlich noch lange leben, nachdem sie von ihrem Elternstiel abgetrennt wurden, ein Beweis für ihre Hartnäckigkeit. Solange sie am Leben bleiben, werden sie weiterhin aktiv alles ablassen, was sie durchstechen, obwohl sie nicht wachsen.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The stem of a Spindlestem is surprisingly sturdy, and despite their thinness they can grow quite tall. They can be used as a wood substitute in many crafting recipes.=Der Stiel eines Spindlestems ist überraschend robust und kann trotz ihrer Dünnheit ziemlich groß werden. Sie können als Holzersatz in vielen Handwerksrezepten verwendet werden.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The trunk of a tunnel tube can be cut and processed to produce plywood-like material.=Der Stamm eines Tunnelrohrs kann geschnitten und zu sperrholzartigem Material verarbeitet werden.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The trunk of a tunnel tube can be cut and processed to produce plywood-like material. The fruiting body accumulates high-energy compounds that, when ignited, produce a vigorous detonation - a unique adaptation for spreading tunnel tube spawn through the still cavern air.=Der Stamm eines Tunnelrohrs kann geschnitten und zu sperrholzartigem Material verarbeitet werden. Der Fruchtkörper sammelt hochenergetische Verbindungen an, die beim Zünden eine heftige Detonation hervorrufen - eine einzigartige Anpassung für die Ausbreitung von Tunnelrohrlaich in der stillen Höhlenluft.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
These things are useless except as weak fuel for a fire.=Diese Dinge sind nutzlos, außer als schwacher Brennstoff für ein Feuer.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Thin, irregular layers of spore-producing 'shelves' surround the strong central stalk of the mighty Fungiwood.=Dünne, unregelmäßige Schichten sporenproduzierender "Regale" umgeben den starken Mittelstiel des mächtigen Pilzwaldes.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Torchspines are strange organic formations that are alive only in a technical sense. They "feed" on volatile flammable vapors vented up through their structure, growing from combustion residue deposited at their tips.=Fackelstacheln sind seltsame organische Formationen, die nur im technischen Sinne leben. Sie "ernähren" sich von flüchtigen brennbaren Dämpfen, die durch ihre Struktur entweichen und aus Verbrennungsrückständen wachsen, die sich an ihren Spitzen ablagern.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tower caps are an excellent source of wood.=Turmkappen sind eine ausgezeichnete Holzquelle.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tunnel tubes are hollow, curved fungal growths that support a fruiting body.=Tunnelrohre sind hohle, gekrümmte Pilzwucherungen, die einen Fruchtkörper stützen.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
When harvested, the central stalk of a blood thorn can be cut into planks and used as wood. It has a purple-red hue that may or may not appeal, depending on one's artistic tastes.=Bei der Ernte kann der zentrale Stiel eines Blutdorns in Bretter geschnitten und als Holz verwendet werden. Es hat einen purpurroten Farbton, der je nach künstlerischem Geschmack ansprechen kann oder nicht.

### fungiwood.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Fungiwood Planks=Fungiwood Planken
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Fungiwood Shelf=Fungiwood Regal
Fungiwood Spawn=
Fungiwood Stem=

### goblin_cap.lua ###

Goblin Cap=
Goblin Cap Gills=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Goblin Cap Planks=Goblin Cap Planken
Goblin Cap Spawn=
Goblin Cap Stem=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Goblin Cap Stem Planks=Goblin Cap Stem Planken

### nether_cap.lua ###

@1 Gills=
@1 Planks=
@1 Spawn=
@1 Stem=

### spindlestem.lua ###

@1 Spindlestem Cap=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
@1 Spindlestem Extract=@1 Spindlestem-Extrakt
Cyan=
Golden=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Green=Grün
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Red=Rot
Spindlestem=
Spindlestem Spawn=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
White=Weiß

### spore_tree.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore Tree Fruiting Body=Sporenbaum-Fruchtkörper
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore Tree Hyphae=Sporenbaumhyphen
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore Tree Ladder=Sporenbaumleiter
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore Tree Planks=Sporenbaumbretter
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore Tree Spawn=Sporenbaumlaich
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore Tree Stem=Sporenbaumstamm

### torchspine.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Torchspine=Fackelrücken
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Torchspine Ember=Fackelglut
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Torchspine Tip=Fackelspitze

### tower_cap.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tower Cap=Turmkappe
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tower Cap Gills=Tower Cap Kiemen
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tower Cap Planks=Turmkappenbretter
Tower Cap Spawn=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tower Cap Stem=Turmkappenstiel

### tunnel_tube.lua ###

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tunnel Tube=Tunnelrohr
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tunnel Tube Fruiting Body=Tunnelrohr-Fruchtkörper
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tunnel Tube Plies=Tunnelrohrlagen
Tunnel Tube Spawn=

##### not used anymore #####

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Nether cap wood, in addition to being a beautiful blue hue, retains the odd heat-draining ability of living nether caps and is able to quickly freeze nearby water solid.=Netherkappenholz ist nicht nur ein wunderschöner blauer Farbton, sondern behält auch die seltsame Wärmeableitungsfähigkeit lebender Netherkappen bei und kann in der Nähe befindliche Wasserfeststoffe schnell einfrieren.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Nether caps have an unusual biochemistry that allows them to somehow subsist on ambient heat, in violation of all known laws of thermodynamics. They grow deep underground in frigid, icy caverns that should by all rights be volcanic.=Netherkappen haben eine ungewöhnliche Biochemie, die es ihnen ermöglicht, unter Verstoß gegen alle bekannten Gesetze der Thermodynamik von Umgebungswärme zu leben. Sie wachsen tief unter der Erde in kalten, eisigen Höhlen, die auf jeden Fall vulkanisch sein sollten.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Nether Cap Gills=Nether Cap Kiemen
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Nether Cap Planks=Nether Cap Planken


code:
# textdomain: df_trees

### black_cap.lua ###

Black Cap=Cappello nero
Black Cap Gills=Lamelle di cappello nero
Black Cap Planks=Assi di cappello nero
Black Cap Spawn=Prole di cappello nero
Black Cap Stem=Gambo di cappello nero

### blood_thorn.lua ###

Blood Thorn Planks=Assi di spina del sangue
Blood Thorn Spike=Spuntone di spina del sangue
Blood Thorn Stem=Gambo di spina del sangue
Dead Blood Thorn Spike=Spuntone di spina del sangue morta
Dead Blood Thorn Stem=Gambo di spina del sangue morta

### doc.lua ###

@1 have an unusual biochemistry that allows them to somehow subsist on ambient heat, in violation of all known laws of thermodynamics. They grow deep underground in frigid, icy caverns that should by all rights be volcanic.=

@1 wood, in addition to being a beautiful blue hue, retains the odd heat-draining ability of living icecaps and is able to quickly freeze nearby water solid.=

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
A torchspine alternates between active and quiescent phases and emits dim light when active. They can be harvested for torches, and their embers sprout into new torchspines when placed on flammable surfaces.=Una torcia alterna le fasi attiva e quiescente ed emette una luce fioca quando è attiva. Possono essere raccolti per le torce e le loro braci germogliano in nuove spine delle torce quando vengono posizionate su superfici infiammabili.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Aside from the artistic applications of its particularly dark color, black cap wood is a long-burning fuel source that's as good as coal for some applications. Black cap gills are oily and make for excellent torch fuel.=A parte le applicazioni artistiche del suo colore particolarmente scuro, il legno del cappello nero è una fonte di combustibile a combustione lunga che è buona come il carbone per alcune applicazioni. Le branchie del cappuccio nero sono oleose e costituiscono un eccellente combustibile per la torcia.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Blood thorns are the most vicious of underground flora, as befits their harsh environments. Found only in hot, dry caverns with sandy soil far from the surface world's organic bounty, blood thorns seek to supplement their nutrient supply with wickedly barbed hollow spines that actively drain fluids from whatever stray plant or creature they might impale.=Le spine di sangue sono le più viziose della flora sotterranea, come si addice ai loro ambienti ostili. Trovate solo in caverne calde e asciutte con terreno sabbioso lontano dalla generosità organica del mondo di superficie, le spine di sangue cercano di integrare il loro apporto di nutrienti con spine cave malvagie che drenano attivamente i fluidi da qualsiasi pianta o creatura vagante che potrebbero impalare.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Cyan Spindlestems are a sign of both copper and iron deposits nearby. Their glowing symbiotes can be extracted as a long-lived light source.=Gli spindlestem ciano sono un segno di depositi di rame e ferro nelle vicinanze. I loro simbionti luminosi possono essere estratti come fonte di luce a lunga durata.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Fungiwood stalk is strong and very fine-grained, making smooth yellow-tinted lumber when cut. Fungiwood shelf is too fragile to be much use as anything other than fuel.=Il gambo di legno di fungo è forte e a grana molto fine, quando viene tagliato produce legname liscio di colore giallo. La mensola in legno di fungo è troppo fragile per essere utilizzata come qualcosa di diverso dal carburante.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Goblin cap stem and cap material can be cut into wood of two different hues, a subdued cream and a bright orange-red.=Il gambo e il materiale del cappuccio del goblin possono essere tagliati in legno di due diverse tonalità, una crema tenue e un rosso arancio brillante.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Golden Spindlestems are a sign of rare and magical mineral deposits nearby. Their glowing symbiotes can be extracted as a strong and long-lived light source.=I Golden Spindlestems sono un segno di depositi minerali rari e magici nelle vicinanze. I loro simbionti luminosi possono essere estratti come una fonte di luce forte e di lunga durata.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Green Spindlestems are a sign of nearby copper deposits. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is not strong.=Gli spindlestem verdi sono un segno di depositi di rame nelle vicinanze. I loro simbionti luminosi possono essere estratti come fonte di luce a lunga durata, sebbene il bagliore non sia forte.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living blood thorn spikes remain harmful to creatures that touch them. If killed by bright light, they cause only passive damage to creatures that fall on them (as one would expect from an enormous spike).=Le punte di spine di sangue vivo rimangono dannose per le creature che le toccano. Se uccisi da una luce intensa, causano solo danni passivi alle creature che cadono su di loro (come ci si aspetterebbe da un enorme picco).

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a cyan Spindlestem.=Estratto vivo dal tappo di uno Spindlestem ciano.
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a green Spindlestem.=Estratto vivo dal cappello di uno Spindlestem verde.
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a red Spindlestem.=Estratto vivo dal cappello di uno Spindlestem rosso.
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Living extract from the cap of a yellow Spindlestem.=Estratto vivo dal cappello di uno Spindlestem giallo.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Massive but squat, mature goblin cap mushrooms are the size of small cottages.=I funghi goblin sono grandi ma tozzi e maturi, hanno le dimensioni di piccoli cottage.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Red Spindlestems are a sign of nearby iron deposits - or perhaps Goblin Caps. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is weak.=I Red Spindlestems sono un segno di depositi di ferro vicini - o forse Goblin Caps. I loro simbionti luminosi possono essere estratti come fonte di luce a lunga durata, anche se il bagliore è debole.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spindlestems are too big to easily pluck by hand but too small to be called a proper tree. Nevertheless, they are a common and useful resource for underground travelers - particularly their glowing caps.=Gli spindlestem sono troppo grandi per essere strappati facilmente a mano ma troppo piccoli per essere definiti un albero vero e proprio. Tuttavia, sono una risorsa comune e utile per i viaggiatori sotterranei, in particolare i loro berretti luminosi.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore tree trunks can be cut into pale woody planks. The branching fibers and fruiting bodies are only useful as fuel.=I tronchi degli alberi di spore possono essere tagliati in assi legnose chiare. Le fibre ramificate e i corpi fruttiferi sono utili solo come combustibile.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Spore trees have a sturdy 'trunk' that supports a large spongy mesh of branching fibers, with embedded fruiting bodies that produce a copious amount of spores that gently rain down around the spore tree's base.=Gli alberi di spore hanno un robusto "tronco" che sostiene una grande rete spugnosa di fibre ramificate, con corpi fruttiferi incorporati che producono una copiosa quantità di spore che piovono delicatamente intorno alla base dell'albero di spore.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a brilliant yellow due to symbiotic microorganisms.=Il cappuccio di uno Spindlestem, che brilla di un giallo brillante a causa di microrganismi simbiotici.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a soft green due to symbiotic microorganisms.=Il cappuccio di uno Spindlestem, che emette un colore verde tenue a causa di microrganismi simbiotici.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a strong cyan due to symbiotic microorganisms.=Il cappuccio di uno Spindlestem, che emette un forte colore ciano a causa di microrganismi simbiotici.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, glowing a weak red due to symbiotic microorganisms.=Il cappuccio di uno Spindlestem, che brilla di un debole rosso a causa di microrganismi simbiotici.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The cap of a Spindlestem, uncontaminated by any symbiotic luminescent microorganisms.=Il cappuccio di uno Spindlestem, incontaminato da eventuali microrganismi luminescenti simbiotici.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The dense black wood of these mushrooms is heavy and hard to work with, and has few remarkable properties.=Il denso legno nero di questi funghi è pesante e difficile da lavorare e ha poche proprietà notevoli.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The king of the fungi, tower cap mushrooms grow to immense proportions.=Il re dei funghi, i funghi con cappuccio a torre crescono in proporzioni immense.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The spikes of a blood thorn can actually remain living long after they're severed from their parent stalk, a testament to their tenacity. As long as they remain alive they will continue to actively drain anything they puncture, though they don't grow.=Le punte di una spina di sangue possono effettivamente rimanere in vita molto tempo dopo essere state separate dal gambo dei genitori, a testimonianza della loro tenacia. Finché rimangono in vita continueranno a drenare attivamente tutto ciò che forano, anche se non crescono.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The stem of a Spindlestem is surprisingly sturdy, and despite their thinness they can grow quite tall. They can be used as a wood substitute in many crafting recipes.=Lo stelo di uno Spindlestem è sorprendentemente robusto e nonostante la loro magrezza possono crescere abbastanza alti. Possono essere usati come sostituti del legno in molte ricette di lavorazione.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The trunk of a tunnel tube can be cut and processed to produce plywood-like material.=Il tronco di un tubo a tunnel può essere tagliato e lavorato per produrre materiale simile al compensato.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
The trunk of a tunnel tube can be cut and processed to produce plywood-like material. The fruiting body accumulates high-energy compounds that, when ignited, produce a vigorous detonation - a unique adaptation for spreading tunnel tube spawn through the still cavern air.=Il tronco di un tubo a tunnel può essere tagliato e lavorato per produrre materiale simile al compensato. Il corpo fruttifero accumula composti ad alta energia che, una volta innescati, producono una vigorosa detonazione - un adattamento unico per diffondere le uova del tubo del tunnel attraverso l'aria tranquilla della caverna.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
These things are useless except as weak fuel for a fire.=Queste cose sono inutili se non come combustibile debole per un incendio.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Thin, irregular layers of spore-producing 'shelves' surround the strong central stalk of the mighty Fungiwood.=Strati sottili e irregolari di "mensole" che producono spore circondano il robusto gambo centrale del potente Fungiwood.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Torchspines are strange organic formations that are alive only in a technical sense. They "feed" on volatile flammable vapors vented up through their structure, growing from combustion residue deposited at their tips.=Le torce sono strane formazioni organiche che sono vive solo in senso tecnico. Si "nutrono" di vapori volatili infiammabili emessi attraverso la loro struttura, che crescono dai residui di combustione depositati alle loro estremità.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tower caps are an excellent source of wood.=I cappucci delle torri sono un'ottima fonte di legno.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Tunnel tubes are hollow, curved fungal growths that support a fruiting body.=I tubi del tunnel sono escrescenze fungine cave e ricurve che supportano un corpo fruttifero.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
When harvested, the central stalk of a blood thorn can be cut into planks and used as wood. It has a purple-red hue that may or may not appeal, depending on one's artistic tastes.=Quando viene raccolto, il gambo centrale di una spina sanguigna può essere tagliato in assi e usato come legno. Ha una tonalità rosso porpora che può piacere o meno, a seconda dei gusti artistici.

### fungiwood.lua ###

Fungiwood Planks=Assi di fungo di legno
Fungiwood Shelf=Mensola di fungo di legno
Fungiwood Spawn=Prole di fungo di legno
Fungiwood Stem=Gambo di fungo di legno

### goblin_cap.lua ###

Goblin Cap=Cappello di folletto
Goblin Cap Gills=Lamelle di cappello di folletto
Goblin Cap Planks=Assi di cappello di folletto
Goblin Cap Spawn=Prole di cappello di folletto
Goblin Cap Stem=Gambo di cappello di folletto
Goblin Cap Stem Planks=Assi di gambo di cappello di folletto

### nether_cap.lua ###

@1 Gills=Lamelle di @1
@1 Planks=Assi di @1
@1 Spawn=Prole di @1
@1 Stem=Gambo di @1

### spindlestem.lua ###

@1 Spindlestem Cap=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
@1 Spindlestem Extract=@1 Estratto di Spindlestem
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Cyan=Ciano
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Golden=D'oro
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Green=Verde
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Red=Rosso
Spindlestem=
Spindlestem Spawn=Prole di albero delle spore
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
White=Bianca

### spore_tree.lua ###

Spore Tree Fruiting Body=Corpo fruttifero dell'albero delle spore
Spore Tree Hyphae=Ife di albero delle spore
Spore Tree Ladder=Ife di albero delle spore
Spore Tree Planks=Assi di albero delle spore
Spore Tree Spawn=Prole di albero delle spore
Spore Tree Stem=Gambo di albero delle spore

### torchspine.lua ###

Torchspine=
Torchspine Ember=
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Torchspine Tip=Punta Torchspine

### tower_cap.lua ###

Tower Cap=Cappello a torre
Tower Cap Gills=Lamelle di cappello a torre
Tower Cap Planks=Assi di cappello a torre
Tower Cap Spawn=Prole di cappello a torre
Tower Cap Stem=Gambo di cappello a torre

### tunnel_tube.lua ###

Tunnel Tube=Tubo di galleria
Tunnel Tube Fruiting Body=Corpo fruttifero del tubo di galleria
Tunnel Tube Plies=Strati di tubo di galleria
Tunnel Tube Spawn=Prole di tubo di galleria

##### not used anymore #####

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Nether cap wood, in addition to being a beautiful blue hue, retains the odd heat-draining ability of living nether caps and is able to quickly freeze nearby water solid.=Il legno del cappuccio inferiore, oltre ad essere una bella tonalità blu, conserva la strana capacità di drenaggio del calore dei tappi inferiori viventi ed è in grado di congelare rapidamente l'acqua solida vicina.

#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
Nether caps have an unusual biochemistry that allows them to somehow subsist on ambient heat, in violation of all known laws of thermodynamics. They grow deep underground in frigid, icy caverns that should by all rights be volcanic.=I cappucci inferiori hanno una biochimica insolita che consente loro di sopravvivere in qualche modo al calore ambientale, in violazione di tutte le leggi conosciute della termodinamica. Crescono in profondità nel sottosuolo in caverne gelide che dovrebbero a tutti gli effetti essere vulcaniche.

repo_name: korkut/MeseCraft

license: mit


code:
# textdomain: df_trees

### black_cap.lua ###

Black Cap=
Black Cap Gills=
Black Cap Planks=
Black Cap Spawn=
Black Cap Stem=

### blood_thorn.lua ###

Blood Thorn Planks=
Blood Thorn Spike=
Blood Thorn Stem=
Dead Blood Thorn Spike=
Dead Blood Thorn Stem=

### doc.lua ###

@1 have an unusual biochemistry that allows them to somehow subsist on ambient heat, in violation of all known laws of thermodynamics. They grow deep underground in frigid, icy caverns that should by all rights be volcanic.=

@1 wood, in addition to being a beautiful blue hue, retains the odd heat-draining ability of living icecaps and is able to quickly freeze nearby water solid.=

A torchspine alternates between active and quiescent phases and emits dim light when active. They can be harvested for torches, and their embers sprout into new torchspines when placed on flammable surfaces.=

Aside from the artistic applications of its particularly dark color, black cap wood is a long-burning fuel source that's as good as coal for some applications. Black cap gills are oily and make for excellent torch fuel.=

Blood thorns are the most vicious of underground flora, as befits their harsh environments. Found only in hot, dry caverns with sandy soil far from the surface world's organic bounty, blood thorns seek to supplement their nutrient supply with wickedly barbed hollow spines that actively drain fluids from whatever stray plant or creature they might impale.=

Cyan Spindlestems are a sign of both copper and iron deposits nearby. Their glowing symbiotes can be extracted as a long-lived light source.=

Fungiwood stalk is strong and very fine-grained, making smooth yellow-tinted lumber when cut. Fungiwood shelf is too fragile to be much use as anything other than fuel.=

Goblin cap stem and cap material can be cut into wood of two different hues, a subdued cream and a bright orange-red.=

Golden Spindlestems are a sign of rare and magical mineral deposits nearby. Their glowing symbiotes can be extracted as a strong and long-lived light source.=

Green Spindlestems are a sign of nearby copper deposits. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is not strong.=

Living blood thorn spikes remain harmful to creatures that touch them. If killed by bright light, they cause only passive damage to creatures that fall on them (as one would expect from an enormous spike).=

Living extract from the cap of a cyan Spindlestem.=
Living extract from the cap of a green Spindlestem.=
Living extract from the cap of a red Spindlestem.=
Living extract from the cap of a yellow Spindlestem.=

Massive but squat, mature goblin cap mushrooms are the size of small cottages.=

Red Spindlestems are a sign of nearby iron deposits - or perhaps Goblin Caps. Their glowing symbiotes can be extracted as a long-lived light source, though the glow is weak.=

Spindlestems are too big to easily pluck by hand but too small to be called a proper tree. Nevertheless, they are a common and useful resource for underground travelers - particularly their glowing caps.=

Spore tree trunks can be cut into pale woody planks. The branching fibers and fruiting bodies are only useful as fuel.=

Spore trees have a sturdy 'trunk' that supports a large spongy mesh of branching fibers, with embedded fruiting bodies that produce a copious amount of spores that gently rain down around the spore tree's base.=

The cap of a Spindlestem, glowing a brilliant yellow due to symbiotic microorganisms.=

The cap of a Spindlestem, glowing a soft green due to symbiotic microorganisms.=

The cap of a Spindlestem, glowing a strong cyan due to symbiotic microorganisms.=

The cap of a Spindlestem, glowing a weak red due to symbiotic microorganisms.=

The cap of a Spindlestem, uncontaminated by any symbiotic luminescent microorganisms.=

The dense black wood of these mushrooms is heavy and hard to work with, and has few remarkable properties.=

The king of the fungi, tower cap mushrooms grow to immense proportions.=

The spikes of a blood thorn can actually remain living long after they're severed from their parent stalk, a testament to their tenacity. As long as they remain alive they will continue to actively drain anything they puncture, though they don't grow.=

The stem of a Spindlestem is surprisingly sturdy, and despite their thinness they can grow quite tall. They can be used as a wood substitute in many crafting recipes.=

The trunk of a tunnel tube can be cut and processed to produce plywood-like material.=

The trunk of a tunnel tube can be cut and processed to produce plywood-like material. The fruiting body accumulates high-energy compounds that, when ignited, produce a vigorous detonation - a unique adaptation for spreading tunnel tube spawn through the still cavern air.=

These things are useless except as weak fuel for a fire.=

Thin, irregular layers of spore-producing 'shelves' surround the strong central stalk of the mighty Fungiwood.=

Torchspines are strange organic formations that are alive only in a technical sense. They "feed" on volatile flammable vapors vented up through their structure, growing from combustion residue deposited at their tips.=

Tower caps are an excellent source of wood.=

Tunnel tubes are hollow, curved fungal growths that support a fruiting body.=

When harvested, the central stalk of a blood thorn can be cut into planks and used as wood. It has a purple-red hue that may or may not appeal, depending on one's artistic tastes.=

### fungiwood.lua ###

Fungiwood Planks=
Fungiwood Shelf=
Fungiwood Spawn=
Fungiwood Stem=

### goblin_cap.lua ###

Goblin Cap=
Goblin Cap Gills=
Goblin Cap Planks=
Goblin Cap Spawn=
Goblin Cap Stem=
Goblin Cap Stem Planks=

### nether_cap.lua ###

@1 Gills=
@1 Planks=
@1 Spawn=
@1 Stem=

### spindlestem.lua ###

@1 Spindlestem Cap=
@1 Spindlestem Extract=
Cyan=
Golden=
Green=
Red=
Spindlestem=
Spindlestem Spawn=
White=

### spore_tree.lua ###

Spore Tree Fruiting Body=
Spore Tree Hyphae=
Spore Tree Ladder=
Spore Tree Planks=
Spore Tree Spawn=
Spore Tree Stem=

### torchspine.lua ###

Torchspine=
Torchspine Ember=
Torchspine Tip=

### tower_cap.lua ###

Tower Cap=
Tower Cap Gills=
Tower Cap Planks=
Tower Cap Spawn=
Tower Cap Stem=

### tunnel_tube.lua ###

Tunnel Tube=
Tunnel Tube Fruiting Body=
Tunnel Tube Plies=
Tunnel Tube Spawn=


code:
name = df_trees
description = Adds various types of underground fungal "trees". Light kills their saplings, they only grow in the dark.
depends = df_dependencies
optional_depends = doc, basic_materials, df_farming, mapgen_helper, looped_node_sound


code:
local S = minetest.get_translator(minetest.get_current_modname())

local nethercap_name = df_dependencies.nethercap_name

--stem
minetest.register_node("df_trees:nether_cap_stem", {
	description = S("@1 Stem", nethercap_name),
	_doc_items_longdesc = df_trees.doc.nether_cap_desc,
	_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
	tiles = {"dfcaverns_nether_cap_stem.png"},
	is_ground_content = false,
	groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1, handy=1,axey=1, building_block=1, material_wood=1},
	sounds = df_dependencies.sound_wood(),
	_mcl_blast_resistance = 0.7,
	_mcl_hardness = 0.7,
})

--cap
minetest.register_node("df_trees:nether_cap", {
	description = nethercap_name,
	_doc_items_longdesc = df_trees.doc.nether_cap_desc,
	_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
	tiles = {"dfcaverns_nether_cap.png"},
	is_ground_content = false,
	groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1, handy=1,axey=1, building_block=1, material_wood=1},
	sounds = df_dependencies.sound_wood({footstep = {name = df_dependencies.soundfile_snow_footstep, gain = 0.2},}),
	_mcl_blast_resistance = 0.5,
	_mcl_hardness = 0.5,
})

--gills
minetest.register_node("df_trees:nether_cap_gills", {
	description = S("@1 Gills", nethercap_name),
	_doc_items_longdesc = df_trees.doc.nether_cap_desc,
	_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
	tiles = {"dfcaverns_nether_cap_gills.png"},
	is_ground_content = false,
	light_source = 6,
	groups = {snappy = 3, leafdecay = 1, leaves = 1, puts_out_fire = 1, cools_lava = 1, freezes_water = 1, nether_cap = 1,handy=1, hoey=1, shearsy=1, swordy=1, deco_block=1, dig_by_piston=1},
	sounds = df_dependencies.sound_leaves(),
	drawtype = "plantlike",
	paramtype = "light",
	drop = {
		max_items = 1,
		items = {
			{
				items = {'df_trees:nether_cap_sapling'},
				rarity = 5,
			},
			{
				items = {'df_trees:nether_cap_gills'},
			}
		}
	},
	after_place_node = df_dependencies.after_place_leaves,
	place_param2 = 1, -- Prevent leafdecay for placed nodes
	_mcl_blast_resistance = 0.1,
	_mcl_hardness = 0.1,
})

df_dependencies.register_leafdecay({
	trunks = {"df_trees:nether_cap"}, -- don't need stem nodes here
	leaves = {"df_trees:nether_cap_gills"},
	radius = 1,
})

--Wood
minetest.register_craft({
	output = 'df_trees:nether_cap_wood 4',
	recipe = {
		{'df_trees:nether_cap'},
	}
})

minetest.register_craft({
	output = 'df_trees:nether_cap_wood 4',
	recipe = {
		{'df_trees:nether_cap_stem'},
	}
})

minetest.register_node("df_trees:nether_cap_wood", {
	description = S("@1 Planks", nethercap_name),
	_doc_items_longdesc = df_trees.doc.nether_cap_desc,
	_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
	paramtype2 = "facedir",
	place_param2 = 0,
	tiles = {"dfcaverns_nether_cap_wood.png"},
	is_ground_content = false,
	groups = {choppy = 2, oddly_breakable_by_hand = 2, wood = 1, freezes_water = 1, handy=1,axey=1,building_block=1, material_wood=1},
	sounds = df_dependencies.sound_wood(),
	_mcl_blast_resistance = 0.5,
	_mcl_hardness = 0.5,
})

df_dependencies.register_all_stairs_and_fences("nether_cap_wood")

-- sapling
minetest.register_node("df_trees:nether_cap_sapling", {
	description = S("@1 Spawn", nethercap_name),
	_doc_items_longdesc = df_trees.doc.nether_cap_desc,
	_doc_items_usagehelp = df_trees.doc.nether_cap_usage,
	drawtype = "plantlike",
	visual_scale = 1.0,
	tiles = {"dfcaverns_nether_cap_sapling.png"},
	inventory_image = "dfcaverns_nether_cap_sapling.png",
	wield_image = "dfcaverns_nether_cap_sapling.png",
	paramtype = "light",
	sunlight_propagates = true,
	walkable = false,
	is_ground_content = false,
	floodable = true, -- nether cap spawn aren't tough enough to freeze water yet
	selection_box = {
		type = "fixed",
		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
	},
	groups = {snappy = 2, dig_immediate = 3,
		attached_node = 1, sapling = 1, light_sensitive_fungus = 11, dig_immediate=3,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1},
	sounds = df_dependencies.sound_leaves(),
	_mcl_blast_resistance = 0.1,
	_mcl_hardness = 0.1,

	on_construct = function(pos)
		if df_trees.nether_cap_growth_permitted(pos) then
			minetest.get_node_timer(pos):start(math.random(
				df_trees.config.nether_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
				df_trees.config.nether_cap_delay_multiplier*df_trees.config.tree_max_growth_delay))
		end
	end,
	on_destruct = function(pos)
		minetest.get_node_timer(pos):stop()
	end,

	on_timer = function(pos)
		if df_farming and df_farming.kill_if_sunlit(pos) then
			return
		end

		minetest.set_node(pos, {name="air"})
		df_trees.spawn_nether_cap(pos)
	end,
})

local c_stem = minetest.get_content_id("df_trees:nether_cap_stem")
local c_cap  = minetest.get_content_id("df_trees:nether_cap")
local c_gills  = minetest.get_content_id("df_trees:nether_cap_gills")

df_trees.spawn_nether_cap = function(pos)
	local x, y, z = pos.x, pos.y, pos.z
	local stem_height = math.random(1,3)
	local cap_radius = math.random(2,3)
	local maxy = y + stem_height + 3

	local vm = minetest.get_voxel_manip()
	local minp, maxp = vm:read_from_map(
		{x = x - cap_radius, y = y, z = z - cap_radius},
		{x = x + cap_radius, y = maxy + 3, z = z + cap_radius}
	)
	local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
	local data = vm:get_data()

	subterrane.giant_mushroom(area:indexp(pos), area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)

	vm:set_data(data)
	vm:write_to_map()
	vm:update_map()
end

df_trees.spawn_nether_cap_vm = function(vi, area, data)
	local stem_height = math.random(1,3)
	local cap_radius = math.random(2,3)
	subterrane.giant_mushroom(vi, area, data, c_stem, c_cap, c_gills, stem_height, cap_radius)
end

local water = df_dependencies.node_name_water_source
local river_water = df_dependencies.node_name_river_water_source
local ice = df_dependencies.node_name_ice
local water_flowing = df_dependencies.node_name_water_flowing
local river_water_flowing = df_dependencies.node_name_river_water_flowing
local snow = df_dependencies.node_name_snow

minetest.register_abm{
	label = "water freezing",
	nodenames = {water, river_water,},
	neighbors = {"group:freezes_water"},
	interval = 1,
	chance = 5,
	catch_up = true,
	action = function(pos)
		minetest.swap_node(pos, {name=ice})
	end,
}

minetest.register_abm{
	label = "flowing water freezing",
	nodenames = {water_flowing,  river_water_flowing},
	neighbors = {"group:freezes_water"},
	interval = 1,
	chance = 1,
	catch_up = true,
	action = function(pos)
		minetest.swap_node(pos, {name=snow})
	end,
}


code:
-- these methods should indicate whether a sapling placed at pos should bother attempting to grow.
-- check soil conditions and biome here, for example.

local stone_with_coal = df_dependencies.node_name_stone_with_coal
local coalblock = df_dependencies.node_name_coalblock
local is_coal = function(name)
	return name == stone_with_coal or name == coalblock
end

df_trees.black_cap_growth_permitted = function(pos)
	local below_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
	return minetest.get_item_group(below_name, "soil") > 0 or is_coal(below_name)
end

df_trees.blood_thorn_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "sand") > 0
end

df_trees.fungiwood_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") > 0
end

df_trees.goblin_cap_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") > 0
end

df_trees.nether_cap_growth_permitted = function(pos)
	local below_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
	return (minetest.get_item_group(below_name, "cools_lava") > 0 or minetest.get_item_group(below_name, "ice") > 0)
		and minetest.get_item_group(below_name, "nether_cap") == 0
end

df_trees.spindlestem_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") > 0
end

df_trees.spore_tree_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") > 0
end

df_trees.torchspine_growth_permitted = function(pos)
	local below_name = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name
	return minetest.get_item_group(below_name, "flammable") > 0 or is_coal(below_name)
end

df_trees.tower_cap_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") > 0
end

df_trees.tunnel_tube_growth_permitted = function(pos)
	return minetest.get_item_group(minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z}).name, "soil") > 0
end


code:
local n1 = { name = "air", prob = 0 } -- external air
local n2 = { name = "df_trees:goblin_cap" }
local n3 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 2} -- porch top
local n4 = { name = "df_trees:goblin_cap_gills" }
local n6 = { name = "df_trees:goblin_cap_stem", force_place=true } -- walls
local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- internal floor
local n8 = { name = df_dependencies.node_name_door_wood_a or "air", force_place=true }
local n9 = { name = df_dependencies.node_name_door_hidden or "air", force_place=true }
local n10 = { name = df_dependencies.node_name_furnace, param2 = 3, force_place=true }
local n11 = { name = "air", force_place=true } -- internal air
local n12 = { name = df_dependencies.node_name_bed_bottom or "air", force_place=true }
local n13 = { name = "df_trees:goblin_cap_stem", prob = 198, force_place=true } -- possible window holes
local n16 = { name = df_dependencies.node_name_chest, param2 = 3, force_place=true }
local n17 = { name = df_dependencies.node_name_bed_top or "air", force_place=true }
local n18 = { name = df_dependencies.node_name_torch_wall, param2 = 4, force_place=true }
local n19 = { name = "df_trees:goblin_cap_stem" } -- base

local n20 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood, param2 = 1 }
local n21 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood, param2 = 3 }
local n22 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 22}

if minetest.get_modpath("vessels") then
	n18 = { name = "df_trees:glowing_bottle_red", force_place=true}
end

if not df_dependencies.node_name_stair_goblin_cap_stem_wood then
	-- replace stairs with air
	n3 = n1
	n20 = n1
	n21 = n1
	n22 = n1
end

local schematic = {
	yslice_prob = {},
	size = {y = 9, x = 11, z = 11},
	center_pos = {x=5, y=2, z=5},
	data = {
		-- z=0, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=5
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,
		-- z=0, y=6
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=7
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=1, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=3
		n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1,
		-- z=1, y=4
		n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1,
		-- z=1, y=5
		n1, n1, n2, n2, n2, n4, n2, n2, n2, n1, n1,
		-- z=1, y=6
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,
		-- z=1, y=7
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=2, y=0
		n1, n1, n1, n22, n1, n1, n1, n22, n1, n1, n1,
		-- z=2, y=1
		n1, n1, n1, n1, n20, n1, n21, n1, n1, n1, n1,
		-- z=2, y=2
		n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1,
		-- z=2, y=3
		n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1,
		-- z=2, y=4
		n1, n1, n1, n1, n1, n11, n1, n1, n1, n1, n1,
		-- z=2, y=5
		n1, n2, n2, n4, n4, n4, n4, n4, n2, n2, n1,
		-- z=2, y=6
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=2, y=7
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,
		-- z=2, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=3, y=0
		n1, n1, n1, n3, n19, n19, n19, n3, n1, n1, n1,
		-- z=3, y=1
		n1, n1, n1, n1, n19, n19, n19, n1, n1, n1, n1,
		-- z=3, y=2
		n1, n1, n1, n1, n6, n7, n6, n1, n1, n1, n1,
		-- z=3, y=3
		n1, n1, n1, n1, n6, n8, n6, n1, n1, n1, n1,
		-- z=3, y=4
		n1, n1, n1, n1, n6, n9, n6, n1, n1, n1, n1,
		-- z=3, y=5
		n1, n2, n4, n4, n6, n6, n6, n4, n4, n2, n1,
		-- z=3, y=6
		n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1,
		-- z=3, y=7
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=3, y=8
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,

		-- z=4, y=0
		n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1,
		-- z=4, y=1
		n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1,
		-- z=4, y=2
		n1, n1, n1, n6, n7, n7, n7, n6, n1, n1, n1,
		-- z=4, y=3
		n1, n1, n1, n6, n10, n11, n11, n6, n1, n1, n1,
		-- z=4, y=4
		n1, n1, n1, n6, n11, n11, n11, n6, n1, n1, n1,
		-- z=4, y=5
		n1, n2, n4, n6, n11, n11, n11, n6, n4, n2, n1,
		-- z=4, y=6
		n1, n1, n2, n2, n6, n6, n6, n2, n2, n1, n1,
		-- z=4, y=7
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=4, y=8
		n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1,

		-- z=5, y=0
		n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1,
		-- z=5, y=1
		n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1,
		-- z=5, y=2
		n1, n1, n1, n6, n7, n7, n7, n6, n1, n1, n1,
		-- z=5, y=3
		n1, n1, n1, n6, n11, n11, n12, n6, n1, n1, n1,
		-- z=5, y=4
		n1, n1, n1, n13, n11, n11, n11, n13, n1, n1, n1,
		-- z=5, y=5
		n2, n4, n4, n6, n11, n11, n11, n6, n4, n4, n2,
		-- z=5, y=6
		n1, n2, n2, n2, n6, n11, n6, n2, n2, n2, n1,
		-- z=5, y=7
		n1, n1, n2, n2, n2, n6, n2, n2, n2, n1, n1,
		-- z=5, y=8
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,

		-- z=6, y=0
		n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1,
		-- z=6, y=1
		n1, n1, n1, n19, n19, n19, n19, n19, n1, n1, n1,
		-- z=6, y=2
		n1, n1, n1, n6, n7, n7, n7, n6, n1, n1, n1,
		-- z=6, y=3
		n1, n1, n1, n6, n16, n11, n17, n6, n1, n1, n1,
		-- z=6, y=4
		n1, n1, n1, n6, n18, n11, n11, n6, n1, n1, n1,
		-- z=6, y=5
		n1, n2, n4, n6, n11, n11, n11, n6, n4, n2, n1,
		-- z=6, y=6
		n1, n1, n2, n2, n6, n6, n6, n2, n2, n1, n1,
		-- z=6, y=7
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=6, y=8
		n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1,

		-- z=7, y=0
		n1, n1, n1, n1, n19, n19, n19, n1, n1, n1, n1,
		-- z=7, y=1
		n1, n1, n1, n1, n19, n19, n19, n1, n1, n1, n1,
		-- z=7, y=2
		n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1,
		-- z=7, y=3
		n1, n1, n1, n1, n6, n6, n6, n1, n1, n1, n1,
		-- z=7, y=4
		n1, n1, n1, n1, n6, n13, n6, n1, n1, n1, n1,
		-- z=7, y=5
		n1, n2, n4, n4, n6, n6, n6, n4, n4, n2, n1,
		-- z=7, y=6
		n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1,
		-- z=7, y=7
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=7, y=8
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,

		-- z=8, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=8, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=8, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=8, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=8, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=8, y=5
		n1, n2, n2, n4, n4, n4, n4, n4, n2, n2, n1,
		-- z=8, y=6
		n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=8, y=7
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,
		-- z=8, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=9, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=9, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=9, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=9, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=9, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=9, y=5
		n1, n1, n2, n2, n2, n4, n2, n2, n2, n1, n1,
		-- z=9, y=6
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,
		-- z=9, y=7
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=9, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=10, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=5
		n1, n1, n1, n1, n1, n2, n1, n1, n1, n1, n1,
		-- z=10, y=6
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=7
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
}
}

for index, node in ipairs(schematic.data) do
	assert(node.name ~= nil, "undefined node name for index " .. tostring(index) .. " in goblin_cap_big_hut schematic data")
end

return schematic


code:
local n1 = { name = "air" } -- external air
local n2 = { name = "df_trees:goblin_cap_stem"} -- below ground, don't force place these
local n3 = { name = "df_trees:goblin_cap" }
local n4 = { name = "df_trees:goblin_cap_gills" }
local n5 = { name = "df_trees:goblin_cap_stem", force_place = true } -- walls, force place these
local n6 = { name = "df_trees:goblin_cap_stem", prob = 198, force_place=true } -- possible window holes
local n7 = { name = "df_trees:goblin_cap_stem_wood", force_place=true } -- internal floor
local n8 = { name = df_dependencies.node_name_furnace, param2 = 2, force_place=true }
local n9 = { name = "air", force_place=true } -- internal air
local n10 = { name = df_dependencies.node_name_torch_wall, param2 = 3, force_place = true }
local n12 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 2} -- porch top
local n13 = { name = df_dependencies.node_name_door_wood_a or "air", param2 = 3, force_place = true }
local n14 = { name = df_dependencies.node_name_door_hidden or "air", param2 = 3, force_place = true }
local n15 = n9 -- internal air, but could be a vessel shelf
local n16 = { name = df_dependencies.node_name_bed_top or "air", param2 = 3, force_place = true }
local n17 = { name = df_dependencies.node_name_bed_bottom or "air", param2 = 3, force_place = true }
local n18 = { name = df_dependencies.node_name_chest, force_place = true }
local n19 = { name = df_dependencies.node_name_torch_wall, param2 = 2, force_place = true }
local n20 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood }
local n21 = {name = df_dependencies.node_name_stair_goblin_cap_stem_wood, param2 = 2 }
local n22 = {name = df_dependencies.node_name_slab_goblin_cap_stem_wood, param2 = 22}

if df_dependencies.node_name_shelf then
	-- replace torches with glowing bottles, add vessel shelf
	n10 = { name = "df_trees:glowing_bottle_red", force_place=true}
	n19 = n10
	n15 = { name = df_dependencies.node_name_shelf, param2 = 3, force_place = true }
end

local schematic = {
	yslice_prob = {},
	size = {y = 10, x = 13, z = 13},
	center_pos = {x=6, y=2, z=6},
	data = {
		-- z=0, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=5
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=6
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,
		-- z=0, y=7
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=0, y=9
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=1, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=5
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=6
		n1, n1, n1, n3, n3, n3, n4, n3, n3, n3, n1, n1, n1,
		-- z=1, y=7
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,
		-- z=1, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=1, y=9
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=2, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=2, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=2, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=2, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=2, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=2, y=5
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=2, y=6
		n1, n1, n3, n4, n4, n4, n4, n4, n4, n4, n3, n1, n1,
		-- z=2, y=7
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=2, y=8
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,
		-- z=2, y=9
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=3, y=0
		n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1,
		-- z=3, y=1
		n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1,
		-- z=3, y=2
		n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1,
		-- z=3, y=3
		n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1,
		-- z=3, y=4
		n1, n1, n1, n1, n1, n5, n6, n5, n1, n1, n1, n1, n1,
		-- z=3, y=5
		n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1,
		-- z=3, y=6
		n1, n3, n4, n4, n4, n4, n5, n4, n4, n4, n4, n3, n1,
		-- z=3, y=7
		n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1,
		-- z=3, y=8
		n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1,
		-- z=3, y=9
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,

		-- z=4, y=0
		n1, n1, n1, n1, n2, n2, n2, n2, n2, n12, n22, n1, n1,
		-- z=4, y=1
		n1, n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, n1,
		-- z=4, y=2
		n1, n1, n1, n1, n5, n7, n7, n7, n5, n1, n1, n1, n1,
		-- z=4, y=3
		n1, n1, n1, n1, n5, n8, n9, n9, n5, n1, n1, n1, n1,
		-- z=4, y=4
		n1, n1, n1, n1, n5, n10, n9, n9, n5, n1, n1, n1, n1,
		-- z=4, y=5
		n1, n1, n1, n1, n5, n5, n9, n5, n5, n1, n1, n1, n1,
		-- z=4, y=6
		n1, n3, n4, n4, n4, n5, n5, n5, n4, n4, n4, n3, n1,
		-- z=4, y=7
		n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1,
		-- z=4, y=8
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=4, y=9
		n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1,

		-- z=5, y=0
		n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=5, y=1
		n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n20, n1, n1,
		-- z=5, y=2
		n1, n1, n1, n5, n7, n7, n7, n7, n7, n5, n1, n1, n1,
		-- z=5, y=3
		n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1,
		-- z=5, y=4
		n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1,
		-- z=5, y=5
		n1, n1, n1, n5, n5, n9, n9, n9, n5, n5, n1, n1, n1,
		-- z=5, y=6
		n1, n3, n4, n4, n5, n9, n9, n9, n5, n4, n4, n3, n1,
		-- z=5, y=7
		n1, n1, n3, n3, n3, n5, n5, n5, n3, n3, n3, n1, n1,
		-- z=5, y=8
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=5, y=9
		n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1,

		-- z=6, y=0
		n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=6, y=1
		n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=6, y=2
		n1, n1, n1, n5, n7, n7, n7, n7, n7, n7, n12, n1, n1,
		-- z=6, y=3
		n1, n1, n1, n5, n9, n9, n9, n9, n9, n13, n9, n9, n1,
		-- z=6, y=4
		n1, n1, n1, n6, n9, n9, n9, n9, n9, n14, n9, n9, n1,
		-- z=6, y=5
		n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1,
		-- z=6, y=6
		n3, n4, n4, n5, n5, n9, n9, n9, n5, n5, n4, n4, n3,
		-- z=6, y=7
		n1, n3, n3, n3, n3, n5, n5, n5, n3, n3, n3, n3, n1,
		-- z=6, y=8
		n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1,
		-- z=6, y=9
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,

		-- z=7, y=0
		n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n1, n1, n1,
		-- z=7, y=1
		n1, n1, n1, n2, n2, n2, n2, n2, n2, n2, n21, n1, n1,
		-- z=7, y=2
		n1, n1, n1, n5, n7, n7, n7, n7, n7, n5, n1, n1, n1,
		-- z=7, y=3
		n1, n1, n1, n5, n15, n9, n9, n9, n9, n5, n1, n1, n1,
		-- z=7, y=4
		n1, n1, n1, n5, n9, n9, n9, n9, n9, n5, n1, n1, n1,
		-- z=7, y=5
		n1, n1, n1, n5, n5, n9, n9, n9, n5, n5, n1, n1, n1,
		-- z=7, y=6
		n1, n3, n4, n4, n5, n9, n9, n9, n5, n4, n4, n3, n1,
		-- z=7, y=7
		n1, n1, n3, n3, n3, n5, n5, n5, n3, n3, n3, n1, n1,
		-- z=7, y=8
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=7, y=9
		n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1,

		-- z=8, y=0
		n1, n1, n1, n1, n2, n2, n2, n2, n2, n12, n22, n1, n1,
		-- z=8, y=1
		n1, n1, n1, n1, n2, n2, n2, n2, n2, n1, n1, n1, n1,
		-- z=8, y=2
		n1, n1, n1, n1, n5, n7, n7, n7, n5, n1, n1, n1, n1,
		-- z=8, y=3
		n1, n1, n1, n1, n5, n16, n17, n18, n5, n1, n1, n1, n1,
		-- z=8, y=4
		n1, n1, n1, n1, n5, n9, n9, n19, n5, n1, n1, n1, n1,
		-- z=8, y=5
		n1, n1, n1, n1, n5, n5, n9, n5, n5, n1, n1, n1, n1,
		-- z=8, y=6
		n1, n3, n4, n4, n4, n5, n5, n5, n4, n4, n4, n3, n1,
		-- z=8, y=7
		n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1,
		-- z=8, y=8
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=8, y=9
		n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1,

		-- z=9, y=0
		n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1,
		-- z=9, y=1
		n1, n1, n1, n1, n1, n2, n2, n2, n1, n1, n1, n1, n1,
		-- z=9, y=2
		n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1,
		-- z=9, y=3
		n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1,
		-- z=9, y=4
		n1, n1, n1, n1, n1, n5, n6, n5, n1, n1, n1, n1, n1,
		-- z=9, y=5
		n1, n1, n1, n1, n1, n5, n5, n5, n1, n1, n1, n1, n1,
		-- z=9, y=6
		n1, n3, n4, n4, n4, n4, n5, n4, n4, n4, n4, n3, n1,
		-- z=9, y=7
		n1, n1, n3, n3, n3, n3, n3, n3, n3, n3, n3, n1, n1,
		-- z=9, y=8
		n1, n1, n1, n1, n3, n3, n3, n3, n3, n1, n1, n1, n1,
		-- z=9, y=9
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,

		-- z=10, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=5
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=10, y=6
		n1, n1, n3, n4, n4, n4, n4, n4, n4, n3, n3, n1, n1,
		-- z=10, y=7
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=10, y=8
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,
		-- z=10, y=9
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=11, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=5
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=6
		n1, n1, n1, n3, n3, n3, n3, n3, n3, n3, n1, n1, n1,
		-- z=11, y=7
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,
		-- z=11, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=11, y=9
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,

		-- z=12, y=0
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=1
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=2
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=3
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=4
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=5
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=6
		n1, n1, n1, n1, n1, n1, n3, n1, n1, n1, n1, n1, n1,
		-- z=12, y=7
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=8
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
		-- z=12, y=9
		n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1, n1,
}
}

for index, node in ipairs(schematic.data) do
	assert(node.name ~= nil, "undefined node name for index " .. tostring(index) .. " in goblin_cap_bigger_hut schematic data")
end

return schematic


code:
dfcaverns_tree_min_growth_delay (Minimum sapling growth delay) int 2400
dfcaverns_tree_max_growth_delay (Maximum sapling growth delay) int 4800
dfcaverns_fungiwood_delay_multiplier (fungiwood growth delay multiplier) float 1
dfcaverns_tunnel_tube_delay_multiplier (tunnel_tube growth delay multiplier) float 1
dfcaverns_spore_tree_delay_multiplier (spore_tree growth delay multiplier) float 1
dfcaverns_black_cap_delay_multiplier (black_cap growth delay multiplier) float 1
dfcaverns_nether_cap_delay_multiplier (nether_cap growth delay multiplier) float 1
dfcaverns_goblin_cap_delay_multiplier (goblin_cap growth delay multiplier) float 1
dfcaverns_tower_cap_delay_multiplier (tower_cap growth delay multiplier) float 1
dfcaverns_blood_thorn_delay_multiplier (blood_thorn growth delay multiplier) float 1


code:
local S = minetest.get_translator(minetest.get_current_modname())

local glass_bottle = df_dependencies.node_name_glass_bottle

-- pre-declare
local get_spindlestem_cap_type

-- Copied from subterrane's features.lua
-- Figured that was nicer than adding a dependency for just this little bit

local function copy_pointed_thing(pointed_thing)
	return {
		type  = pointed_thing.type,
		above = pointed_thing.above and vector.copy(pointed_thing.above),
		under = pointed_thing.under and vector.copy(pointed_thing.under),
		ref   = pointed_thing.ref,
	}
end

local stem_on_place = function(itemstack, placer, pointed_thing)
	local pt = pointed_thing
	-- check if pointing at a node
	if not pt then
		return itemstack
	end
	if pt.type ~= "node" then
		return itemstack
	end

	local under = minetest.get_node(pt.under)
	local above = minetest.get_node(pt.above)

	if minetest.is_protected(pt.above, placer:get_player_name()) then
		minetest.record_protection_violation(pt.above, placer:get_player_name())
		return
	end

	-- return if any of the nodes is not registered
	if not minetest.registered_nodes[under.name] or not minetest.registered_nodes[above.name] then
		return itemstack
	end
	-- check if you can replace the node above the pointed node
	if not minetest.registered_nodes[above.name].buildable_to then
		return itemstack
	end

	local new_param2
	-- check if pointing at an existing spindlestem
	if minetest.get_item_group(under.name, "spindlestem") > 0 then
		new_param2 = under.param2
	else
		new_param2 = math.random(0,3)
	end

	-- add the node and remove 1 item from the itemstack
	local newnode= {name = itemstack:get_name(), param2 = new_param2, param1=0}
	local oldnode= minetest.get_node(pt.above)
	minetest.add_node(pt.above, newnode)

	-- Run script hook
	local take_item = true
	for _, callback in ipairs(core.registered_on_placenodes) do
		-- Deepcopy pos, node and pointed_thing because callback can modify them
		local place_to_copy = vector.copy(pt.above)
		local newnode_copy = {name=newnode.name, param1=newnode.param1, param2=newnode.param2}
		local oldnode_copy = {name=oldnode.name, param1=oldnode.param1, param2=oldnode.param2}
		local pointed_thing_copy = copy_pointed_thing(pointed_thing)
		if callback(place_to_copy, newnode_copy, placer, oldnode_copy, itemstack, pointed_thing_copy) then
			take_item = false
		end
	end

	if not minetest.is_creative_enabled(placer:get_player_name()) and take_item then
		itemstack:take_item()
	end
	return itemstack
end

local growth_delay = function()
	return math.random(
		df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_min_growth_delay,
		df_trees.config.tower_cap_delay_multiplier*df_trees.config.tree_max_growth_delay)
end

local disp = 0.0625 -- adjusting position a bit

minetest.register_node("df_trees:spindlestem_stem", {
	description = S("Spindlestem"),
	_doc_items_longdesc = df_trees.doc.spindlestem_desc,
	_doc_items_usagehelp = df_trees.doc.spindlestem_usage,
	is_ground_content = false,
	groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindlestem = 1, handy=1,axey=1, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
	sounds = df_dependencies.sound_wood(),
	tiles = {
		"dfcaverns_tower_cap.png",
	},
	drawtype = "nodebox",
	paramtype = "light",
	paramtype2 = "facedir",
	sunlight_propagates = true,
	node_box = {
		type = "fixed",
		fixed = {
			{-0.0625+disp, -0.5, -0.125+disp, 0.1875+disp, 0.5, 0.25+disp},
			{-0.125+disp, -0.5, -0.0625+disp, 0.25+disp, 0.5, 0.1875+disp},
		}
	},
	on_place = stem_on_place,
	_mcl_blast_resistance = 2,
	_mcl_hardness = 2,
})

minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spindlestem_stem",
	burntime = 5,
})

local register_spindlestem_type = function(item_suffix, colour_name, colour_code, light_level, extract_color_group)
	local cap_item = "df_trees:spindlestem_cap_"..item_suffix
	local cap_item_harvested = "df_trees:spindlestem_cap_harvested_"..item_suffix

	local cap_def = {
		description = S("@1 Spindlestem Cap", colour_name),
		is_ground_content = false,
		_doc_items_longdesc = df_trees.doc["spindlestem_cap_"..item_suffix.."_desc"],
		_doc_items_usagehelp = df_trees.doc["spindlestem_cap_"..item_suffix.."_usage"],
		groups = {wood = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, spindlestem = 1, not_in_creative_inventory = 1, handy=1,axey=1, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
		sounds = df_dependencies.sound_wood(),
		tiles = {
			"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
			"dfcaverns_spindlestem_cap.png^[multiply:#"..colour_code,
			"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
			"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
			"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
			"dfcaverns_tower_cap.png^[multiply:#"..colour_code,
		},
		light_source = light_level,
		drawtype = "nodebox",
		paramtype = "light",
		paramtype2 = "facedir",
		sunlight_propagates = true,
		node_box = {
			type = "fixed",
			fixed = {
				{-0.1875+disp, -0.5, -0.3125+disp, 0.3125+disp, -0.3125, 0.4375+disp},
				{-0.3125+disp, -0.5, -0.1875+disp, 0.4375+disp, -0.3125, 0.3125+disp},
				{-0.0625+disp, -0.1875, -0.0625+disp, 0.1875+disp, -0.125, 0.1875+disp},
				{-0.1875+disp, -0.3125, -0.1875+disp, 0.3125+disp, -0.1875, 0.3125+disp},
			}
		},
		_mcl_blast_resistance = 2,
		_mcl_hardness = 2,

		drop = {
            -- Maximum number of items to drop
            max_items = 1,
            -- Choose max_items randomly from this list
            items = {
                {
                    items = {cap_item_harvested, "df_trees:spindlestem_seedling"},  -- Items to drop
                    rarity = 2,  -- Probability of dropping is 1 / rarity
                },
                {
                    items = {cap_item_harvested, "df_trees:spindlestem_seedling", "df_trees:spindlestem_seedling"},  -- Items to drop
                    rarity = 2,  -- Probability of dropping is 1 / rarity
                },
                {
                    items = {cap_item_harvested, "df_trees:spindlestem_seedling", "df_trees:spindlestem_seedling", "df_trees:spindlestem_seedling"},  -- Items to drop
                    rarity = 2,  -- Probability of dropping is 1 / rarity
                },
                {
                    items = {cap_item_harvested},  -- Items to drop
                    rarity = 1,  -- Probability of dropping is 1 / rarity
                },
            },
        },

		on_place = stem_on_place,
		on_timer = function(pos, elapsed)
			local meta = minetest.get_meta(pos)
			local height = meta:get_int("spindlestem_to_grow")
			local delay = meta:get_int("spindlestem_delay")
			if delay == 0 then
				delay = growth_delay() -- compatibility code to ensure no crash for previous version
			end
			local node = minetest.get_node(pos)

			while height > 0 and elapsed >= delay do
				elapsed = elapsed - delay
				local this_pos = pos
				pos = vector.add(this_pos, {x=0,y=1,z=0})
				local node_above = minetest.get_node(pos)
				local above_def = minetest.registered_nodes[node_above.name]
				if not above_def or not above_def.buildable_to then
					-- can't grow any more, exit
					return
				end
				minetest.set_node(this_pos, {name="df_trees:spindlestem_stem", param2 = node.param2})
				minetest.set_node(pos, {name=cap_item, param2 = node.param2})
				height = height - 1
			end

			if height > 0 then
				meta = minetest.get_meta(pos)
				meta:set_int("spindlestem_to_grow", height)
				meta:set_int("spindlestem_delay", delay)
				minetest.get_node_timer(pos):start(delay-elapsed)
			end
		end,
	}

	local cap_def_harvested = {}
	for key, val in pairs(cap_def) do
		cap_def_harvested[key] = val
	end
	cap_def_harvested.groups = {}
	for key, val in pairs(cap_def.groups) do
		cap_def_harvested.groups[key] = val
	end
	cap_def_harvested.drop = nil -- harvested caps shouldn't drop spawn
	cap_def_harvested.on_timer = nil -- harvested caps shouldn't grow, just in case a timer and node metadata are set up where it's placed
	cap_def_harvested.groups.not_in_creative_inventory = nil

	minetest.register_node(cap_item, cap_def)
	minetest.register_node(cap_item_harvested, cap_def_harvested)

	minetest.register_craft({
		type = "fuel",
		recipe = cap_item_harvested,
		burntime = 10,
	})

	if glass_bottle and light_level > 0 then
		local tex = "dfcaverns_vessels_glowing_liquid.png^[multiply:#"..colour_code.."^"..df_dependencies.texture_glass_bottle
		local new_light = light_level + math.floor((minetest.LIGHT_MAX-light_level)/2)

		local groups = {vessel = 1, dig_immediate = 3, attached_node = 1, material_glass = 1, destroy_by_lava_flow=1}
		if extract_color_group then
			groups[extract_color_group] = 1
		end

		minetest.register_node("df_trees:glowing_bottle_"..item_suffix, {
			description = S("@1 Spindlestem Extract", colour_name),
			drawtype = "plantlike",
			_doc_items_longdesc = df_trees.doc["spindlestem_extract_"..item_suffix.."_desc"],
			_doc_items_usagehelp = df_trees.doc["spindlestem_extract_"..item_suffix.."_usage"],
			tiles = {tex},
			inventory_image = tex,
			wield_image = tex,
			paramtype = "light",
			is_ground_content = false,
			walkable = false,
			selection_box = {
				type = "fixed",
				fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25}
			},
			groups = groups,
			sounds = df_dependencies.sound_glass(),
			light_source = new_light,
			_mcl_blast_resistance = 0.5,
			_mcl_hardness = 0.5,
		})

		minetest.register_craft( {
			output = "df_trees:glowing_bottle_"..item_suffix.." 3",
			type = "shapeless",
			recipe = {
				glass_bottle,
				glass_bottle,
				glass_bottle,
				cap_item_harvested,
			}
		})

		minetest.register_craft( {
			output = glass_bottle,
			type = "shapeless",
			recipe = {
				"df_trees:glowing_bottle_"..item_suffix,
			}
		})
	end
end

minetest.register_node("df_trees:spindlestem_seedling", {
	description = S("Spindlestem Spawn"),
	_doc_items_longdesc = df_trees.doc.spindlestem_desc,
	_doc_items_usagehelp = df_trees.doc.spindlestem_usage,
	tiles = {
		"dfcaverns_tower_cap.png",
	},
	groups = {snappy = 3, flammable = 2, plant = 1, attached_node = 1, light_sensitive_fungus = 11, digtron_on_place=1, dig_immediate=3,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1, compostability=30},
	drawtype = "nodebox",
	paramtype = "light",
	paramtype2 = "facedir",
	is_ground_content = false,
	walkable = false,
	floodable = true,
	node_box = {
		type = "fixed",
		fixed = {
			{-0.0625 + 0.125, -0.5, -0.125 + 0.125, 0.125 + 0.125, -0.375, 0.0625 + 0.125},
		}
	},
	_mcl_blast_resistance = 0.2,
	_mcl_hardness = 0.2,

	on_place = stem_on_place,
	on_construct = function(pos)
		if df_trees.spindlestem_growth_permitted(pos) then
			minetest.get_node_timer(pos):start(growth_delay())
		end
	end,
	on_destruct = function(pos)
		minetest.get_node_timer(pos):stop()
	end,

	on_timer = function(pos, elapsed)
		if df_farming and df_farming.kill_if_sunlit(pos) then
			return
		end
		df_trees.spawn_spindlestem(pos)
	end,
})

df_trees.spawn_spindlestem = function(pos)
	local cap_item = minetest.get_name_from_content_id(get_spindlestem_cap_type(pos))
	local node = minetest.get_node(pos)
	minetest.set_node(pos, {name=cap_item, param2 = node.param2})
	local disp = {x=3, y=3, z=3}
	local nearby = minetest.find_nodes_in_area(vector.add(pos, disp), vector.subtract(pos, disp), {"group:spindlestem"})
	local count = #nearby
	local height = math.random(1,3)
	if count > 10 then height = height + 2 end -- if there are a lot of nearby spindlestems, grow taller
	if height > 0 then
		local delay = growth_delay()
		local meta = minetest.get_meta(pos)
		meta:set_int("spindlestem_to_grow", height)
		meta:set_int("spindlestem_delay", delay)
		minetest.get_node_timer(pos):start(delay)
	end
end

register_spindlestem_type("white", S("White"), "FFFFFF", 0)
register_spindlestem_type("red", S("Red"), "FFC3C3", 3, "color_red")
register_spindlestem_type("green", S("Green"), "C3FFC3", 4, "color_green")
register_spindlestem_type("cyan", S("Cyan"), "C3FFFF", 6, "color_cyan")
register_spindlestem_type("golden", S("Golden"), "FFFFC3", 12, "color_yellow")

local c_air = minetest.get_content_id("air")
local c_stem = minetest.get_content_id("df_trees:spindlestem_stem")

df_trees.spawn_spindlestem_vm = function(vi, area, data, data_param2, c_cap)
	if data[vi] ~= c_air then return end

	if c_cap == nil then
		-- note: this won't account for rock removed by subterrane, so may not be entirely accurate. Good enough!
		c_cap = get_spindlestem_cap_type(area:position(vi))
	end

	local stem_height = math.random(1,3)
	local param2 = math.random(1,4)-1
	local i = 0
	local top = 0
	local index
	while i <= stem_height do
		index = vi + i * area.ystride
		if data[index] == c_air then
			data[index] = c_stem
			data_param2[index] = param2
			top = i
		else
			i = 100
		end
		i = i + 1
	end
	index = vi + top * area.ystride
	data[index] = c_cap
end

local c_white = minetest.get_content_id("df_trees:spindlestem_cap_white")
local c_red = minetest.get_content_id("df_trees:spindlestem_cap_red")
local c_green = minetest.get_content_id("df_trees:spindlestem_cap_green")
local c_cyan = minetest.get_content_id("df_trees:spindlestem_cap_cyan")
local c_golden = minetest.get_content_id("df_trees:spindlestem_cap_golden")

local iron_nodes = df_dependencies.data_iron_containing_nodes
local copper_nodes = df_dependencies.data_copper_containing_nodes
local mese_nodes = df_dependencies.data_mese_containing_nodes

get_spindlestem_cap_type = function(pos)
	if minetest.find_node_near(pos, 15, "group:tower_cap") then
		return c_white
	end
	if minetest.find_node_near(pos, 15, "group:goblin_cap") then
		return c_red
	end

	local iron = minetest.find_node_near(pos, 5, iron_nodes)
	local copper = minetest.find_node_near(pos, 5, copper_nodes)
	local mese = minetest.find_node_near(pos, 5, mese_nodes)
	local possibilities = {}

	if mese then table.insert(possibilities, c_golden) end
	if copper then table.insert(possibilities, c_green) end
	if iron then table.insert(possibilities, c_red) end
	if iron and copper then table.insert(possibilities, c_cyan) end
	if #possibilities == 0 then
		return c_white
	else
		local pick = math.random(1, #possibilities)
		return possibilities[pick]
	end
end


code:
--------------------------------------------------
-- Spore Tree

-- Teal
-- raining spores
-- Max trunk height 	5
-- depth 2-3

local S = minetest.get_translator(minetest.get_current_modname())

minetest.register_node("df_trees:spore_tree", {
	description = S("Spore Tree Stem"),
	_doc_items_longdesc = df_trees.doc.spore_tree_desc,
	_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
	tiles = {"dfcaverns_spore_tree_top.png", "dfcaverns_spore_tree_top.png", "dfcaverns_spore_tree.png"},
	paramtype2 = "facedir",
	is_ground_content = false,
	groups = {tree = 1, choppy = 2, oddly_breakable_by_hand = 1, flammable = 2, handy=1,axey=1, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=5},
	sounds = df_dependencies.sound_wood(),
	_mcl_blast_resistance = 2,
	_mcl_hardness = 2,

	on_place = minetest.rotate_node,
})

--Wood
minetest.register_craft({
	output = "df_trees:spore_tree_wood 4",
	recipe = {
		{"df_trees:spore_tree"},
	}
})

minetest.register_node("df_trees:spore_tree_wood", {
	description = S("Spore Tree Planks"),
	_doc_items_longdesc = df_trees.doc.spore_tree_desc,
	_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
	paramtype2 = "facedir",
	place_param2 = 0,
	tiles = {"dfcaverns_spore_tree_wood.png"},
	is_ground_content = false,
	groups = {choppy = 2, oddly_breakable_by_hand = 2, flammable = 2, wood = 1, handy=1,axey=1, building_block=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
	sounds = df_dependencies.sound_wood(),
	_mcl_blast_resistance = 3,
	_mcl_hardness = 2,
})

df_dependencies.register_all_stairs_and_fences("spore_tree_wood", {burntime = 6})

minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spore_tree_wood",
	burntime = 6,
})
minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spore_tree",
	burntime = 20,
})
minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spore_tree_hyphae",
	burntime = 2,
})
minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spore_tree_fruiting_body",
	burntime = 2,
})
minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spore_tree_sapling",
	burntime = 1,
})

minetest.register_node("df_trees:spore_tree_hyphae", {
	description = S("Spore Tree Hyphae"),
	_doc_items_longdesc = df_trees.doc.spore_tree_desc,
	_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
	waving = 1,
	tiles = {"dfcaverns_spore_tree.png"},
	is_ground_content = false,
	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, spore_tree_hyphae = 1,handy=1, hoey=1, shearsy=1, swordy=1, deco_block=1, dig_by_piston=1, fire_encouragement=15, fire_flammability=30, compostability=30},
	walkable = false,
	climbable = true,

	drawtype = "nodebox",
	paramtype = "light",
	node_box = {
		type = "fixed",
		fixed = {
			{-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
			{-0.0625, -0.0625, -0.5, 0.0625, 0.0625, 0.5},
			{-0.5, -0.0625, -0.0625, 0.5, 0.0625, 0.0625},
		}
	},
	sounds = df_dependencies.sound_leaves(),
	_mcl_blast_resistance = 0.2,
	_mcl_hardness = 0.2,

	after_place_node = df_dependencies.after_place_leaves,
	place_param2 = 1, -- Prevent leafdecay for placed nodes
})

minetest.register_node("df_trees:spore_tree_fruiting_body", {
	description = S("Spore Tree Fruiting Body"),
	_doc_items_longdesc = df_trees.doc.spore_tree_desc,
	_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
	waving = 1,
	tiles = {"dfcaverns_spore_tree.png"},
	is_ground_content = false,
	groups = {snappy = 3, leafdecay = 3, flammable = 2, leaves = 1, spore_tree_hyphae = 1,handy=1, hoey=1, shearsy=1, swordy=1, deco_block=1, dig_by_piston=1, fire_encouragement=15, fire_flammability=30, compostability=100},
	walkable = false,
	climbable = true,
	_mcl_blast_resistance = 0.7,
	_mcl_hardness = 0.7,

	drawtype = "nodebox",
	paramtype = "light",
	node_box = {
		type = "fixed",
		fixed = {
			{-0.0625, -0.5, -0.0625, 0.0625, 0.5, 0.0625},
			{-0.0625, -0.0625, -0.5, 0.0625, 0.0625, 0.5},
			{-0.5, -0.0625, -0.0625, 0.5, 0.0625, 0.0625},
			{-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
		}
	},

	drop = {
		max_items = 1,
		items = {
			{
				items = {'df_trees:spore_tree_sapling'},
				rarity = 2,
			},
			{
				items = {'df_trees:spore_tree_hyphae'},
			}
		}
	},
	sounds = df_dependencies.sound_leaves(),

	after_place_node = df_dependencies.after_place_leaves,
	place_param2 = 1, -- Prevent leafdecay for placed nodes
})

df_dependencies.register_leafdecay({
	trunks = {"df_trees:spore_tree"},
	leaves = {"df_trees:spore_tree_hyphae", "df_trees:spore_tree_fruiting_body"},
	radius = 3,
})

minetest.register_node("df_trees:spore_tree_sapling", {
	description = S("Spore Tree Spawn"),
	_doc_items_longdesc = df_trees.doc.spore_tree_desc,
	_doc_items_usagehelp = df_trees.doc.spore_tree_usage,
	drawtype = "plantlike",
	visual_scale = 1.0,
	tiles = {"dfcaverns_spore_tree_sapling.png"},
	inventory_image = "dfcaverns_spore_tree_sapling.png",
	wield_image = "dfcaverns_spore_tree_sapling.png",
	paramtype = "light",
	sunlight_propagates = true,
	walkable = false,
	is_ground_content = false,
	floodable = true,
	selection_box = {
		type = "fixed",
		fixed = {-4 / 16, -0.5, -4 / 16, 4 / 16, 7 / 16, 4 / 16}
	},
	groups = {snappy = 2, dig_immediate = 3, flammable = 2,
		attached_node = 1, sapling = 1, light_sensitive_fungus = 11, dig_immediate=3,dig_by_piston=1,destroy_by_lava_flow=1,deco_block=1, compostability=30},
	sounds = df_dependencies.sound_leaves(),
	_mcl_blast_resistance = 0.2,
	_mcl_hardness = 0.2,

	on_construct = function(pos)
		if df_trees.spore_tree_growth_permitted(pos) then
			minetest.get_node_timer(pos):start(math.random(
				df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_min_growth_delay,
				df_trees.config.spore_tree_delay_multiplier*df_trees.config.tree_max_growth_delay))
		end
	end,
	on_destruct = function(pos)
		minetest.get_node_timer(pos):stop()
	end,

	on_timer = function(pos)
		if df_farming and df_farming.kill_if_sunlit(pos) then
			return
		end
		minetest.set_node(pos, {name="air"})
		df_trees.spawn_spore_tree(pos)
	end,
})

local c_air = minetest.get_content_id("air")
local c_ignore = minetest.get_content_id("ignore")
local c_spore_pod = minetest.get_content_id("df_trees:spore_tree_fruiting_body")
local c_tree = minetest.get_content_id("df_trees:spore_tree")
local c_spore_frond = minetest.get_content_id("df_trees:spore_tree_hyphae")

df_trees.spawn_spore_tree_vm = function(vi, area, data, data_param2, height, size, iters, has_fruiting_bodies)
	if height == nil then height = math.random(3,6) end
	if size == nil then size = 2 end
	if iters == nil then iters = 10 end
	if has_fruiting_bodies == nil then has_fruiting_bodies = math.random() < 0.5 end

	local pos = area:position(vi)
	local x, y, z = pos.x, pos.y, pos.z

	local has_fruiting_bodies = true

	-- Trunk
	for yy = y, y + height - 1 do
		local vi = area:index(x, yy, z)
		local node_id = data[vi]
		if node_id == c_air or node_id == c_ignore or node_id == c_spore_frond or node_id == c_spore_pod then
			data[vi] = c_tree
			data_param2[vi] = 0
		end
	end

	-- Force leaves near the trunk
	for z_dist = -1, 1 do
	for y_dist = -size, 1 do
		local vi = area:index(x - 1, y + height + y_dist, z + z_dist)
		for x_dist = -1, 1 do
			if data[vi] == c_air or data[vi] == c_ignore then
				if has_fruiting_bodies and math.random() < 0.3 then
					data[vi] = c_spore_pod
				else
					data[vi] = c_spore_frond
				end
				data_param2[vi] = 0
			end
			vi = vi + 1
		end
	end
	end

	-- Randomly add fronds in 2x2x2 clusters.
	for i = 1, iters do
		local clust_x = x + math.random(-size, size - 1)
		local clust_y = y + height + math.random(-size, 0)
		local clust_z = z + math.random(-size, size - 1)

		for xi = 0, 1 do
			for yi = 0, 1 do
				for zi = 0, 1 do
					local vi = area:index(clust_x + xi, clust_y + yi, clust_z + zi)
					if data[vi] == c_air or data[vi] == c_ignore then
						if has_fruiting_bodies and math.random() < 0.3 then
							data[vi] = c_spore_pod
						else
							data[vi] = c_spore_frond
						end
						data_param2[vi] = 0
					end
				end
			end
		end
	end
end

df_trees.spawn_spore_tree = function(pos)
	local x, y, z = pos.x, pos.y, pos.z
	local height = math.random(4, 5)

	local vm = minetest.get_voxel_manip()
	local minp, maxp = vm:read_from_map(
		{x = x - 2, y = y, z = z - 2},
		{x = x + 2, y = y + height + 1, z = z + 2}
	)
	local area = VoxelArea:new({MinEdge = minp, MaxEdge = maxp})
	local data = vm:get_data()
	local data_param_2 = vm:get_param2_data()

	df_trees.spawn_spore_tree_vm(area:indexp(pos), area, data, data_param_2)

	vm:set_data(data)
	vm:set_param2_data(data_param_2)
	vm:write_to_map()
	vm:update_map()
end

minetest.register_abm{
	label = "spore tree raining spores",
	nodenames = {"df_trees:spore_tree_fruiting_body"},
	interval = 1,
	chance = 30,
	catch_up = false,
	action = function(pos)
		minetest.add_particle({
			pos = pos,
			velocity = {x=math.random() * 0.2 - 0.1, y=-1, z=math.random() * 0.2 - 0.1},
			acceleration = {x=0, y=0, z=0},
			expirationtime = 3,
			size = 10,
			collisiondetection = false,
			vertical = false,
			texture = "dfcaverns_spore_tree_spores.png",
		})
		if math.random() < 0.025 then
			minetest.sound_play("dfcaverns_spore_tree_pitter_patter", {
				pos = pos,
				gain = 0.2,
			})
		end
	end,
}

minetest.register_craft({
	output = 'df_trees:spore_tree_ladder 2',
	recipe = {
		{'group:spore_tree_hyphae'},
	}
})

minetest.register_craft({
	type = "fuel",
	recipe = "df_trees:spore_tree_ladder",
	burntime = 1,
})

minetest.register_node("df_trees:spore_tree_ladder", {
	description = S("Spore Tree Ladder"),
	drawtype = "signlike",
	tiles = {"dfcaverns_spore_tree_ladder.png"},
	inventory_image = "dfcaverns_spore_tree_ladder.png",
	wield_image = "dfcaverns_spore_tree_ladder.png",
	paramtype = "light",
	paramtype2 = "wallmounted",
	sunlight_propagates = true,
	walkable = false,
	climbable = true,
	is_ground_content = false,
	selection_box = {
		type = "wallmounted",
	},
	groups = {choppy = 2, oddly_breakable_by_hand = 3, flammable = 2, handy=1,axey=1, attached_node=1, deco_block=1, dig_by_piston=1, material_wood=1, fire_encouragement=5, fire_flammability=20},
	legacy_wallmounted = true,
	sounds = df_dependencies.sound_wood(),
	_mcl_blast_resistance = 1,
	_mcl_hardness = 1,
})