@Override public void colorSpinningIcon(EntityCorporeaSpark entity, float a) { int hex = entity.getNetwork().getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; GlStateManager.color(r / 255F, g / 255F, b / 255F, a); }
@SideOnly(Side.CLIENT) @Override public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { int hex = state.getValue(BotaniaStateProps.COLOR).getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency * 0.25F) Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); }
@SideOnly(Side.CLIENT) @Override public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { int hex = state.getValue(BotaniaStateProps.COLOR).getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency) Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); }
@Override @SideOnly(Side.CLIENT) public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { state = getActualState(state, world, pos); int hex = state.getValue(second ? BotaniaStateProps.DOUBLEFLOWER_VARIANT_2 : BotaniaStateProps.DOUBLEFLOWER_VARIANT_1).getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency) Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.5 + rand.nextFloat() * 0.5, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); }
@SideOnly(Side.CLIENT) @Override public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { int hex = state.getValue(BotaniaStateProps.COLOR).getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; Vec3d offset = state.getOffset(world, pos); double x = pos.getX() + offset.x; double y = pos.getY() + offset.y; double z = pos.getZ() + offset.z; if(rand.nextDouble() < ConfigHandler.flowerParticleFrequency) Botania.proxy.sparkleFX(x + 0.3 + rand.nextFloat() * 0.5, y + 0.5 + rand.nextFloat() * 0.5, z + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); }
@SideOnly(Side.CLIENT) @Override public void randomDisplayTick(IBlockState state, World world, BlockPos pos, Random rand) { EnumDyeColor color = state.getValue(BotaniaStateProps.COLOR); int hex = color.getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8; int b = hex & 0xFF; Botania.proxy.setSparkleFXNoClip(true); Botania.proxy.sparkleFX(pos.getX() + 0.3 + rand.nextFloat() * 0.5, pos.getY() + 0.1 + rand.nextFloat() * 0.1, pos.getZ() + 0.3 + rand.nextFloat() * 0.5, r / 255F, g / 255F, b / 255F, rand.nextFloat(), 5); Botania.proxy.setSparkleFXNoClip(false); }
case PAINT_LENS: { EnumDyeColor placeColor = EnumDyeColor.byMetadata(message.args[0]); int hex = placeColor.getColorValue(); int r = (hex & 0xFF0000) >> 16; int g = (hex & 0xFF00) >> 8;
return Color.HSBtoRGB(time * 0.005F, 0.6F, 1F); } else { return state.getValue(BotaniaStateProps.COLOR).getColorValue(); return EnumDyeColor.byMetadata(meta).getColorValue(); }, ModBlocks.petalBlock t == 1 ? EnumDyeColor.byMetadata(ItemTwigWand.getColor1(s)).getColorValue() : t == 2 ? EnumDyeColor.byMetadata(ItemTwigWand.getColor2(s)).getColorValue() : -1, ModItems.twigWand); items.registerItemColorHandler((s, t) -> EnumDyeColor.byMetadata(s.getItemDamage()).getColorValue(), ModItems.dye, ModItems.petal); items.registerItemColorHandler((s, t) -> Minecraft.getMinecraft().getBlockColors().colorMultiplier(((ItemBlock)s.getItem()).getBlock().getStateFromMeta(s.getMetadata()), null, null, t), ModBlocks.petalBlock, ModBlocks.pool, ModBlocks.spreader);
private List<BakedQuad> getQuadsForFrequency( final short frequency, final boolean active ) { final AEColor[] colors = Platform.p2p().toColors( frequency ); final CubeBuilder cb = new CubeBuilder( this.format ); cb.setTexture( this.texture ); cb.useStandardUV(); cb.setRenderFullBright( active ); for( int i = 0; i < 4; ++i ) { final int[] offs = QUAD_OFFSETS[i]; for( int j = 0; j < 4; ++j ) { final AEColor c = colors[j]; if( active ) { cb.setColorRGB( c.dye.getColorValue() ); } else { final float cv[] = c.dye.getColorComponentValues(); cb.setColorRGB( cv[0] * 0.5f, cv[1] * 0.5f, cv[2] * 0.5f ); } final int startx = j % 2; final int starty = 1 - j / 2; cb.addCube( offs[0] + startx, offs[1] + starty, offs[2], offs[0] + startx + 1, offs[1] + starty + 1, offs[2] + 1 ); } } return cb.getOutput(); }
@Override public int getBlockTint(@Nonnull IBlockState state, @Nullable IBlockAccess worldIn, @Nullable BlockPos pos, int tintIndex) { if (PersonalConfig.candyColors.get()) { return state.getValue(BlockColored.COLOR).getColorValue(); } else { return MapColor.getBlockColor(state.getValue(BlockColored.COLOR)).colorValue; } }
public static int getColour(ItemStack wand) { NBTTagCompound tags = UtilNBT.getItemStackNBT(wand); if (tags.hasKey(NBT_COLOUR) == false) { return EnumDyeColor.BROWN.getColorValue(); } return tags.getInteger(NBT_COLOUR); }
@Override public void init(FMLInitializationEvent event) { super.init(event); Minecraft.getMinecraft().getBlockColors().registerBlockColorHandler((state, world, pos, tintIndex) -> { if (world != null && pos != null) { TileEntity tileEntity = world.getTileEntity(pos); if (tileEntity instanceof TileFridge) { TileFridge baseFridge = ((TileFridge) tileEntity).getBaseFridge(); return baseFridge.getFridgeColor().getColorValue(); } } return 0xFFFFFFFF; }, ModBlocks.fridge); }
@Override public void initGui() { super.initGui(); int y = this.guiTop + 138; int x = this.guiLeft + 194; int id = 75, size = Const.SQ; buttonToggle = new GuiButtonTexture(id++, x, y, size, size); buttonToggle.setTooltip("item.storage_bag.toggle"); this.addButton(buttonToggle); y += 20; buttonTogglePickup = new GuiButtonTexture(id++, x, y, size, size); buttonTogglePickup.setTooltip("item.storage_bag.togglepickup"); this.addButton(buttonTogglePickup); int i = 0; size = 12; y = this.guiTop; x = this.guiLeft; for (EnumDyeColor color : EnumDyeColor.values()) { GuiButtonTooltip buttonColour = new GuiButtonTooltip(color.getColorValue(), x - size, y + size * i, size, size, color.name().substring(0, 1)); buttonColour.setTooltip(UtilChat.lang("colour." + color.getTranslationKey() + ".name")); buttonColour.packedFGColour = color.getColorValue(); this.addButton(buttonColour); i++; } }
@SubscribeEvent @SideOnly(Side.CLIENT) @SuppressWarnings("deprecation") public static void registerColorHandlerItems(ColorHandlerEvent.Item event) { ItemColors itemColors = event.getItemColors(); itemColors.registerItemColorHandler((stack, tintIndex) -> event.getBlockColors().colorMultiplier(((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()), null, null, tintIndex), BlocksTFC.getAllBlockRockVariants().stream().filter(x -> x.type.isGrass).toArray(BlockRockVariant[]::new)); itemColors.registerItemColorHandler((stack, tintIndex) -> event.getBlockColors().colorMultiplier(((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()), null, null, tintIndex), BlocksTFC.PEAT_GRASS); itemColors.registerItemColorHandler((stack, tintIndex) -> event.getBlockColors().colorMultiplier(((ItemBlock) stack.getItem()).getBlock().getStateFromMeta(stack.getMetadata()), null, null, tintIndex), BlocksTFC.getAllLeafBlocks().toArray(new BlockLeavesTFC[0])); itemColors.registerItemColorHandler((stack, tintIndex) -> tintIndex == 1 ? EnumDyeColor.byDyeDamage(stack.getItemDamage()).getColorValue() : 0xFFFFFF, ItemsTFC.CERAMICS_UNFIRED_VESSEL_GLAZED, ItemsTFC.CERAMICS_FIRED_VESSEL_GLAZED); }
int color = fridgeColor.getColorValue(); dispatcher.getBlockModelRenderer().renderModelBrightnessColor(model, 1f, (float) (color >> 16 & 255) / 255f, (float) (color >> 8 & 255) / 255f, (float) (color & 255) / 255f); if (isFlipped) {