Search in sources :

Example 1 with IColoredBlock

use of forestry.core.blocks.IColoredBlock in project Binnie by ForestryMC.

the class ModelManager method registerItemAndBlockColors.

@SideOnly(Side.CLIENT)
public void registerItemAndBlockColors() {
    Minecraft minecraft = Minecraft.getMinecraft();
    BlockColors blockColors = minecraft.getBlockColors();
    for (IColoredBlock blockColor : blockColorList) {
        if (blockColor instanceof Block) {
            blockColors.registerBlockColorHandler(ColoredBlockBlockColor.INSTANCE, (Block) blockColor);
        }
    }
    ItemColors itemColors = minecraft.getItemColors();
    for (IColoredItem itemColor : itemColorList) {
        if (itemColor instanceof Item) {
            itemColors.registerItemColorHandler(ColoredItemItemColor.INSTANCE, (Item) itemColor);
        }
    }
}
Also used : Item(net.minecraft.item.Item) IColoredItem(forestry.core.items.IColoredItem) IColoredBlock(forestry.core.blocks.IColoredBlock) ItemColors(net.minecraft.client.renderer.color.ItemColors) IColoredBlock(forestry.core.blocks.IColoredBlock) Block(net.minecraft.block.Block) IColoredItem(forestry.core.items.IColoredItem) Minecraft(net.minecraft.client.Minecraft) BlockColors(net.minecraft.client.renderer.color.BlockColors) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 2 with IColoredBlock

use of forestry.core.blocks.IColoredBlock in project ForestryMC by ForestryMC.

the class ModelManager method registerItemAndBlockColors.

@SideOnly(Side.CLIENT)
public void registerItemAndBlockColors() {
    Minecraft minecraft = Minecraft.getMinecraft();
    BlockColors blockColors = minecraft.getBlockColors();
    for (IColoredBlock blockColor : blockColorList) {
        if (blockColor instanceof Block) {
            blockColors.registerBlockColorHandler(ColoredBlockBlockColor.INSTANCE, (Block) blockColor);
        }
    }
    ItemColors itemColors = minecraft.getItemColors();
    for (IColoredItem itemColor : itemColorList) {
        if (itemColor instanceof Item) {
            itemColors.registerItemColorHandler(ColoredItemItemColor.INSTANCE, (Item) itemColor);
        }
    }
}
Also used : Item(net.minecraft.item.Item) IColoredItem(forestry.core.items.IColoredItem) IColoredBlock(forestry.core.blocks.IColoredBlock) ItemColors(net.minecraft.client.renderer.color.ItemColors) IColoredBlock(forestry.core.blocks.IColoredBlock) Block(net.minecraft.block.Block) IColoredItem(forestry.core.items.IColoredItem) Minecraft(net.minecraft.client.Minecraft) BlockColors(net.minecraft.client.renderer.color.BlockColors) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Aggregations

IColoredBlock (forestry.core.blocks.IColoredBlock)2 IColoredItem (forestry.core.items.IColoredItem)2 Block (net.minecraft.block.Block)2 Minecraft (net.minecraft.client.Minecraft)2 BlockColors (net.minecraft.client.renderer.color.BlockColors)2 ItemColors (net.minecraft.client.renderer.color.ItemColors)2 Item (net.minecraft.item.Item)2 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)2