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());
}
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;
}
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);
}
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);
}
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);
}
}
}
Aggregations