Search in sources :

Example 1 with ItemColors

use of net.minecraft.client.renderer.color.ItemColors in project Witchworks by Um-Mitternacht.

the class ClientProxy method init.

@Override
public void init(FMLInitializationEvent event) {
    BlockColors blocks = Minecraft.getMinecraft().getBlockColors();
    //Block Colors
    blocks.registerBlockColorHandler(new BlockCandleColorHandler(), ModBlocks.CANDLE_LARGE, ModBlocks.CANDLE_MEDIUM, ModBlocks.CANDLE_SMALL);
    ItemColors items = Minecraft.getMinecraft().getItemColors();
    //Item Colors
    items.registerItemColorHandler(new ItemCandleColorHandler(), Item.getItemFromBlock(ModBlocks.CANDLE_LARGE), Item.getItemFromBlock(ModBlocks.CANDLE_MEDIUM), Item.getItemFromBlock(ModBlocks.CANDLE_SMALL));
    items.registerItemColorHandler(new BrewItemColorHandler(), ModItems.BREW_PHIAL_DRINK, ModItems.BREW_PHIAL_SPLASH, ModItems.BREW_PHIAL_LINGER);
    NetworkRegistry.INSTANCE.registerGuiHandler(WitchWorks.instance, new GuiHandler());
}
Also used : ItemColors(net.minecraft.client.renderer.color.ItemColors) ItemCandleColorHandler(com.witchworks.client.handler.ItemCandleColorHandler) BrewItemColorHandler(com.witchworks.client.handler.BrewItemColorHandler) GuiHandler(com.witchworks.common.core.net.GuiHandler) BlockCandleColorHandler(com.witchworks.client.handler.BlockCandleColorHandler) BlockColors(net.minecraft.client.renderer.color.BlockColors)

Example 2 with ItemColors

use of net.minecraft.client.renderer.color.ItemColors in project ForestryMC by ForestryMC.

the class ItemCrated method getColorFromItemstack.

@Override
@SideOnly(Side.CLIENT)
public int getColorFromItemstack(ItemStack stack, int renderPass) {
    ItemColors colors = Minecraft.getMinecraft().getItemColors();
    if (contained.isEmpty() || renderPass == 100) {
        return -1;
    }
    int color = colors.colorMultiplier(contained, renderPass);
    if (color != -1) {
        return color;
    }
    return -1;
}
Also used : ItemColors(net.minecraft.client.renderer.color.ItemColors) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 3 with ItemColors

use of net.minecraft.client.renderer.color.ItemColors in project Gaia-Dimension by Andromander.

the class ClientEvents method registerItemColors.

@SubscribeEvent
public static void registerItemColors(ColorHandlerEvent.Item e) {
    BlockColors blocks = e.getBlockColors();
    ItemColors items = e.getItemColors();
    items.registerItemColorHandler((stack, tintIndex) -> blocks.colorMultiplier(((ItemBlock) stack.getItem()).getBlock().getDefaultState(), null, null, tintIndex), GDBlocks.glitter_grass, GDBlocks.crystal_growth, GDBlocks.murky_grass, GDBlocks.aura_shoot, GDBlocks.soft_grass);
}
Also used : ItemColors(net.minecraft.client.renderer.color.ItemColors) BlockColors(net.minecraft.client.renderer.color.BlockColors) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent)

Example 4 with ItemColors

use of net.minecraft.client.renderer.color.ItemColors in project Cavern2 by kegare.

the class Cavern method registerItemColors.

@SideOnly(Side.CLIENT)
@SubscribeEvent
public void registerItemColors(ColorHandlerEvent.Item event) {
    ItemColors itemColors = event.getItemColors();
    BlockColors blockColors = event.getBlockColors();
    CaveBlocks.registerItemBlockColors(blockColors, itemColors);
}
Also used : ItemColors(net.minecraft.client.renderer.color.ItemColors) BlockColors(net.minecraft.client.renderer.color.BlockColors) SubscribeEvent(net.minecraftforge.fml.common.eventhandler.SubscribeEvent) SideOnly(net.minecraftforge.fml.relauncher.SideOnly)

Example 5 with ItemColors

use of net.minecraft.client.renderer.color.ItemColors 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)

Aggregations

ItemColors (net.minecraft.client.renderer.color.ItemColors)13 BlockColors (net.minecraft.client.renderer.color.BlockColors)7 IItemColor (net.minecraft.client.renderer.color.IItemColor)4 Item (net.minecraft.item.Item)4 SideOnly (net.minecraftforge.fml.relauncher.SideOnly)4 IBlockState (net.minecraft.block.state.IBlockState)3 ItemStack (net.minecraft.item.ItemStack)3 IColoredBlock (forestry.core.blocks.IColoredBlock)2 IColoredItem (forestry.core.items.IColoredItem)2 Block (net.minecraft.block.Block)2 Minecraft (net.minecraft.client.Minecraft)2 IBlockColor (net.minecraft.client.renderer.color.IBlockColor)2 BlockPos (net.minecraft.util.math.BlockPos)2 IBlockAccess (net.minecraft.world.IBlockAccess)2 SubscribeEvent (net.minecraftforge.fml.common.eventhandler.SubscribeEvent)2 EnumGlyphType (com.bewitchment.api.ritual.EnumGlyphType)1 ISpell (com.bewitchment.api.spell.ISpell)1 GuiHandler (com.bewitchment.common.core.net.GuiHandler)1 ItemWorktableTool (com.codetaylor.mc.artisanworktables.modules.tools.item.ItemWorktableTool)1 ModBlocks (com.oitsjustjose.geolosys.common.blocks.ModBlocks)1