use of forestry.api.arboriculture.IAlleleTreeSpecies in project Binnie by ForestryMC.
the class PageSpeciesTreeGenome method onValueChanged.
// TODO: unused ?
/*public static String tolerated(final boolean t) {
if (t) {
return I18N.localise("binniecore.gui.tolerated");
}
return I18N.localise("binniecore.gui.nottolerated");
}*/
@Override
public void onValueChanged(final IAlleleSpecies species) {
this.deleteAllChildren();
final IAllele[] template = TreeManager.treeRoot.getTemplate(species.getUID());
if (template == null) {
return;
}
final ITree tree = TreeManager.treeRoot.templateAsIndividual(template);
final ITreeGenome genome = tree.getGenome();
final IAlleleTreeSpecies treeSpecies = genome.getPrimary();
final int w = 144;
final int h = 176;
new ControlText(this, new Area(0, 4, w, 16), this.getValue().toString(), TextJustification.MIDDLE_CENTER);
final ControlScrollableContent scrollable = new ControlScrollableContent(this, 4, 20, w - 8, h - 8 - 16, 12);
final Control contents = new Control(scrollable, 0, 0, w - 8 - 12, h - 8 - 16);
final int tw = w - 8 - 12;
final int w2 = 65;
final int w3 = tw - 50;
int y = 0;
final int th = 14;
final int th2 = 18;
final IBreedingSystem syst = Binnie.GENETICS.getSystem(TreeManager.treeRoot);
new ControlText(contents, new Area(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MIDDLE_LEFT);
y += th;
new ControlText(contents, new Area(0, y, w2, th), I18N.localise("binniecore.gui.temperature.short") + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), treeSpecies.getTemperature().getName(), TextJustification.MIDDLE_LEFT);
y += th;
Minecraft minecraft = Minecraft.getMinecraft();
World world = minecraft.world;
TextureMap map = minecraft.getTextureMapBlocks();
ILeafSpriteProvider spriteProvider = treeSpecies.getLeafSpriteProvider();
TextureAtlasSprite leaf = map.getAtlasSprite(spriteProvider.getSprite(false, false).toString());
int leafColour = spriteProvider.getColor(false);
new ControlText(contents, new Area(0, y, w2, th2), I18N.localise("extratrees.gui.database.leaves") + " : ", TextJustification.MIDDLE_RIGHT);
new ControlBlockIconDisplay(contents, w2, y, leaf).setColor(leafColour);
IFruitProvider fruitProvider = genome.getFruitProvider();
ResourceLocation fruitSprite = fruitProvider.getSprite(genome, world, BlockPos.ORIGIN, 100);
if (fruitSprite != null && !treeSpecies.getUID().equals("forestry.treeOak")) {
TextureAtlasSprite fruit = map.getAtlasSprite(fruitSprite.toString());
int fruitColour = fruitProvider.getColour(genome, world, BlockPos.ORIGIN, 100);
new ControlBlockIconDisplay(contents, w2, y, fruit).setColor(fruitColour);
}
y += th2;
Map<ItemStack, Float> products = fruitProvider.getProducts();
ItemStack log = treeSpecies.getWoodProvider().getWoodStack();
if (log.isEmpty()) {
new ControlText(contents, new Area(0, y, w2, th2), I18N.localise("extratrees.gui.database.log") + " : ", TextJustification.MIDDLE_RIGHT);
final ControlItemDisplay display = new ControlItemDisplay(contents, w2, y);
display.setItemStack(log);
display.setTooltip();
y += th2;
}
new ControlText(contents, new Area(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MIDDLE_LEFT);
y += th;
new ControlText(contents, new Area(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.FERTILITY) + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getFertility() + "x", TextJustification.MIDDLE_LEFT);
y += th;
List<ItemStack> fruits = new ArrayList<>(products.keySet());
if (!fruits.isEmpty()) {
new ControlText(contents, new Area(0, y, w2, th2), syst.getChromosomeShortName(EnumTreeChromosome.FRUITS) + " : ", TextJustification.MIDDLE_RIGHT);
for (ItemStack fruitw : fruits) {
final ControlItemDisplay display2 = new ControlItemDisplay(contents, w2, y);
display2.setItemStack(fruitw);
display2.setTooltip();
y += th2;
}
}
new ControlText(contents, new Area(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.YIELD) + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getYield() + "x", TextJustification.MIDDLE_LEFT);
y += th;
new ControlText(contents, new Area(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.SAPPINESS) + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getSappiness() + "x", TextJustification.MIDDLE_LEFT);
y += th;
new ControlText(contents, new Area(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.MATURATION) + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getMaturationTime() + "x", TextJustification.MIDDLE_LEFT);
y += th;
new ControlText(contents, new Area(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GIRTH) + " : ", TextJustification.MIDDLE_RIGHT);
new ControlText(contents, new Area(w2, y, w3, th), genome.getGirth() + "x" + genome.getGirth(), TextJustification.MIDDLE_LEFT);
y += th;
contents.setSize(new Point(contents.getSize().xPos(), y));
scrollable.setScrollableContent(contents);
}
use of forestry.api.arboriculture.IAlleleTreeSpecies in project Binnie by ForestryMC.
the class ExtraTreeMutation method init.
public static void init() {
final IAlleleTreeSpecies lemon = (IAlleleTreeSpecies) getVanilla("Lemon");
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ETTreeDefinition.KeyLime.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.KeyLime.getSpecies(), lemon, ETTreeDefinition.FingerLime.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Cherry"), lemon, ETTreeDefinition.Pomelo.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Pomelo.getSpecies(), getVanilla("Cherry"), ETTreeDefinition.Manderin.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Pomelo.getSpecies(), lemon, ETTreeDefinition.Citron.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Manderin.getSpecies(), getVanilla("Cherry"), ETTreeDefinition.Kumquat.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Pomelo.getSpecies(), ETTreeDefinition.Manderin.getSpecies(), ETTreeDefinition.Orange.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Citron.getSpecies(), ETTreeDefinition.Manderin.getSpecies(), ETTreeDefinition.BuddhaHand.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Kumquat.getSpecies(), ETTreeDefinition.Manderin.getSpecies(), ETTreeDefinition.Tangerine.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Kumquat.getSpecies(), ETTreeDefinition.Manderin.getSpecies(), ETTreeDefinition.Satsuma.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Pomelo.getSpecies(), ETTreeDefinition.Orange.getSpecies(), ETTreeDefinition.Grapefruit.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Pomelo.getSpecies(), ETTreeDefinition.KeyLime.getSpecies(), ETTreeDefinition.Lime.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Oak"), getVanilla("Cherry"), ETTreeDefinition.OrchardApple.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.OrchardApple.getSpecies(), getVanilla("Maple"), ETTreeDefinition.SweetCrabapple.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.OrchardApple.getSpecies(), ETTreeDefinition.SweetCrabapple.getSpecies(), ETTreeDefinition.FloweringCrabapple.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.OrchardApple.getSpecies(), getVanilla("Birch"), ETTreeDefinition.PrairieCrabapple.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Plum"), ETTreeDefinition.OrchardApple.getSpecies(), ETTreeDefinition.Blackthorn.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Cherry"), ETTreeDefinition.CherryPlum.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Chestnut"), ETTreeDefinition.Peach.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Plum"), ETTreeDefinition.Peach.getSpecies(), ETTreeDefinition.Nectarine.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Plum"), ETTreeDefinition.Peach.getSpecies(), ETTreeDefinition.Apricot.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Plum"), getVanilla("Walnut"), ETTreeDefinition.Almond.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Cherry"), ETTreeDefinition.WildCherry.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Willow"), getVanilla("Cherry"), ETTreeDefinition.SourCherry.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Cherry"), ETTreeDefinition.BlackCherry.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ETTreeDefinition.Banana.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Banana.getSpecies(), getVanilla("Kapok"), ETTreeDefinition.RedBanana.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Banana.getSpecies(), getVanilla("Teak"), ETTreeDefinition.Plantain.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Birch"), getVanilla("Oak"), ETTreeDefinition.Beech.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Birch"), ETTreeDefinition.Beech.getSpecies(), ETTreeDefinition.Alder.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.Beech.getSpecies(), ETTreeDefinition.Aspen.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Aspen.getSpecies(), ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.Rowan.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Beech.getSpecies(), ETTreeDefinition.Aspen.getSpecies(), ETTreeDefinition.Hazel.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Beech.getSpecies(), ETTreeDefinition.Rowan.getSpecies(), ETTreeDefinition.Hawthorn.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.Aspen.getSpecies(), ETTreeDefinition.Elder.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.Rowan.getSpecies(), ETTreeDefinition.Holly.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Willow"), ETTreeDefinition.Aspen.getSpecies(), ETTreeDefinition.Sallow.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Beech.getSpecies(), getVanilla("Birch"), ETTreeDefinition.Pecan.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Beech.getSpecies(), getVanilla("Spruce"), ETTreeDefinition.CopperBeech.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Lime"), getVanilla("Spruce"), ETTreeDefinition.Ash.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Ash.getSpecies(), getVanilla("Birch"), ETTreeDefinition.Whitebeam.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Ash.getSpecies(), getVanilla("Pine"), ETTreeDefinition.Elm.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Ash.getSpecies(), getVanilla("Larch"), ETTreeDefinition.Hornbeam.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Ash.getSpecies(), getVanilla("Maple"), ETTreeDefinition.Sycamore.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Larch"), getVanilla("Spruce"), ETTreeDefinition.Yew.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Larch"), ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.BalsamFir.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Pine"), ETTreeDefinition.BalsamFir.getSpecies(), ETTreeDefinition.Fir.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Pine"), ETTreeDefinition.Fir.getSpecies(), ETTreeDefinition.Hemlock.getSpecies(), 10).setHeight(80);
new ExtraTreeMutation(ETTreeDefinition.Fir.getSpecies(), getVanilla("Larch"), ETTreeDefinition.Cedar.getSpecies(), 10).setHeight(60);
new ExtraTreeMutation(ETTreeDefinition.Fir.getSpecies(), getVanilla("Spruce"), ETTreeDefinition.DouglasFir.getSpecies(), 10).setHeight(60);
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ETTreeDefinition.Cypress.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Pine"), getVanilla("Spruce"), ETTreeDefinition.LoblollyPine.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Cherry"), ETTreeDefinition.Butternut.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Walnut"), getVanilla("Oak"), ETTreeDefinition.AcornOak.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Cherry"), ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.Olive.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Lime"), ETTreeDefinition.RedMaple.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Maple"), getVanilla("Larch"), ETTreeDefinition.Sweetgum.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Lime"), ETTreeDefinition.Locust.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Teak"), ETTreeDefinition.Iroko.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.OrchardApple.getSpecies(), getVanilla("Birch"), ETTreeDefinition.Pear.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ETTreeDefinition.OldFustic.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.OldFustic.getSpecies(), getVanilla("Kapok"), ETTreeDefinition.OsangeOrange.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ETTreeDefinition.Brazilwood.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Brazilwood.getSpecies(), getVanilla("Kapok"), ETTreeDefinition.Purpleheart.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Ebony"), getVanilla("Teak"), ETTreeDefinition.Rosewood.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Rosewood.getSpecies(), getVanilla("Kapok"), ETTreeDefinition.Logwood.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Lime"), ETTreeDefinition.Gingko.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Beech.getSpecies(), getVanilla("Jungle"), ETTreeDefinition.Brazilnut.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Balsa"), getVanilla("Jungle"), ETTreeDefinition.RoseGum.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.RoseGum.getSpecies(), getVanilla("Mahogony"), ETTreeDefinition.SwampGum.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Coffee.getSpecies(), getVanilla("Teak"), ETTreeDefinition.Clove.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Cherry"), getVanilla("Jungle"), ETTreeDefinition.Coffee.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Holly.getSpecies(), ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.Box.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Hemlock.getSpecies(), getVanilla("Jungle"), ETTreeDefinition.MonkeyPuzzle.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.RoseGum.getSpecies(), getVanilla("Balsa"), ETTreeDefinition.RainbowGum.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.RoseGum.getSpecies(), ETTreeDefinition.Brazilwood.getSpecies(), ETTreeDefinition.PinkIvory.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Cherry"), ETTreeDefinition.Elder.getSpecies(), ETTreeDefinition.Raspberry.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Cherry"), ETTreeDefinition.Elder.getSpecies(), ETTreeDefinition.Redcurrant.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.BlackCherry.getSpecies(), ETTreeDefinition.Redcurrant.getSpecies(), ETTreeDefinition.Blackcurrant.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.BlackCherry.getSpecies(), ETTreeDefinition.Raspberry.getSpecies(), ETTreeDefinition.Blackberry.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Blackberry.getSpecies(), ETTreeDefinition.Raspberry.getSpecies(), ETTreeDefinition.Blueberry.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Blackberry.getSpecies(), ETTreeDefinition.CherryPlum.getSpecies(), ETTreeDefinition.Cranberry.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Raspberry.getSpecies(), ETTreeDefinition.Fir.getSpecies(), ETTreeDefinition.Juniper.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Raspberry.getSpecies(), ETTreeDefinition.Lime.getSpecies(), ETTreeDefinition.Gooseberry.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Raspberry.getSpecies(), ETTreeDefinition.Orange.getSpecies(), ETTreeDefinition.GoldenRaspberry.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Teak"), ETTreeDefinition.Rosewood.getSpecies(), ETTreeDefinition.Cinnamon.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Balsa"), ETTreeDefinition.Brazilnut.getSpecies(), ETTreeDefinition.Coconut.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Teak"), getVanilla("Oak"), ETTreeDefinition.Cashew.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Wenge"), getVanilla("Oak"), ETTreeDefinition.Avacado.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Teak"), ETTreeDefinition.Clove.getSpecies(), ETTreeDefinition.Nutmeg.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Teak"), ETTreeDefinition.Clove.getSpecies(), ETTreeDefinition.Allspice.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Allspice.getSpecies(), ETTreeDefinition.Clove.getSpecies(), ETTreeDefinition.StarAnise.getSpecies(), 10);
new ExtraTreeMutation(getVanilla("Jungle"), ETTreeDefinition.Orange.getSpecies(), ETTreeDefinition.Mango.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.StarAnise.getSpecies(), ETTreeDefinition.Mango.getSpecies(), ETTreeDefinition.Starfruit.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Hazel.getSpecies(), ETTreeDefinition.Gingko.getSpecies(), ETTreeDefinition.Candlenut.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Hazel.getSpecies(), ETTreeDefinition.Gingko.getSpecies(), ETTreeDefinition.Chilli.getSpecies(), 10);
new ExtraTreeMutation(ETTreeDefinition.Hazel.getSpecies(), ETTreeDefinition.Alder.getSpecies(), ETTreeDefinition.DwarfHazel.getSpecies(), 10);
}
use of forestry.api.arboriculture.IAlleleTreeSpecies in project Binnie by ForestryMC.
the class TreeBreedingSystem method onSyncBreedingTracker.
@Override
public void onSyncBreedingTracker(final IBreedingTracker tracker) {
this.discoveredFruits.clear();
this.discoveredWoods.clear();
for (final IAlleleSpecies species : this.getDiscoveredSpecies(tracker)) {
final IAlleleTreeSpecies tSpecies = (IAlleleTreeSpecies) species;
final ITreeGenome genome = (ITreeGenome) this.getSpeciesRoot().templateAsGenome(this.getSpeciesRoot().getTemplate(tSpecies));
IAlleleTreeSpecies treeSpecies = genome.getPrimary();
final ItemStack wood = treeSpecies.getWoodProvider().getWoodStack();
if (!wood.isEmpty()) {
this.discoveredWoods.add(wood);
}
/*for (final ItemStack wood : tSpecies.getRoot().templateAsIndividual(getSpeciesRoot().getTemplate(tSpecies.getUID())).getProduceList()) {
this.discoveredWoods.add(wood);
}*/
this.discoveredFruits.addAll(genome.getFruitProvider().getProducts().keySet());
}
}
use of forestry.api.arboriculture.IAlleleTreeSpecies in project Binnie by ForestryMC.
the class ModelDefaultETLeaves method bakeBlock.
@Override
protected void bakeBlock(BlockETDefaultLeaves block, ETTreeDefinition treeDefinition, IModelBaker baker, boolean inventory) {
TextureMap map = Minecraft.getMinecraft().getTextureMapBlocks();
ITreeGenome genome = treeDefinition.getGenome();
IAlleleTreeSpecies species = genome.getPrimary();
ILeafSpriteProvider leafSpriteProvider = species.getLeafSpriteProvider();
ResourceLocation leafSpriteLocation = leafSpriteProvider.getSprite(false, Proxies.render.fancyGraphicsEnabled());
TextureAtlasSprite leafSprite = map.getAtlasSprite(leafSpriteLocation.toString());
// Render the plain leaf block.
baker.addBlockModel(null, leafSprite, 0);
// Render overlay for fruit leaves.
ResourceLocation fruitSpriteLocation = genome.getFruitProvider().getDecorativeSprite();
if (fruitSpriteLocation != null) {
TextureAtlasSprite fruitSprite = map.getAtlasSprite(fruitSpriteLocation.toString());
baker.addBlockModel(null, fruitSprite, 1);
}
// Set the particle sprite
baker.setParticleSprite(leafSprite);
}
Aggregations