Fix wrong tree generators

Refactoring and code improvement of tree generators
This commit is contained in:
kordum committed 2017-07-04 11:47:52 +03:00
1 parent 3eaf99a4d1
commit bc10e65feb
78 files changed
+1886 -2742

No files matched your search

@@ -6,28 +6,64 @@ import binnie.core.util.I18N;
import binnie.extratrees.ExtraTrees;
import binnie.extratrees.block.ILogType;
import binnie.extratrees.worldgen.DefaultTreeGenerator;
import binnie.extratrees.worldgen.WorldGenAlder;
import binnie.extratrees.worldgen.WorldGenApple;
import binnie.extratrees.worldgen.WorldGenAsh;
import binnie.extratrees.worldgen.WorldGenAcornOak;
import binnie.extratrees.worldgen.WorldGenAspen;
import binnie.extratrees.worldgen.WorldGenBalsamFir;
import binnie.extratrees.worldgen.WorldGenBanana;
import binnie.extratrees.worldgen.WorldGenBeech;
import binnie.extratrees.worldgen.WorldGenConifer;
import binnie.extratrees.worldgen.WorldGenBox;
import binnie.extratrees.worldgen.WorldGenBrazilNut;
import binnie.extratrees.worldgen.WorldGenBrazilwood;
import binnie.extratrees.worldgen.WorldGenButternut;
import binnie.extratrees.worldgen.WorldGenCedar;
import binnie.extratrees.worldgen.WorldGenClove;
import binnie.extratrees.worldgen.WorldGenCoconut;
import binnie.extratrees.worldgen.WorldGenCoffee;
import binnie.extratrees.worldgen.WorldGenCommonAlder;
import binnie.extratrees.worldgen.WorldGenCommonAsh;
import binnie.extratrees.worldgen.WorldGenCommonBeech;
import binnie.extratrees.worldgen.WorldGenCopperBeech;
import binnie.extratrees.worldgen.WorldGenCypress;
import binnie.extratrees.worldgen.WorldGenDefault;
import binnie.extratrees.worldgen.WorldGenEucalyptus;
import binnie.extratrees.worldgen.WorldGenFir;
import binnie.extratrees.worldgen.WorldGenDouglasFir;
import binnie.extratrees.worldgen.WorldGenElder;
import binnie.extratrees.worldgen.WorldGenElm;
import binnie.extratrees.worldgen.WorldGenFloweringCrabapple;
import binnie.extratrees.worldgen.WorldGenGingko;
import binnie.extratrees.worldgen.WorldGenHawthorn;
import binnie.extratrees.worldgen.WorldGenHazel;
import binnie.extratrees.worldgen.WorldGenHolly;
import binnie.extratrees.worldgen.WorldGenJungle;
import binnie.extratrees.worldgen.WorldGenHornbeam;
import binnie.extratrees.worldgen.WorldGenIroko;
import binnie.extratrees.worldgen.WorldGenLazy;
import binnie.extratrees.worldgen.WorldGenMaple;
import binnie.extratrees.worldgen.WorldGenPalm;
import binnie.extratrees.worldgen.WorldGenPoplar;
import binnie.extratrees.worldgen.WorldGenLoblollyPine;
import binnie.extratrees.worldgen.WorldGenLocust;
import binnie.extratrees.worldgen.WorldGenLogwood;
import binnie.extratrees.worldgen.WorldGenMango;
import binnie.extratrees.worldgen.WorldGenMonkeyPuzzle;
import binnie.extratrees.worldgen.WorldGenOldFustic;
import binnie.extratrees.worldgen.WorldGenOlive;
import binnie.extratrees.worldgen.WorldGenOrchardApple;
import binnie.extratrees.worldgen.WorldGenOsangeOsange;
import binnie.extratrees.worldgen.WorldGenPear;
import binnie.extratrees.worldgen.WorldGenPecan;
import binnie.extratrees.worldgen.WorldGenPrairieCrabapple;
import binnie.extratrees.worldgen.WorldGenPurpleheart;
import binnie.extratrees.worldgen.WorldGenRainbowGum;
import binnie.extratrees.worldgen.WorldGenRedMaple;
import binnie.extratrees.worldgen.WorldGenRoseGum;
import binnie.extratrees.worldgen.WorldGenRosewood;
import binnie.extratrees.worldgen.WorldGenRowan;
import binnie.extratrees.worldgen.WorldGenSallow;
import binnie.extratrees.worldgen.WorldGenShrub;
import binnie.extratrees.worldgen.WorldGenSorbus;
import binnie.extratrees.worldgen.WorldGenSilverFir;
import binnie.extratrees.worldgen.WorldGenSwampGum;
import binnie.extratrees.worldgen.WorldGenSweetCrabapple;
import binnie.extratrees.worldgen.WorldGenSweetgum;
import binnie.extratrees.worldgen.WorldGenSycamore;
import binnie.extratrees.worldgen.WorldGenTree;
import binnie.extratrees.worldgen.WorldGenTree2;
import binnie.extratrees.worldgen.WorldGenTree3;
import binnie.extratrees.worldgen.WorldGenTropical;
import binnie.extratrees.worldgen.WorldGenWalnut;
import binnie.extratrees.worldgen.WorldGenWesternHemlock;
import binnie.extratrees.worldgen.WorldGenWhitebeam;
import binnie.extratrees.worldgen.WorldGenYew;
import binnie.genetics.genetics.AlleleHelper;
import com.mojang.authlib.GameProfile;
import cpw.mods.fml.relauncher.Side;
@@ -71,10 +107,10 @@ import java.util.Collection;
import java.util.Map;
public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGermlingIconProvider {
OrchardApple("malus", "domestica", 0x648830, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Apple, WorldGenApple.OrchardApple.class),
SweetCrabapple("malus", "coronaria", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.SweetCrabapple.class),
FloweringCrabapple("malus", "hopa", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.FloweringCrabapple.class),
PrairieCrabapple("malus", "ioensis", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenApple.PrairieCrabapple.class),
OrchardApple("malus", "domestica", 0x648830, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Apple, WorldGenOrchardApple.class),
SweetCrabapple("malus", "coronaria", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenSweetCrabapple.class),
FloweringCrabapple("malus", "hopa", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenFloweringCrabapple.class),
PrairieCrabapple("malus", "ioensis", 0x7a9953, ILogType.ExtraTreeLog.Apple, ExtraTreeFruitGene.Crabapple, WorldGenPrairieCrabapple.class),
Blackthorn("prunus", "spinosa ", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.Blackthorn),
CherryPlum("prunus", "cerasifera", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.CherryPlum),
Peach("prunus", "persica", 0x6d8f1e, ILogType.ForestryLog.PLUM, ExtraTreeFruitGene.Peach),
@@ -99,75 +135,75 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
Banana("musa", "sinensis", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.Banana, WorldGenBanana.class),
RedBanana("musa", "rubra", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.RedBanana, WorldGenBanana.class),
Plantain("musa", "paradisiaca", 0xa1cd8e, ILogType.ExtraTreeLog.Banana, ExtraTreeFruitGene.Plantain, WorldGenBanana.class),
Butternut("juglans", "cinerea", 0x82b58c, ILogType.ExtraTreeLog.Butternut, ExtraTreeFruitGene.Butternut, WorldGenWalnut.Butternut.class),
Rowan("sorbus", "aucuparia", 0x9ec79b, ILogType.ExtraTreeLog.Rowan, null, WorldGenSorbus.Rowan.class),
Hemlock("tsuga", "heterophylla", 0x5cac72, ILogType.ExtraTreeLog.Hemlock, null, WorldGenConifer.WesternHemlock.class),
Ash("fraxinus", "excelsior", 0x488e2b, ILogType.ExtraTreeLog.Ash, null, WorldGenAsh.CommonAsh.class),
Alder("alnus", "glutinosa", 0x698a33, ILogType.ExtraTreeLog.Alder, null, WorldGenAlder.CommonAlder.class),
Beech("fagus", "sylvatica", 0x83a04c, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenBeech.CommonBeech.class),
CopperBeech("fagus", "purpurea", 0x801318, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenBeech.CopperBeech.class),
Aspen("populus", "tremula", 0x8acc37, ILogType.ForestryLog.POPLAR, null, WorldGenPoplar.Aspen.class),
Yew("taxus", "baccata", 0x948a4d, ILogType.ExtraTreeLog.Yew, null, WorldGenConifer.Yew.class),
Cypress("chamaecyparis", "lawsoniana", 0x89c9a7, ILogType.ExtraTreeLog.Cypress, null, WorldGenConifer.Cypress.class),
DouglasFir("pseudotsuga", "menziesii", 0x99b582, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.DouglasFir.class),
Hazel("Corylus", "avellana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenTree3.Hazel.class),
Sycamore("ficus", "sycomorus", 0xa0a52f, ILogType.ExtraTreeLog.Fig, ExtraTreeFruitGene.Fig, WorldGenTree3.Sycamore.class),
Whitebeam("sorbus", "aria", 0xbace99, ILogType.ExtraTreeLog.Whitebeam, null, WorldGenSorbus.Whitebeam.class),
Hawthorn("crataegus", "monogyna", 0x6ba84a, ILogType.ExtraTreeLog.Hawthorn, null, WorldGenTree3.Hawthorn.class),
Pecan("carya", "illinoinensis", 0x85b674, ILogType.ExtraTreeLog.Hickory, ExtraTreeFruitGene.Pecan, WorldGenTree3.Pecan.class),
Elm("ulmus", "procera", 0x7c9048, ILogType.ExtraTreeLog.Elm, null, WorldGenTree3.Elm.class),
Elder("sambucus", "nigra", 0xaeb873, ILogType.ExtraTreeLog.Elder, ExtraTreeFruitGene.Elderberry, WorldGenTree3.Elder.class),
Holly("ilex", "aquifolium", 0x254b4c, ILogType.ExtraTreeLog.Holly, null, WorldGenHolly.Holly.class),
Hornbeam("carpinus", "betulus", 0x96a71b, ILogType.ExtraTreeLog.Hornbeam, null, WorldGenTree3.Hornbeam.class),
Sallow("salix", "caprea", 0xaeb323, ILogType.ForestryLog.WILLOW, null, WorldGenTree3.Sallow.class),
AcornOak("quercus", "robur", 0x66733e, ILogType.VanillaLog.Oak, ExtraTreeFruitGene.Acorn, WorldGenTree3.AcornOak.class),
Fir("abies", "alba", 0x6f7c20, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.SilverFir.class),
Cedar("cedrus", "libani", 0x95a370, ILogType.ExtraTreeLog.Cedar, null, WorldGenConifer.Cedar.class),
Olive("olea", "europaea", 0x3c4834, ILogType.ExtraTreeLog.Olive, ExtraTreeFruitGene.Olive, WorldGenTree2.Olive.class),
RedMaple("acer", "ubrum", 0xe82e17, ILogType.ForestryLog.MAPLE, null, WorldGenMaple.RedMaple.class),
BalsamFir("abies", "balsamea", 0x74a07c, ILogType.ExtraTreeLog.Fir, null, WorldGenFir.BalsamFir.class),
LoblollyPine("pinus", "taeda", 0x6f8a47, ILogType.ForestryLog.PINE, null, WorldGenConifer.LoblollyPine.class),
Sweetgum("liquidambar", "styraciflua", 0x8b8762, ILogType.ExtraTreeLog.Sweetgum, null, WorldGenTree2.Sweetgum.class),
Locust("robinia", "pseudoacacia", 0x887300, ILogType.ExtraTreeLog.Locust, null, WorldGenTree2.Locust.class),
Pear("pyrus", "communis", 0x5e8826, ILogType.ExtraTreeLog.Pear, ExtraTreeFruitGene.Pear, WorldGenTree2.Pear.class),
OsangeOsange("maclura", "pomifera", 0x687a50, ILogType.ExtraTreeLog.Maclura, ExtraTreeFruitGene.OsangeOsange, WorldGenJungle.OsangeOsange.class),
OldFustic("maclura", "tinctoria", 0x687a50, ILogType.ExtraTreeLog.Maclura, null, WorldGenJungle.OldFustic.class),
Brazilwood("caesalpinia", "echinata", 0x607459, ILogType.ExtraTreeLog.Brazilwood, null, WorldGenJungle.Brazilwood.class),
Logwood("haematoxylum", "campechianum", 0x889f6b, ILogType.ExtraTreeLog.Logwood, null, WorldGenJungle.Logwood.class),
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenJungle.Rosewood.class),
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenJungle.Purpleheart.class),
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenTree2.Iroko.class),
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut, WorldGenTree2.Gingko.class),
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut, WorldGenJungle.BrazilNut.class),
RoseGum("eucalyptus", "grandis", 0x9ca258, ILogType.ExtraTreeLog.Eucalyptus, null, WorldGenEucalyptus.RoseGum.class),
SwampGum("eucalyptus", "grandis", 0xa2c686, ILogType.ExtraTreeLog.Eucalyptus2, null, WorldGenEucalyptus.SwampGum.class),
Box("boxus", "sempervirens", 0x72996d, ILogType.ExtraTreeLog.Box, null, WorldGenTree2.Box.class),
Clove("syzygium", "aromaticum", 0x7a821f, ILogType.ExtraTreeLog.Syzgium, ExtraTreeFruitGene.Clove, WorldGenTree2.Clove.class),
Coffee("coffea", "arabica", 0x6f9065, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coffee, WorldGenJungle.Coffee.class),
MonkeyPuzzle("araucaria", "araucana", 0x576158, ILogType.ForestryLog.PINE, null, WorldGenConifer.MonkeyPuzzle.class),
RainbowGum("eucalyptus", "deglupta", 0xb7f025, ILogType.ExtraTreeLog.Eucalyptus3, null, WorldGenEucalyptus.RainbowGum.class),
Butternut("juglans", "cinerea", 0x82b58c, ILogType.ExtraTreeLog.Butternut, ExtraTreeFruitGene.Butternut, WorldGenButternut.class),
Rowan("sorbus", "aucuparia", 0x9ec79b, ILogType.ExtraTreeLog.Rowan, null, WorldGenRowan.class),
Hemlock("tsuga", "heterophylla", 0x5cac72, ILogType.ExtraTreeLog.Hemlock, null, WorldGenWesternHemlock.class),
Ash("fraxinus", "excelsior", 0x488e2b, ILogType.ExtraTreeLog.Ash, null, WorldGenCommonAsh.class),
Alder("alnus", "glutinosa", 0x698a33, ILogType.ExtraTreeLog.Alder, null, WorldGenCommonAlder.class),
Beech("fagus", "sylvatica", 0x83a04c, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenCommonBeech.class),
CopperBeech("fagus", "purpurea", 0x801318, ILogType.ExtraTreeLog.Beech, ExtraTreeFruitGene.Beechnut, WorldGenCopperBeech.class),
Aspen("populus", "tremula", 0x8acc37, ILogType.ForestryLog.POPLAR, null, WorldGenAspen.class),
Yew("taxus", "baccata", 0x948a4d, ILogType.ExtraTreeLog.Yew, null, WorldGenYew.class),
Cypress("chamaecyparis", "lawsoniana", 0x89c9a7, ILogType.ExtraTreeLog.Cypress, null, WorldGenCypress.class),
DouglasFir("pseudotsuga", "menziesii", 0x99b582, ILogType.ExtraTreeLog.Fir, null, WorldGenDouglasFir.class),
Hazel("Corylus", "avellana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenHazel.class),
Sycamore("ficus", "sycomorus", 0xa0a52f, ILogType.ExtraTreeLog.Fig, ExtraTreeFruitGene.Fig, WorldGenSycamore.class),
Whitebeam("sorbus", "aria", 0xbace99, ILogType.ExtraTreeLog.Whitebeam, null, WorldGenWhitebeam.class),
Hawthorn("crataegus", "monogyna", 0x6ba84a, ILogType.ExtraTreeLog.Hawthorn, null, WorldGenHawthorn.class),
Pecan("carya", "illinoinensis", 0x85b674, ILogType.ExtraTreeLog.Hickory, ExtraTreeFruitGene.Pecan, WorldGenPecan.class),
Elm("ulmus", "procera", 0x7c9048, ILogType.ExtraTreeLog.Elm, null, WorldGenElm.class),
Elder("sambucus", "nigra", 0xaeb873, ILogType.ExtraTreeLog.Elder, ExtraTreeFruitGene.Elderberry, WorldGenElder.class),
Holly("ilex", "aquifolium", 0x254b4c, ILogType.ExtraTreeLog.Holly, null, WorldGenHolly.class),
Hornbeam("carpinus", "betulus", 0x96a71b, ILogType.ExtraTreeLog.Hornbeam, null, WorldGenHornbeam.class),
Sallow("salix", "caprea", 0xaeb323, ILogType.ForestryLog.WILLOW, null, WorldGenSallow.class),
AcornOak("quercus", "robur", 0x66733e, ILogType.VanillaLog.Oak, ExtraTreeFruitGene.Acorn, WorldGenAcornOak.class),
Fir("abies", "alba", 0x6f7c20, ILogType.ExtraTreeLog.Fir, null, WorldGenSilverFir.class),
Cedar("cedrus", "libani", 0x95a370, ILogType.ExtraTreeLog.Cedar, null, WorldGenCedar.class),
Olive("olea", "europaea", 0x3c4834, ILogType.ExtraTreeLog.Olive, ExtraTreeFruitGene.Olive, WorldGenOlive.class),
RedMaple("acer", "ubrum", 0xe82e17, ILogType.ForestryLog.MAPLE, null, WorldGenRedMaple.class),
BalsamFir("abies", "balsamea", 0x74a07c, ILogType.ExtraTreeLog.Fir, null, WorldGenBalsamFir.class),
LoblollyPine("pinus", "taeda", 0x6f8a47, ILogType.ForestryLog.PINE, null, WorldGenLoblollyPine.class),
Sweetgum("liquidambar", "styraciflua", 0x8b8762, ILogType.ExtraTreeLog.Sweetgum, null, WorldGenSweetgum.class),
Locust("robinia", "pseudoacacia", 0x887300, ILogType.ExtraTreeLog.Locust, null, WorldGenLocust.class),
Pear("pyrus", "communis", 0x5e8826, ILogType.ExtraTreeLog.Pear, ExtraTreeFruitGene.Pear, WorldGenPear.class),
OsangeOsange("maclura", "pomifera", 0x687a50, ILogType.ExtraTreeLog.Maclura, ExtraTreeFruitGene.OsangeOsange, WorldGenOsangeOsange.class),
OldFustic("maclura", "tinctoria", 0x687a50, ILogType.ExtraTreeLog.Maclura, null, WorldGenOldFustic.class),
Brazilwood("caesalpinia", "echinata", 0x607459, ILogType.ExtraTreeLog.Brazilwood, null, WorldGenBrazilwood.class),
Logwood("haematoxylum", "campechianum", 0x889f6b, ILogType.ExtraTreeLog.Logwood, null, WorldGenLogwood.class),
Rosewood("dalbergia", "latifolia", 0x879b22, ILogType.ExtraTreeLog.Rosewood, null, WorldGenRosewood.class),
Purpleheart("peltogyne", "spp.", 0x778f55, ILogType.ExtraTreeLog.Purpleheart, null, WorldGenPurpleheart.class),
Iroko("milicia", "excelsa", 0xafc86c, ILogType.ExtraTreeLog.Iroko, null, WorldGenIroko.class),
Gingko("ginkgo", "biloba", 0x719651, ILogType.ExtraTreeLog.Gingko, ExtraTreeFruitGene.GingkoNut, WorldGenGingko.class),
Brazilnut("bertholletia", "excelsa", 0x7c8f7b, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.BrazilNut, WorldGenBrazilNut.class),
RoseGum("eucalyptus", "grandis", 0x9ca258, ILogType.ExtraTreeLog.Eucalyptus, null, WorldGenRoseGum.class),
SwampGum("eucalyptus", "grandis", 0xa2c686, ILogType.ExtraTreeLog.Eucalyptus2, null, WorldGenSwampGum.class),
Box("boxus", "sempervirens", 0x72996d, ILogType.ExtraTreeLog.Box, null, WorldGenBox.class),
Clove("syzygium", "aromaticum", 0x7a821f, ILogType.ExtraTreeLog.Syzgium, ExtraTreeFruitGene.Clove, WorldGenClove.class),
Coffee("coffea", "arabica", 0x6f9065, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coffee, WorldGenCoffee.class),
MonkeyPuzzle("araucaria", "araucana", 0x576158, ILogType.ForestryLog.PINE, null, WorldGenMonkeyPuzzle.class),
RainbowGum("eucalyptus", "deglupta", 0xb7f025, ILogType.ExtraTreeLog.Eucalyptus3, null, WorldGenRainbowGum.class),
PinkIvory("berchemia", "zeyheri", 0x7c9159, ILogType.ExtraTreeLog.PinkIvory, null, WorldGenTree.class),
Blackcurrant("ribes", "nigrum", 0xa6da5c, null, ExtraTreeFruitGene.Blackcurrant, WorldGenShrub.Shrub.class),
Redcurrant("ribes", "rubrum", 0x74ac00, null, ExtraTreeFruitGene.Redcurrant, WorldGenShrub.Shrub.class),
Blackberry("rubus", "fruticosus", 0x92c15b, null, ExtraTreeFruitGene.Blackberry, WorldGenShrub.Shrub.class),
Raspberry("rubus", "idaeus", 0x83b96e, null, ExtraTreeFruitGene.Raspberry, WorldGenShrub.Shrub.class),
Blueberry("vaccinium", "corymbosum", 0x72c750, null, ExtraTreeFruitGene.Blueberry, WorldGenShrub.Shrub.class),
Cranberry("vaccinium", "oxycoccos", 0x96d179, null, ExtraTreeFruitGene.Cranberry, WorldGenShrub.Shrub.class),
Juniper("juniperus", "communis", 0x90b149, null, ExtraTreeFruitGene.Juniper, WorldGenShrub.Shrub.class),
Gooseberry("ribes", "grossularia", 0x79bb00, null, ExtraTreeFruitGene.Gooseberry, WorldGenShrub.Shrub.class),
GoldenRaspberry("rubus", "occidentalis", 0x83b96e, null, ExtraTreeFruitGene.GoldenRaspberry, WorldGenShrub.Shrub.class),
Cinnamon("cinnamomum", "cassia", 0x738e0b, ILogType.ExtraTreeLog.Cinnamon, null, WorldGenLazy.Tree.class),
Coconut("cocous", "nucifera", 0x649923, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coconut, WorldGenPalm.Coconut.class),
Cashew("anacardium", "occidentale", 0xabb962, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Cashew, WorldGenLazy.Tree.class),
Avacado("persea", "americana", 0x96a375, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Avacado, WorldGenLazy.Tree.class),
Nutmeg("myristica", "fragrans", 0x488d4c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Nutmeg, WorldGenLazy.Tree.class),
Allspice("pimenta", "dioica", 0x7c9724, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Allspice, WorldGenLazy.Tree.class),
Chilli("capsicum", "annuum", 0x2a9f01, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Chilli, WorldGenLazy.Tree.class),
StarAnise("illicium", "verum", 0x7fc409, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.StarAnise, WorldGenLazy.Tree.class),
Mango("mangifera", "indica", 0x87b574, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Mango, WorldGenTropical.Mango.class),
Starfruit("averrhoa", "carambola", 0x6da92d, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Starfruit, WorldGenLazy.Tree.class),
Candlenut("aleurites", "moluccana", 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.Tree.class),
DwarfHazel("Corylus", "americana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.Shrub.class);
Blackcurrant("ribes", "nigrum", 0xa6da5c, null, ExtraTreeFruitGene.Blackcurrant, WorldGenShrub.class),
Redcurrant("ribes", "rubrum", 0x74ac00, null, ExtraTreeFruitGene.Redcurrant, WorldGenShrub.class),
Blackberry("rubus", "fruticosus", 0x92c15b, null, ExtraTreeFruitGene.Blackberry, WorldGenShrub.class),
Raspberry("rubus", "idaeus", 0x83b96e, null, ExtraTreeFruitGene.Raspberry, WorldGenShrub.class),
Blueberry("vaccinium", "corymbosum", 0x72c750, null, ExtraTreeFruitGene.Blueberry, WorldGenShrub.class),
Cranberry("vaccinium", "oxycoccos", 0x96d179, null, ExtraTreeFruitGene.Cranberry, WorldGenShrub.class),
Juniper("juniperus", "communis", 0x90b149, null, ExtraTreeFruitGene.Juniper, WorldGenShrub.class),
Gooseberry("ribes", "grossularia", 0x79bb00, null, ExtraTreeFruitGene.Gooseberry, WorldGenShrub.class),
GoldenRaspberry("rubus", "occidentalis", 0x83b96e, null, ExtraTreeFruitGene.GoldenRaspberry, WorldGenShrub.class),
Cinnamon("cinnamomum", "cassia", 0x738e0b, ILogType.ExtraTreeLog.Cinnamon, null, WorldGenLazy.class),
Coconut("cocous", "nucifera", 0x649923, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Coconut, WorldGenCoconut.class),
Cashew("anacardium", "occidentale", 0xabb962, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Cashew, WorldGenLazy.class),
Avacado("persea", "americana", 0x96a375, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Avacado, WorldGenLazy.class),
Nutmeg("myristica", "fragrans", 0x488d4c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Nutmeg, WorldGenLazy.class),
Allspice("pimenta", "dioica", 0x7c9724, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Allspice, WorldGenLazy.class),
Chilli("capsicum", "annuum", 0x2a9f01, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Chilli, WorldGenLazy.class),
StarAnise("illicium", "verum", 0x7fc409, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.StarAnise, WorldGenLazy.class),
Mango("mangifera", "indica", 0x87b574, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Mango, WorldGenMango.class),
Starfruit("averrhoa", "carambola", 0x6da92d, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Starfruit, WorldGenLazy.class),
Candlenut("aleurites", "moluccana", 0x8aa36c, ILogType.VanillaLog.Jungle, ExtraTreeFruitGene.Candlenut, WorldGenLazy.class),
DwarfHazel("Corylus", "americana", 0x9bb552, ILogType.ExtraTreeLog.Hazel, ExtraTreeFruitGene.Hazelnut, WorldGenShrub.class);
public ILogType wood;
@@ -1169,6 +1205,7 @@ public enum ExtraTreeSpecies implements IAlleleTreeSpecies, IIconProvider, IGerm
try {
return gen.getConstructor(ITreeGenData.class).newInstance(tree);
} catch (Exception ex) {
ex.printStackTrace();
// ignored
}
}
@@ -24,8 +24,9 @@ public class DefaultTreeGenerator implements ITreeGenerator {
@Override
public void setLogBlock(ITreeGenome genome, World world, int x, int y, int z, ForgeDirection direction) {
if (extraTreeSpecies.wood != null)
if (extraTreeSpecies.wood != null) {
extraTreeSpecies.wood.placeBlock(world, x, y, z);
}
}
@Override
@@ -0,0 +1,34 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenAcornOak extends WorldGenTree {
public WorldGenAcornOak(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 3.0f;
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.4f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.2f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,47 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenAlder {
public static class CommonAlder extends WorldGenTree {
public CommonAlder(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.4f, 0.45f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
}
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,103 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenApple {
public static class OrchardApple extends WorldGenTree {
public OrchardApple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
while (leafSpawn > 2) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(3, 6);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class SweetCrabapple extends WorldGenTree {
public SweetCrabapple(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 4);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class FloweringCrabapple extends WorldGenTree {
public FloweringCrabapple(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(3, 6);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class PrairieCrabapple extends WorldGenTree {
public PrairieCrabapple(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 4);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,39 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenAsh {
public static class CommonAsh extends WorldGenTree {
public CommonAsh(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.35f, 0.45f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenAspen extends WorldGenTree {
public WorldGenAspen(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(height / 2, height / 2 + 1) + 1;
float width = height * randBetween(0.25f, 0.35f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,35 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenBalsamFir extends WorldGenTree {
public WorldGenBalsamFir(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = 1.0f;
float width = height / randBetween(2.0f, 2.5f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -13,10 +13,10 @@ public class WorldGenBanana extends WorldGenTree {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
float width = height / randBetween(1.8f, 2.0f);
int bottom = randBetween(3, 4);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.9f * width, 1, leaf, false);
}
@Override
@@ -1,47 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
public class WorldGenBeech {
public static class CommonBeech extends WorldGenTree {
public CommonBeech(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.47f, 0.5f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
}
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, leaf, false);
}
}
public static class CopperBeech extends CommonBeech {
public CopperBeech(ITree tree) {
super(tree);
}
}
}
@@ -0,0 +1,26 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenBox extends WorldGenTree {
public WorldGenBox(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 0.0f;
float width = 1.5f;
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(3, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenBrazilNut extends WorldGenTree {
public WorldGenBrazilNut(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = height - 3;
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,31 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenBrazilwood extends WorldGenTree {
public WorldGenBrazilwood(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 1.0f;
float width = height * randBetween(0.15f, 0.2f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.8f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(4, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenButternut extends WorldGenTree {
public WorldGenButternut(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
}
if (rand.nextBoolean()) {
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 4.0f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(6, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,60 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCedar extends WorldGenTree {
public WorldGenCedar(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 3;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), girth, 1, leaf, false);
}
for (leafSpawn = height + 3; leafSpawn > bottom; leafSpawn += 1 + rand.nextInt(2)) {
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
cone *= 2.0f - cone;
float radius = (0.7f + rand.nextFloat() * 0.3f) * width;
radius *= cone;
if (radius < 2.0f) {
radius = 2.0f;
}
float xOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
xOffset *= cone;
if (xOffset > radius / 2.0f) {
xOffset = radius / 2.0f;
}
float yOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
yOffset *= cone;
if (yOffset > radius / 2.0f) {
yOffset = radius / 2.0f;
}
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), 0.7f * radius, 1, leaf, false);
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), radius, 1, leaf, false);
generateCylinder(new Vector(xOffset, leafSpawn--, yOffset), 0.5f * radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenClove extends WorldGenTree {
public WorldGenClove(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 2.0f;
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.4f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,27 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCoconut extends WorldGenTree {
public WorldGenCoconut(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCoffee extends WorldGenTree {
public WorldGenCoffee(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 1.0f;
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.3f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(3, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCommonAlder extends WorldGenTree {
public WorldGenCommonAlder(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.4f, 0.45f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,30 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCommonAsh extends WorldGenTree {
public WorldGenCommonAsh(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.35f, 0.45f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,27 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCommonBeech extends WorldGenTree {
public WorldGenCommonBeech(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.47f, 0.5f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
}
}
@@ -1,273 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenConifer {
public static class WesternHemlock extends WorldGenTree {
public WesternHemlock(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 6;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.0f, 2.5f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Cypress extends WorldGenTree {
public Cypress(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = 1.0f;
float width = height * randBetween(0.15f, 0.2f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width - 1.0f;
++radius;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Yew extends WorldGenTree {
public Yew(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= 2.0f - radius;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Cedar extends WorldGenTree {
public Cedar(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 3;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), girth, 1, leaf, false);
}
for (leafSpawn = height + 3; leafSpawn > bottom; leafSpawn += 1 + rand.nextInt(2)) {
float cone = 1.0f - (leafSpawn - bottom) / coneHeight;
float radius = (0.7f + rand.nextFloat() * 0.3f) * width;
float xOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
float yOffset = (-width + rand.nextFloat() * 2.0f * width) / 2.0f;
cone *= 2.0f - cone;
xOffset *= cone;
yOffset *= cone;
radius *= cone;
if (radius < 2.0f) {
radius = 2.0f;
}
if (xOffset > radius / 2.0f) {
xOffset = radius / 2.0f;
}
if (yOffset > radius / 2.0f) {
yOffset = radius / 2.0f;
}
float f2 = xOffset;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, yOffset), 0.7f * radius, 1, leaf, false);
float f3 = xOffset;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, yOffset), radius, 1, leaf, false);
float f4 = xOffset;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, yOffset), 0.5f * radius, 1, leaf, false);
}
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class LoblollyPine extends WorldGenTree {
public LoblollyPine(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = height * randBetween(0.65f, 0.7f);
float width = height * randBetween(0.25f, 0.3f);
if (width > 7.0f) {
width = 7.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.6f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class MonkeyPuzzle extends WorldGenTree {
public MonkeyPuzzle(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.4f, 0.45f);
if (width > 7.0f) {
width = 7.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.35f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.55f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.75f * width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 1.0f * width, 1, leaf, false);
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), 0.5f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(9, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,9 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCopperBeech extends WorldGenCommonBeech {
public WorldGenCopperBeech(ITreeGenData tree) {
super(tree);
}
}
@@ -0,0 +1,35 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCypress extends WorldGenTree {
public WorldGenCypress(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = 1.0f;
float width = height * randBetween(0.15f, 0.2f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = (1.0f - (leafSpawn - bottom) / coneHeight) * (width - 1.0f) + 1;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,40 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenDouglasFir extends WorldGenTree {
public WorldGenDouglasFir(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float patchyBottom = height / 2;
float bottom = randBetween(3, 4);
float width = height * randBetween(0.35f, 0.4f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
bushiness = 0.1f;
while (leafSpawn > patchyBottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
}
bushiness = 0.5f;
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.7f, 1.0f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.3f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,34 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenElder extends WorldGenTree {
public WorldGenElder(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 3.0f;
float width = height * randBetween(0.55f, 0.6f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenElm extends WorldGenTree {
public WorldGenElm(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,151 +0,0 @@
package binnie.extratrees.worldgen;
import binnie.extratrees.block.ILogType;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenEucalyptus {
public static class SwampGum extends WorldGenTree {
public SwampGum(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float weakerBottm = randBetween(0.5f, 0.6f) * height;
float bottom = randBetween(0.4f, 0.5f) * height;
float width = height * randBetween(0.15f, 0.2f);
if (width > 7.0f) {
width = 7.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
bushiness = 0.3f;
while (leafSpawn > weakerBottm) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.9f, 1.0f) * width, 1, leaf, false);
}
bushiness = 0.6f;
while (leafSpawn > bottom) {
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), randBetween(0.8f, 0.9f) * width, 1, leaf, false);
}
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.5f * width, 1, leaf, false);
for (int i = 0; i < 5; ++i) {
float f6 = randBetween(-1, 1);
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateSphere(new Vector(f6, h6, randBetween(-1, 1)), randBetween(1, 2), leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(14, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class RoseGum extends WorldGenTree {
public RoseGum(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int offset = (girth - 1) / 2;
for (int x = 0; x < girth; ++x) {
for (int y = 0; y < girth; ++y) {
for (int i = 0; i < 2; ++i) {
addBlock(x - offset, i, y - offset, new BlockTypeLog(ILogType.ExtraTreeLog.Eucalyptus2), true);
}
}
}
float leafSpawn = height + 2;
float bottom = randBetween(0.4f, 0.5f) * height;
float width = height * randBetween(0.05f, 0.1f);
if (width < 1.5f) {
width = 1.5f;
}
bushiness = 0.5f;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
while (leafSpawn > bottom) {
bushiness = 0.1f;
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(9, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class RainbowGum extends WorldGenTree {
public RainbowGum(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(0.5f, 0.6f) * height;
float width = height * randBetween(0.15f, 0.2f);
if (width < 1.5f) {
width = 1.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,137 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenFir {
public static class DouglasFir extends WorldGenTree {
public DouglasFir(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float patchyBottom = height / 2;
float bottom = randBetween(3, 4);
float width = height * randBetween(0.35f, 0.4f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
bushiness = 0.1f;
while (leafSpawn > patchyBottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
}
bushiness = 0.5f;
while (leafSpawn > bottom) {
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), randBetween(0.7f, 1.0f) * width, 1, leaf, false);
}
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.7f * width, 1, leaf, false);
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), 0.3f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class SilverFir extends WorldGenTree {
public SilverFir(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.5f, 3.0f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class BalsamFir extends WorldGenTree {
public BalsamFir(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = 1.0f;
float width = height / randBetween(2.0f, 2.5f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,29 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenFloweringCrabapple extends WorldGenTree {
public WorldGenFloweringCrabapple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(3, 6);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,42 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenGingko extends WorldGenTree {
public WorldGenGingko(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = 2.0f;
float width = height * randBetween(0.55f, 0.6f);
if (width > 7.0f) {
width = 7.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 2.0f, 1, leaf, false);
while (leafSpawn > bottom * 2.0f + 1.0f) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.9f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.9f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenHawthorn extends WorldGenTree {
public WorldGenHawthorn(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.4f, 0.45f);
if (width < 1.5f) {
width = 1.5f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,34 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenHazel extends WorldGenTree {
public WorldGenHazel(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 3.0f;
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.5f) {
width = 2.5f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.3f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.2f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -2,45 +2,34 @@ package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenHolly {
public static class Holly extends WorldGenTree {
public Holly(ITreeGenData tree) {
super(tree);
public class WorldGenHolly extends WorldGenTree {
public WorldGenHolly(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 1.0f;
float width = height * randBetween(0.4f, 0.45f);
if (width < 1.5f) {
width = 1.5f;
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 1.0f;
float width = height * randBetween(0.4f, 0.45f);
if (width < 1.5f) {
width = 1.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width = 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 1.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenHornbeam extends WorldGenTree {
public WorldGenHornbeam(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.55f, 0.6f);
if (width < 1.5f) {
width = 1.5f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,31 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenIroko extends WorldGenTree {
public WorldGenIroko(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.5f) {
width = 2.5f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.25f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,341 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenJungle {
public static class Brazilwood extends WorldGenTree {
public Brazilwood(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 1.0f;
float width = height * randBetween(0.15f, 0.2f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(4, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Logwood extends WorldGenTree {
public Logwood(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(4, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Rosewood extends WorldGenTree {
public Rosewood(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Purpleheart extends WorldGenTree {
public Purpleheart(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = height - 3;
float width = height * randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.7f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class OsangeOsange extends WorldGenTree {
public OsangeOsange(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class OldFustic extends WorldGenTree {
public OldFustic(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 0.7f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Coffee extends WorldGenTree {
public Coffee(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 1.0f;
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 0.5f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(3, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class BrazilNut extends WorldGenTree {
public BrazilNut(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = height - 3;
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Shrub15 extends WorldGenTree {
public Shrub15(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 1.0f;
float width = height * randBetween(0.15f, 0.2f);
if (width < 1.5f) {
width = 1.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 0.8f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -2,39 +2,28 @@ package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenLazy {
public static class Tree extends WorldGenTree {
public Tree(ITreeGenData tree) {
super(tree);
public class WorldGenLazy extends WorldGenTree {
public WorldGenLazy(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = height / 2 - 1;
float width = height * randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,34 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenLoblollyPine extends WorldGenTree {
public WorldGenLoblollyPine(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = height * randBetween(0.65f, 0.7f);
float width = height * randBetween(0.25f, 0.3f);
if (width > 7.0f) {
width = 7.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,36 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenLocust extends WorldGenTree {
public WorldGenLocust(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.35f, 0.4f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom + 1.0f) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.3f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.4f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenLogwood extends WorldGenTree {
public WorldGenLogwood(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(4, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,37 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenMango extends WorldGenTree {
public WorldGenMango(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.7f, 0.75f);
float bottom = 2.0f;
if (width < 1.2) {
width = 1.55f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.3f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.7f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.8f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width * 0.9f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 1.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,57 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenMaple {
public static class RedMaple extends WorldGenTree {
public RedMaple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(1, 2);
float bottom2 = (height + bottom) / 2.0f;
float width = 2.0f;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
while (leafSpawn > bottom2) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.4f, 1, leaf, false);
}
width += 0.6;
while (leafSpawn > bottom) {
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, leaf, false);
}
if (leafSpawn == bottom) {
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), width - 0.6f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenMonkeyPuzzle extends WorldGenTree {
public WorldGenMonkeyPuzzle(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float width = height * randBetween(0.4f, 0.45f);
if (width > 7.0f) {
width = 7.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.35f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.55f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.75f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.5f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(9, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenOldFustic extends WorldGenTree {
public WorldGenOldFustic(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,29 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenOlive extends WorldGenTree {
public WorldGenOlive(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,28 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenOrchardApple extends WorldGenTree {
public WorldGenOrchardApple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
while (leafSpawn > 2) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(3, 6);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,32 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenOsangeOsange extends WorldGenTree {
public WorldGenOsangeOsange(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,29 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenPalm {
public static class Coconut extends WorldGenTree {
public Coconut(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
generateCylinder(new Vector(0, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,31 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenPear extends WorldGenTree {
public WorldGenPear(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(3, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -2,24 +2,29 @@ package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenPrune extends WorldGenTree {
public WorldGenPrune(ITreeGenData tree) {
public class WorldGenPecan extends WorldGenTree {
public WorldGenPecan(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
float width = height / randBetween(1.7f, 2.1f);
int bottom = randBetween(2, 3);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.6f, 0.65f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.6f * width, 1, leaf, false);
}
@Override
@@ -1,46 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenPoplar {
public static class Aspen extends WorldGenTree {
public Aspen(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(height / 2, height / 2 + 1) + 1;
float width = height * randBetween(0.25f, 0.35f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.5f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,30 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenPrairieCrabapple extends WorldGenTree {
public WorldGenPrairieCrabapple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 4);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,30 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenPurpleheart extends WorldGenTree {
public WorldGenPurpleheart(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float width = height * randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.7f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -2,29 +2,33 @@ package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenCitrus extends WorldGenTree {
public WorldGenCitrus(ITreeGenData tree) {
public class WorldGenRainbowGum extends WorldGenTree {
public WorldGenRainbowGum(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
float width = height / randBetween(1.1f, 1.5f);
int bottom = randBetween(1, 2);
float leafSpawn = height + 2;
float bottom = randBetween(0.5f, 0.6f) * height;
float width = height * randBetween(0.15f, 0.2f);
if (width < 1.5f) {
width = 1.5f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
minHeight = randBetween(2, 3);
height = determineHeight(6, 1);
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,41 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenRedMaple extends WorldGenTree {
public WorldGenRedMaple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(1, 2);
float bottom2 = (height + bottom) / 2.0f;
float width = 2.0f;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
while (leafSpawn > bottom2) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
}
width += 0.6;
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.4f, 1, leaf, false);
}
if (leafSpawn == bottom) {
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.6f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,45 @@
package binnie.extratrees.worldgen;
import binnie.extratrees.block.ILogType;
import forestry.api.world.ITreeGenData;
public class WorldGenRoseGum extends WorldGenTree {
public WorldGenRoseGum(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int offset = (girth - 1) / 2;
for (int x = 0; x < girth; ++x) {
for (int y = 0; y < girth; ++y) {
for (int i = 0; i < 2; ++i) {
addBlock(x - offset, i, y - offset, new BlockTypeLog(ILogType.ExtraTreeLog.Eucalyptus2), true);
}
}
}
float leafSpawn = height + 2;
float bottom = randBetween(0.4f, 0.5f) * height;
float width = height * randBetween(0.05f, 0.1f);
if (width < 1.5f) {
width = 1.5f;
}
bushiness = 0.5f;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
while (leafSpawn > bottom) {
bushiness = 0.1f;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.1f) * width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(9, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenRosewood extends WorldGenTree {
public WorldGenRosewood(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.2f, 0.25f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.5f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.7f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,23 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenRowan extends WorldGenTree {
public WorldGenRowan(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.5f, 0.6f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
}
@@ -0,0 +1,35 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenSallow extends WorldGenTree {
public WorldGenSallow(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.6f, 0.65f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.3f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.9f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.6f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,41 +1,39 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenShrub {
public static class Shrub extends WorldGenTree {
public Shrub(ITree tree) {
super(tree);
public class WorldGenShrub extends WorldGenTree {
public WorldGenShrub(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
float leafSpawn = height;
float width = height * randBetween(0.7f, 0.9f);
if (width < 1.5f) {
width = 1.5f;
}
@Override
public void generate() {
float leafSpawn = height;
float width = height * randBetween(0.7f, 0.9f);
if (width < 1.5f) {
width = 1.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.4f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn >= 0.0f) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
}
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(0.0f, h, 0.0f), 0.4f * width, 1, leaf, false);
@Override
public void preGenerate() {
minHeight = 1;
height = determineHeight(1, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(0.0f, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn >= 0.0f) {
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(0.0f, h3, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
minHeight = 1;
height = determineHeight(1, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,36 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenSilverFir extends WorldGenTree {
public WorldGenSilverFir(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.5f, 3.0f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= width;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,70 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenSorbus {
public static class Whitebeam extends WorldGenTree {
public Whitebeam(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.5f, 0.6f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
}
}
public static class Rowan extends WorldGenTree {
public Rowan(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.5f, 0.6f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
}
}
public static class ServiceTree extends WorldGenTree {
public ServiceTree(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
while (leafSpawn > 2) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.4f + rand.nextFloat() * 0.7f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.9f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(8, 6);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,151 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenSpruce {
public static class GiantSpruce extends WorldGenTree {
public GiantSpruce(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 3;
float bottom = randBetween(3, 4);
float width = height / randBetween(2.5f, 3.0f);
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius = 0.15f + 0.85f * radius;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(15, 4);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class AlpineSpruce extends WorldGenTree {
public AlpineSpruce(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 5;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.0f, 2.5f);
float coneHeight = leafSpawn - bottom;
leafSpawn -= 2.0f;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= radius;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class WhiteSpruce extends WorldGenTree {
public WhiteSpruce(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.2f, 2.5f);
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius = (float) Math.sqrt(radius);
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class BlackSpruce extends WorldGenTree {
public BlackSpruce(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.2f, 2.5f);
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius = (float) Math.sqrt(radius);
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,45 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenSwampGum extends WorldGenTree {
public WorldGenSwampGum(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float weakerBottm = randBetween(0.5f, 0.6f) * height;
float bottom = randBetween(0.4f, 0.5f) * height;
float width = height * randBetween(0.15f, 0.2f);
if (width > 7.0f) {
width = 7.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
bushiness = 0.3f;
while (leafSpawn > weakerBottm) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.9f, 1.0f) * width, 1, leaf, false);
}
bushiness = 0.6f;
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.8f, 0.9f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.5f * width, 1, leaf, false);
for (int i = 0; i < 5; ++i) {
generateSphere(new Vector(randBetween(-1, 1), leafSpawn--, randBetween(-1, 1)), randBetween(1, 2), leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(14, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,30 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenSweetCrabapple extends WorldGenTree {
public WorldGenSweetCrabapple(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.5f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.0f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 1.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 4);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,36 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenSweetgum extends WorldGenTree {
public WorldGenSweetgum(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= 2.0f - radius;
radius *= width;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,33 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenSycamore extends WorldGenTree {
public WorldGenSycamore(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.35f, 0.4f);
if (width < 2.0f) {
width = 2.0f;
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 1.3f, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width - 0.6f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), width - 0.8f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -1,132 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenTilia {
public static class Basswood extends WorldGenTree {
public Basswood(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.4f, 0.5f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class WhiteBasswood extends WorldGenTree {
public WhiteBasswood(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.4f, 0.5f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class CommonLime extends WorldGenTree {
public CommonLime(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.45f, 0.55f);
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 4);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -36,9 +36,7 @@ public abstract class WorldGenTree extends WorldGenerator {
air = new BlockTypeVoid();
bushiness = 0.0f;
spawnPods = tree.allowsFruitBlocks();
if (tree instanceof ITreeGenData) {
treeGen = tree;
}
treeGen = tree;
}
protected int randBetween(int a, int b) {
@@ -71,11 +69,6 @@ public abstract class WorldGenTree extends WorldGenerator {
return base;
}
protected int modifyByHeight(int val, int min, int max) {
int determined = Math.round(val * treeGen.getHeightModifier());
return (determined < min) ? min : ((determined > max) ? max : determined);
}
protected int determineHeight(int required, int variation) {
int determined = Math.round((required + rand.nextInt(variation)) * treeGen.getHeightModifier());
return (determined < minHeight) ? minHeight : ((determined > maxHeight) ? maxHeight : determined);
@@ -106,7 +99,7 @@ public abstract class WorldGenTree extends WorldGenerator {
if (!force && !canGrow()) {
return false;
}
int offset = (girth - 1) / 2;
for (int x2 = 0; x2 < girth; ++x2) {
for (int y2 = 0; y2 < girth; ++y2) {
addBlock(x2, 0, y2, new BlockTypeVoid(), true);
@@ -116,10 +109,6 @@ public abstract class WorldGenTree extends WorldGenerator {
return true;
}
public Vector getStartVector() {
return new Vector(startX, startY, startZ);
}
protected void generateTreeTrunk(int height, int width) {
generateTreeTrunk(height, width, 0.0f);
}
@@ -162,31 +151,6 @@ public abstract class WorldGenTree extends WorldGenerator {
}
}
protected void generateSupportStems(int height, int girth, float chance, float maxHeight) {
for (int offset = 1, x = -offset; x < girth + offset; ++x) {
for (int z = -offset; z < girth + offset; ++z) {
if (x != -offset || z != -offset) {
if (x != girth + offset || z != girth + offset) {
if (x != -offset || z != girth + offset) {
if (x != girth + offset || z != -offset) {
int stemHeight = rand.nextInt(Math.round(height * maxHeight));
if (rand.nextFloat() < chance) {
for (int i = 0; i < stemHeight; ++i) {
addWood(x, i, z, true);
}
}
}
}
}
}
}
}
}
protected void clearBlock(int x, int y, int z) {
air.setBlock(world, treeGen, startX + x, startY + y, startZ + z);
}
protected void addBlock(int x, int y, int z, BlockType type, boolean doReplace) {
if (doReplace || world.isAirBlock(startX + x, startY + y, startZ + z)) {
type.setBlock(world, treeGen, startX + x, startY + y, startZ + z);
@@ -197,24 +161,10 @@ public abstract class WorldGenTree extends WorldGenerator {
addBlock(x, y, z, wood, doReplace);
}
protected void addLeaf(int x, int y, int z, boolean doReplace) {
addBlock(x, y, z, leaf, doReplace);
}
protected void addVine(int x, int y, int z) {
addBlock(x, y, z, vine, false);
}
protected void generateCuboid(Vector start, Vector area, BlockType block, boolean doReplace) {
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
addBlock(x, y, z, block, doReplace);
}
}
}
}
protected void generateCylinder(Vector center2, float radius, int height, BlockType block, boolean doReplace) {
float centerOffset = (girth - 1) / 2.0f;
Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
@@ -233,29 +183,6 @@ public abstract class WorldGenTree extends WorldGenerator {
}
}
protected void generateCircle(Vector center, float radius, int width, int height, BlockType block, boolean doReplace) {
generateCircle(center, radius, width, height, block, 1.0f, doReplace);
}
protected void generateCircle(Vector center2, float radius, int width, int height, BlockType block, float chance, boolean doReplace) {
float centerOffset = (girth % 2 == 0) ? 0.5f : 0.0f;
Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
Vector start = new Vector(center3.x - radius, center3.y, center3.z - radius);
Vector area = new Vector(radius * 2.0f + 1.0f, height, radius * 2.0f + 1.0f);
for (int x = (int) start.x; x < (int) start.x + area.x; ++x) {
for (int y = (int) start.y; y < (int) start.y + area.y; ++y) {
for (int z = (int) start.z; z < (int) start.z + area.z; ++z) {
if (rand.nextFloat() <= chance) {
double distance = Vector.distance(new Vector(x, y, z), new Vector(center3.x, y, center3.z));
if (radius - width - 0.01 < distance && distance <= radius + 0.01) {
addBlock(x, y, z, block, doReplace);
}
}
}
}
}
}
protected void generateSphere(Vector center2, int radius, BlockType block, boolean doReplace) {
float centerOffset = (girth - 1) / 2.0f;
Vector center3 = new Vector(center2.x + centerOffset, center2.y, center2.z + centerOffset);
@@ -1,321 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenTree2 {
public static class Olive extends WorldGenTree {
public Olive(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.35f, 0.4f);
if (width < 1.2) {
width = 1.55f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Sweetgum extends WorldGenTree {
public Sweetgum(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= 2.0f - radius;
radius *= width;
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), radius, 1, leaf, false);
}
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Locust extends WorldGenTree {
public Locust(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.35f, 0.4f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom + 1.0f) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.3f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.7f, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.4f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Pear extends WorldGenTree {
public Pear(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(3, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Iroko extends WorldGenTree {
public Iroko(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.5f) {
width = 2.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width * 0.25f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width * 0.5f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width * 0.7f, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 2.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Gingko extends WorldGenTree {
public Gingko(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = 2.0f;
float width = height * randBetween(0.55f, 0.6f);
if (width > 7.0f) {
width = 7.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 2.0f, 1, leaf, false);
while (leafSpawn > bottom * 2.0f + 1.0f) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 1.5f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.9f, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
while (leafSpawn > bottom) {
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.9f, 1, leaf, false);
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), width, 1, leaf, false);
}
float f7 = 0.0f;
float h7 = leafSpawn;
leafSpawn = h7 - 1.0f;
generateCylinder(new Vector(f7, h7, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Box extends WorldGenTree {
public Box(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 0.0f;
float width = 1.5f;
while (leafSpawn > bottom) {
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(3, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Clove extends WorldGenTree {
public Clove(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = 2.0f;
float width = height * randBetween(0.25f, 0.3f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,399 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
import forestry.api.world.ITreeGenData;
public class WorldGenTree3 {
public static class Hazel extends WorldGenTree {
public Hazel(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 3.0f;
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.5f) {
width = 2.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
}
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.3f, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.6f, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.2f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Sycamore extends WorldGenTree {
public Sycamore(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.35f, 0.4f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.3f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.6f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.8f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Hawthorn extends WorldGenTree {
public Hawthorn(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.4f, 0.45f);
if (width < 1.5f) {
width = 1.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.5f, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Pecan extends WorldGenTree {
public Pecan(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.6f, 0.65f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.6f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width, 1, leaf, false);
}
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), 0.6f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Elm extends WorldGenTree {
public Elm(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
while (leafSpawn > bottom) {
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.5f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Elder extends WorldGenTree {
public Elder(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 3.0f;
float width = height * randBetween(0.55f, 0.6f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width - 1.0f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width - 0.4f, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width - 0.4f, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 1.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Hornbeam extends WorldGenTree {
public Hornbeam(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.55f, 0.6f);
if (width < 1.5f) {
width = 1.5f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.7f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Sallow extends WorldGenTree {
public Sallow(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 2.0f;
float width = height * randBetween(0.6f, 0.65f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), 0.3f * width, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), 0.6f * width, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), 0.8f * width, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), 0.9f * width, 1, leaf, false);
while (leafSpawn > bottom) {
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width, 1, leaf, false);
}
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), 0.6f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(4, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class AcornOak extends WorldGenTree {
public AcornOak(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 1;
float bottom = 3.0f;
float width = height * randBetween(0.45f, 0.5f);
if (width < 2.0f) {
width = 2.0f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width * 0.4f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width * 0.7f, 1, leaf, false);
while (leafSpawn > bottom) {
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width - 0.2f, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width, 1, leaf, false);
}
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width - 0.5f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(6, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,58 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenTropical {
public static class Mango extends WorldGenTree {
public Mango(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height;
float width = height * randBetween(0.7f, 0.75f);
float bottom = 2.0f;
if (width < 1.2) {
width = 1.55f;
}
float f = 0.0f;
float h = leafSpawn;
leafSpawn = h - 1.0f;
generateCylinder(new Vector(f, h, 0.0f), width * 0.3f, 1, leaf, false);
float f2 = 0.0f;
float h2 = leafSpawn;
leafSpawn = h2 - 1.0f;
generateCylinder(new Vector(f2, h2, 0.0f), width * 0.5f, 1, leaf, false);
float f3 = 0.0f;
float h3 = leafSpawn;
leafSpawn = h3 - 1.0f;
generateCylinder(new Vector(f3, h3, 0.0f), width * 0.7f, 1, leaf, false);
float f4 = 0.0f;
float h4 = leafSpawn;
leafSpawn = h4 - 1.0f;
generateCylinder(new Vector(f4, h4, 0.0f), width * 0.8f, 1, leaf, false);
float f5 = 0.0f;
float h5 = leafSpawn;
leafSpawn = h5 - 1.0f;
generateCylinder(new Vector(f5, h5, 0.0f), width * 0.9f, 1, leaf, false);
while (leafSpawn > bottom) {
float f6 = 0.0f;
float h6 = leafSpawn;
leafSpawn = h6 - 1.0f;
generateCylinder(new Vector(f6, h6, 0.0f), width, 1, leaf, false);
}
float f7 = 0.0f;
float h7 = leafSpawn;
leafSpawn = h7 - 1.0f;
generateCylinder(new Vector(f7, h7, 0.0f), width - 1.0f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 1);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -1,58 +0,0 @@
package binnie.extratrees.worldgen;
import forestry.api.arboriculture.ITree;
public class WorldGenWalnut {
public static class BlackWalnut extends WorldGenTree {
public BlackWalnut(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.6f, 1, leaf, false);
while (leafSpawn > randBetween(3, 4)) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.8f, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.7f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 1.8f, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(9, 6);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
public static class Butternut extends WorldGenTree {
public Butternut(ITree tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 2.0f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 3.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.5f, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
while (leafSpawn > 3) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 5.0f, 1, leaf, false);
}
if (rand.nextBoolean()) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 4.0f, 1, leaf, false);
}
}
@Override
public void preGenerate() {
height = determineHeight(6, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
}
@@ -0,0 +1,35 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenWesternHemlock extends WorldGenTree {
public WorldGenWesternHemlock(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 6;
float bottom = randBetween(2, 3);
float width = height / randBetween(2.0f, 2.5f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = (1.0f - (leafSpawn - bottom) / coneHeight) * width;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.4f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(7, 3);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}
@@ -0,0 +1,25 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenWhitebeam extends WorldGenTree {
public WorldGenWhitebeam(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
int leafSpawn = height + 1;
float bottom = randBetween(2, 3);
float width = height * randBetween(0.5f, 0.6f);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.4f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.6f * width, 1, leaf, false);
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.8f * width, 1, leaf, false);
while (leafSpawn > bottom) {
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), randBetween(0.95f, 1.05f) * width, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), 0.7f * width, 1, leaf, false);
}
}
@@ -0,0 +1,35 @@
package binnie.extratrees.worldgen;
import forestry.api.world.ITreeGenData;
public class WorldGenYew extends WorldGenTree {
public WorldGenYew(ITreeGenData tree) {
super(tree);
}
@Override
public void generate() {
generateTreeTrunk(height, girth);
float leafSpawn = height + 2;
float bottom = randBetween(1, 2);
float width = height * randBetween(0.7f, 0.75f);
if (width > 7.0f) {
width = 7.0f;
}
float coneHeight = leafSpawn - bottom;
while (leafSpawn > bottom) {
float radius = 1.0f - (leafSpawn - bottom) / coneHeight;
radius *= (2.0f - radius) * width;
generateCylinder(new Vector(0.0f, leafSpawn--, 0.0f), radius, 1, leaf, false);
}
generateCylinder(new Vector(0.0f, leafSpawn, 0.0f), 0.7f * width, 1, leaf, false);
}
@Override
public void preGenerate() {
height = determineHeight(5, 2);
girth = determineGirth(treeGen.getGirth(world, startX, startY, startZ));
}
}