use of net.minecraft.client.renderer.color.BlockColors 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.BlockColors in project MorePlanets by SteveKunG.
the class ClientProxyMP method registerInitRendering.
@Override
public void registerInitRendering() {
BlockColors color = Minecraft.getMinecraft().getBlockColors();
ItemModelRenderer.init();
TileEntityRenderer.init();
ClientRegisterHelper.registerBlockColor((state, world, pos, tint) -> world != null && pos != null ? BiomeColorHelper.getGrassColorAtPos(world, pos) : ColorizerGrass.getGrassColor(0.5D, 1.0D), FronosBlocks.FRONOS_GRASS);
ClientRegisterHelper.registerBlockColor((state, world, pos, tint) -> ColorHelper.rgbToDecimal(120, 85, 190), DionaBlocks.LARGE_INFECTED_CRYSTALLIZE);
ClientRegisterHelper.registerBlockColor((state, world, pos, tint) -> ColorHelper.rgbToDecimal(50, 101, 236), NibiruBlocks.MULTALIC_CRYSTAL);
ClientRegisterHelper.registerBlockColor((state, world, pos, tint) -> ColorHelper.rgbToDecimal(50, 101, 236), NibiruBlocks.MULTALIC_CRYSTAL_BLOCK);
ClientRegisterHelper.registerBlockColor((state, world, pos, tint) -> ColorHelper.rgbToDecimal(143, 55, 33), NibiruBlocks.INFECTED_MELON_STEM);
ClientRegisterHelper.registerItemColor((itemStack, tintIndex) -> color.colorMultiplier(((ItemBlock) itemStack.getItem()).getBlock().getStateFromMeta(itemStack.getMetadata()), null, null, tintIndex), FronosBlocks.FRONOS_GRASS);
ClientRegisterHelper.registerItemColor((itemStack, tintIndex) -> ColorHelper.rgbToDecimal(50, 101, 236), NibiruBlocks.MULTALIC_CRYSTAL_BLOCK);
ClientRegisterHelper.registerItemColor((itemStack, tintIndex) -> itemStack.hasTagCompound() && tintIndex == 1 ? itemStack.getTagCompound().getInteger("Color") : -1, MPItems.CAPSULE);
}
use of net.minecraft.client.renderer.color.BlockColors in project Ceramics by KnightMiner.
the class ClientProxy method init.
@Override
public void init() {
final BlockColors blockColors = minecraft.getBlockColors();
// porcelain colors
if (Config.porcelainEnabled) {
Block[] blocks;
if (Config.barrelEnabled) {
blocks = new Block[] { Ceramics.porcelain, Ceramics.porcelainBarrel, Ceramics.porcelainBarrelExtension };
} else {
blocks = new Block[] { Ceramics.porcelain };
}
blockColors.registerBlockColorHandler((state, access, pos, tintIndex) -> state.getValue(BlockStained.COLOR).getColor(), blocks);
minecraft.getItemColors().registerItemColorHandler((stack, tintIndex) -> {
@SuppressWarnings("deprecation") IBlockState iblockstate = ((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata());
return blockColors.colorMultiplier(iblockstate, null, null, tintIndex);
}, blocks);
}
}
use of net.minecraft.client.renderer.color.BlockColors in project Bewitchment by Um-Mitternacht.
the class ClientProxy method init.
@Override
public void init(FMLInitializationEvent event) {
Keybinds.registerKeys();
BlockColors blocks = Minecraft.getMinecraft().getBlockColors();
// Block Colors
blocks.registerBlockColorHandler(new BlockCandleColorHandler(), ModBlocks.candle_medium, ModBlocks.candle_small, ModBlocks.candle_medium_lit, ModBlocks.candle_small_lit);
blocks.registerBlockColorHandler(new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
EnumGlyphType type = state.getValue(BlockCircleGlyph.TYPE);
switch(type) {
case ENDER:
return 0x770077;
case GOLDEN:
return 0xe3dc3c;
case NETHER:
return 0xbb0000;
default:
case NORMAL:
return 0xFFFFFF;
case ANY:
// A green one should never happen!
return 0x00FF00;
}
}
}, ModBlocks.ritual_glyphs);
blocks.registerBlockColorHandler(new IBlockColor() {
@Override
public int colorMultiplier(IBlockState state, IBlockAccess worldIn, BlockPos pos, int tintIndex) {
if (tintIndex == 1) {
return Color.HSBtoRGB((pos.getX() + pos.getY() + pos.getZ()) % 50 / 50f, 0.4f, 1f);
}
return -1;
}
}, ModBlocks.crystal_ball);
ItemColors items = Minecraft.getMinecraft().getItemColors();
// Item Colors
items.registerItemColorHandler(new ItemCandleColorHandler(), 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);
items.registerItemColorHandler(new IItemColor() {
@Override
public int colorMultiplier(ItemStack stack, int tintIndex) {
if (tintIndex == 0) {
ISpell s = ItemSpellPage.getSpellFromItemStack(stack);
if (s != null)
return s.getColor();
}
return -1;
}
}, ModItems.spell_page);
NetworkRegistry.INSTANCE.registerGuiHandler(Bewitchment.instance, new GuiHandler());
}
use of net.minecraft.client.renderer.color.BlockColors in project BuildCraft by BuildCraft.
the class PluggableFacade method getBlockColor.
@Override
@SideOnly(Side.CLIENT)
public int getBlockColor(int tintIndex) {
FacadePhasedState state = states.phasedStates[activeState];
BlockColors colours = Minecraft.getMinecraft().getBlockColors();
return colours.colorMultiplier(state.stateInfo.state, holder.getPipeWorld(), holder.getPipePos(), tintIndex);
}
Aggregations