Search in sources :

Example 6 with BlockETDecorativeLeaves

use of binnie.extratrees.blocks.BlockETDecorativeLeaves in project Binnie by ForestryMC.

the class ModelETDecorativeLeaves method getInventoryKey.

@Override
protected ETTreeDefinition getInventoryKey(ItemStack stack) {
    Block block = Block.getBlockFromItem(stack.getItem());
    if (!(block instanceof BlockETDecorativeLeaves)) {
        return null;
    }
    BlockETDecorativeLeaves bBlock = (BlockETDecorativeLeaves) block;
    return bBlock.getTreeType(stack.getMetadata());
}
Also used : BlockETDecorativeLeaves(binnie.extratrees.blocks.BlockETDecorativeLeaves) Block(net.minecraft.block.Block)

Example 7 with BlockETDecorativeLeaves

use of binnie.extratrees.blocks.BlockETDecorativeLeaves in project Binnie by ForestryMC.

the class ItemBlockETDecorativeLeaves method getColorFromItemstack.

@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemstack(ItemStack itemStack, int renderPass) {
    int meta = itemStack.getMetadata();
    BlockETDecorativeLeaves block = getBlock();
    ETTreeDefinition treeDefinition = block.getTreeType(meta);
    if (treeDefinition == null) {
        return ModuleArboriculture.proxy.getFoliageColorBasic();
    }
    ITreeGenome genome = treeDefinition.getGenome();
    if (renderPass == 0) {
        return genome.getPrimary().getLeafSpriteProvider().getColor(false);
    } else {
        IFruitProvider fruitProvider = genome.getFruitProvider();
        return fruitProvider.getDecorativeColor();
    }
}
Also used : BlockETDecorativeLeaves(binnie.extratrees.blocks.BlockETDecorativeLeaves) ETTreeDefinition(binnie.extratrees.genetics.ETTreeDefinition) ITreeGenome(forestry.api.arboriculture.ITreeGenome) IFruitProvider(forestry.api.arboriculture.IFruitProvider) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

BlockETDecorativeLeaves (binnie.extratrees.blocks.BlockETDecorativeLeaves)7 ETTreeDefinition (binnie.extratrees.genetics.ETTreeDefinition)3 BlockETDefaultLeaves (binnie.extratrees.blocks.BlockETDefaultLeaves)2 BlockETSlab (binnie.extratrees.blocks.wood.BlockETSlab)2 Block (net.minecraft.block.Block)2 ModelResourceLocation (net.minecraft.client.renderer.block.model.ModelResourceLocation)2 ItemMetadata (binnie.core.block.ItemMetadata)1 BlockMultiFence (binnie.extratrees.blocks.decor.BlockMultiFence)1 PropertyETType (binnie.extratrees.blocks.property.PropertyETType)1 BlockETDoor (binnie.extratrees.blocks.wood.BlockETDoor)1 BlockETFence (binnie.extratrees.blocks.wood.BlockETFence)1 BlockETLog (binnie.extratrees.blocks.wood.BlockETLog)1 BlockETPlank (binnie.extratrees.blocks.wood.BlockETPlank)1 BlockShrubLog (binnie.extratrees.blocks.wood.BlockShrubLog)1 ItemBlockETWoodDoor (binnie.extratrees.blocks.wood.ItemBlockETWoodDoor)1 ItemETSlab (binnie.extratrees.blocks.wood.ItemETSlab)1 ItemBlockETDecorativeLeaves (binnie.extratrees.items.ItemBlockETDecorativeLeaves)1 ModelDefaultETLeaves (binnie.extratrees.models.ModelDefaultETLeaves)1 ModelETDecorativeLeaves (binnie.extratrees.models.ModelETDecorativeLeaves)1 EnumETLog (binnie.extratrees.wood.EnumETLog)1