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 @Nullable public float[] getBeaconColorMultiplier(@Nonnull IBlockState state, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockPos beaconPos) { if (PersonalConfig.candyColors.get()) { return state.getValue(BlockColored.COLOR).getColorComponentValues(); } else { int colorValue = MapColor.getBlockColor(state.getValue(BlockColored.COLOR)).colorValue; int i = (colorValue & 0xFF0000) >> 16; int j = (colorValue & 0xFF00) >> 8; int k = (colorValue & 0xFF); return new float[] { i / 255.0F, j / 255.0F, k / 255.0F }; } }
if (!DyeUtils.isDye(craftStack)) return ItemStack.EMPTY; float[] afloat = DyeUtils.colorFromStack(craftStack).get().getColorComponentValues(); int j1 = (int) (afloat[0] * 255.0F); int k1 = (int) (afloat[1] * 255.0F);
BeamSegment tileentitybeacon$beamsegment = new BeamSegment(EnumDyeColor.WHITE.getColorComponentValues()); this.beamSegments.add(tileentitybeacon$beamsegment); boolean flag = true; float[] afloat; if (iblockstate.getBlock() == Blocks.STAINED_GLASS) { afloat = iblockstate.getValue(BlockStainedGlass.COLOR).getColorComponentValues(); afloat = iblockstate.getValue(BlockStainedGlassPane.COLOR).getColorComponentValues();
BeamSegment tileentitybeacon$beamsegment = new BeamSegment(EnumDyeColor.WHITE.getColorComponentValues()); this.beamSegments.add(tileentitybeacon$beamsegment); boolean flag = true; float[] afloat; if (iblockstate.getBlock() == Blocks.STAINED_GLASS) { afloat = iblockstate.getValue(BlockStainedGlass.COLOR).getColorComponentValues(); afloat = iblockstate.getValue(BlockStainedGlassPane.COLOR).getColorComponentValues();