Search in sources :

Example 6 with TreeDefinition

use of forestry.arboriculture.genetics.TreeDefinition in project ForestryMC by ForestryMC.

the class ItemBlockDecorativeLeaves method getItemStackDisplayName.

@Override
public String getItemStackDisplayName(ItemStack itemStack) {
    int meta = itemStack.getMetadata();
    BlockDecorativeLeaves block = getBlock();
    TreeDefinition treeDefinition = block.getTreeType(meta);
    String unlocalizedSpeciesName = treeDefinition.getUnlocalizedName();
    return ItemBlockLeaves.getDisplayName(unlocalizedSpeciesName);
}
Also used : BlockDecorativeLeaves(forestry.arboriculture.blocks.BlockDecorativeLeaves) TreeDefinition(forestry.arboriculture.genetics.TreeDefinition)

Example 7 with TreeDefinition

use of forestry.arboriculture.genetics.TreeDefinition in project ForestryMC by ForestryMC.

the class ModelDefaultLeaves method getWorldKey.

@Override
protected TreeDefinition getWorldKey(IBlockState state) {
    Block block = state.getBlock();
    Preconditions.checkArgument(block instanceof BlockDefaultLeaves, "state must be for default leaves.");
    BlockDefaultLeaves bBlock = (BlockDefaultLeaves) block;
    TreeDefinition treeDefinition = bBlock.getTreeDefinition(state);
    Preconditions.checkNotNull(treeDefinition);
    return treeDefinition;
}
Also used : Block(net.minecraft.block.Block) TreeDefinition(forestry.arboriculture.genetics.TreeDefinition) BlockDefaultLeaves(forestry.arboriculture.blocks.BlockDefaultLeaves)

Aggregations

TreeDefinition (forestry.arboriculture.genetics.TreeDefinition)7 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 IFruitProvider (forestry.api.arboriculture.IFruitProvider)3 ITreeGenome (forestry.api.arboriculture.ITreeGenome)3 ILeafSpriteProvider (forestry.api.arboriculture.ILeafSpriteProvider)2 BlockDecorativeLeaves (forestry.arboriculture.blocks.BlockDecorativeLeaves)2 BlockDefaultLeaves (forestry.arboriculture.blocks.BlockDefaultLeaves)2 IBlockState (net.minecraft.block.state.IBlockState)2 Preconditions (com.google.common.base.Preconditions)1 EnumForestryWoodType (forestry.api.arboriculture.EnumForestryWoodType)1 EnumGermlingType (forestry.api.arboriculture.EnumGermlingType)1 EnumVanillaWoodType (forestry.api.arboriculture.EnumVanillaWoodType)1 IAlleleFruit (forestry.api.arboriculture.IAlleleFruit)1 ITree (forestry.api.arboriculture.ITree)1 IWoodType (forestry.api.arboriculture.IWoodType)1 TreeManager (forestry.api.arboriculture.TreeManager)1 WoodBlockKind (forestry.api.arboriculture.WoodBlockKind)1 ForestryAPI (forestry.api.core.ForestryAPI)1 IArmorNaturalist (forestry.api.core.IArmorNaturalist)1 AlleleManager (forestry.api.genetics.AlleleManager)1