Исходник ArrayList Forge 1.16.5 Ready

Forge Api ;-;
Начинающий
Статус
Оффлайн
Регистрация
3 Май 2023
Сообщения
477
Реакции[?]
8
Поинты[?]
9K
ArrayList.docx:
public AnimationUtil animation = new AnimationUtil(0.1f);

@SubscribeEvent
    public void onRenderGameOverlay(RenderGameOverlayEvent.Text renderGameOverlay) {
        ArrayList<Feature> sortedFeatures = new ArrayList<>();
       
for (Feature feature : FeatureManager.features) {
                        if (feature.included) {
                            sortedFeatures.add(feature);
                        }
                    }
                    float y = 0;

                    sortedFeatures.sort((feature1, feature2) -> (int) (Font.font.getWidth(feature2.name) - Font.font.getWidth(feature1.name)));

                    int[] mval = new int[]{0};
                        for (Feature feature : sortedFeatures) {
                            feature.animation.to = feature.included ? 1 : 0;
                            if (feature.animation.to > 0.1) {
                                float finalY = y;
                                int finalArrayListX = arrayListX;
                                int finalArrayListY = arrayListY;
                                mval[0] = mval[0] - 1;
                                int num = mval[0];
                                int color1 = getColor(num * 5);
                                int color2 = getColor((num + 1) * 5);

                                DrawHelper.drawGradientRect(finalArrayListX, finalArrayListY + finalY, Font.font.getWidth(feature.name) - 0.5f, 10.5f, new Color(color2, true), new Color(color1, true), new Color(color2, true), new Color(color1, true));

                                DrawHelper.drawRoundedGradientBlurredRect(finalArrayListX + 2, finalArrayListY + finalY, Font.font.getWidth(feature.name) - 4.5f, 10.5f, 0, 13, new Color(color2), new Color(color1), new Color(color2), new Color(color1));
                            }
                            StyledFontRenderer.drawString(renderGameOverlay.getMatrixStack(), Font.font, feature.name, arrayListX - 1.5f, arrayListY + y, new Color(255, 255, 255));
                            y += feature.animation.getAnim() * 10;
                        }
Methods:
public int getColor(float offset) {
        int rgb = TwoColoreffect(color1, color2, (double)Math.abs(System.currentTimeMillis() / 10L) / 100.0 + 6.0 * ((double)offset * 0.1) / 60.0).getRGB();

        int red = (rgb >> 16) & 0xFF;
        int green = (rgb >> 8) & 0xFF;
        int blue = rgb & 0xFF;

        int alpha = 255;

        return (alpha << 24) | (red << 16) | (green << 8) | blue;
    }

public static Color TwoColoreffect(Color color1, Color color2, double n) {
        float clampValue = clamp((float)Math.sin(Math.PI * 6 * (n / 4.0 % 1.0)) / 2.0f + 0.5f, 0.0f, 1.0f);

        float[] hsb1 = Color.RGBtoHSB(color1.getRed(), color1.getGreen(), color1.getBlue(), null);
        hsb1[1] = clamp(hsb1[1] * 1.2f, 0.0f, 1.0f);
        hsb1[2] = clamp(hsb1[2] * 1.2f, 0.0f, 1.0f);
        int rgb1 = Color.HSBtoRGB(hsb1[0], hsb1[1], hsb1[2]);
        Color enhancedColor1 = new Color((rgb1 >> 16) & 0xFF, (rgb1 >> 8) & 0xFF, rgb1 & 0xFF, color1.getAlpha());

        float[] hsb2 = Color.RGBtoHSB(color2.getRed(), color2.getGreen(), color2.getBlue(), null);
        hsb2[1] = clamp(hsb2[1] * 1.2f, 0.0f, 1.0f);
        hsb2[2] = clamp(hsb2[2] * 1.2f, 0.0f, 1.0f);
        int rgb2 = Color.HSBtoRGB(hsb2[0], hsb2[1], hsb2[2]);
        Color enhancedColor2 = new Color((rgb2 >> 16) & 0xFF, (rgb2 >> 8) & 0xFF, rgb2 & 0xFF, color2.getAlpha());

        return new Color(
                lerp((float)enhancedColor1.getRed() / 255.0f, (float)enhancedColor2.getRed() / 255.0f, clampValue),
                lerp((float)enhancedColor1.getGreen() / 255.0f, (float)enhancedColor2.getGreen() / 255.0f, clampValue),
                lerp((float)enhancedColor1.getBlue() / 255.0f, (float)enhancedColor2.getBlue() / 255.0f, clampValue),
                lerp((float)color1.getAlpha() / 255.0f, (float)color2.getAlpha() / 255.0f, clampValue)
        );
    }

    public static float lerp(float a, float b, float f) {
      return a + f * (b - a);
    }

    public static float clamp(float val, float min, float max) {
        if (val <= min) {
            val = min;
        }
        if (val >= max) {
            val = max;
        }
        return val;
    }
Animation.bruh:
public class AnimationUtil {
    public float anim, to, speed;
    long mc = System.currentTimeMillis();

    public AnimationUtil(float speed) {
        this.speed = speed;
    }

    public float getAnim() {
        int count = (int) ((System.currentTimeMillis() - mc) / 5);
        if (count > 0) {
            mc = System.currentTimeMillis();
        }
        for (int i = 0; i < count; i++) {
            anim = MathUtil.lerp(anim, to, speed);
        }
        return anim;
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


Думаю как гетнуть цвета вашей темы вы знаете, а так собственно там каждый запастить сможет
 
Начинающий
Статус
Оффлайн
Регистрация
20 Дек 2023
Сообщения
126
Реакции[?]
0
Поинты[?]
0
ArrayList.docx:
public AnimationUtil animation = new AnimationUtil(0.1f);

@SubscribeEvent
    public void onRenderGameOverlay(RenderGameOverlayEvent.Text renderGameOverlay) {
        ArrayList<Feature> sortedFeatures = new ArrayList<>();
      
for (Feature feature : FeatureManager.features) {
                        if (feature.included) {
                            sortedFeatures.add(feature);
                        }
                    }
                    float y = 0;

                    sortedFeatures.sort((feature1, feature2) -> (int) (Font.font.getWidth(feature2.name) - Font.font.getWidth(feature1.name)));

                    int[] mval = new int[]{0};
                        for (Feature feature : sortedFeatures) {
                            feature.animation.to = feature.included ? 1 : 0;
                            if (feature.animation.to > 0.1) {
                                float finalY = y;
                                int finalArrayListX = arrayListX;
                                int finalArrayListY = arrayListY;
                                mval[0] = mval[0] - 1;
                                int num = mval[0];
                                int color1 = getColor(num * 5);
                                int color2 = getColor((num + 1) * 5);

                                DrawHelper.drawGradientRect(finalArrayListX, finalArrayListY + finalY, Font.font.getWidth(feature.name) - 0.5f, 10.5f, new Color(color2, true), new Color(color1, true), new Color(color2, true), new Color(color1, true));

                                DrawHelper.drawRoundedGradientBlurredRect(finalArrayListX + 2, finalArrayListY + finalY, Font.font.getWidth(feature.name) - 4.5f, 10.5f, 0, 13, new Color(color2), new Color(color1), new Color(color2), new Color(color1));
                            }
                            StyledFontRenderer.drawString(renderGameOverlay.getMatrixStack(), Font.font, feature.name, arrayListX - 1.5f, arrayListY + y, new Color(255, 255, 255));
                            y += feature.animation.getAnim() * 10;
                        }
Methods:
public int getColor(float offset) {
        int rgb = TwoColoreffect(color1, color2, (double)Math.abs(System.currentTimeMillis() / 10L) / 100.0 + 6.0 * ((double)offset * 0.1) / 60.0).getRGB();

        int red = (rgb >> 16) & 0xFF;
        int green = (rgb >> 8) & 0xFF;
        int blue = rgb & 0xFF;

        int alpha = 255;

        return (alpha << 24) | (red << 16) | (green << 8) | blue;
    }

public static Color TwoColoreffect(Color color1, Color color2, double n) {
        float clampValue = clamp((float)Math.sin(Math.PI * 6 * (n / 4.0 % 1.0)) / 2.0f + 0.5f, 0.0f, 1.0f);

        float[] hsb1 = Color.RGBtoHSB(color1.getRed(), color1.getGreen(), color1.getBlue(), null);
        hsb1[1] = clamp(hsb1[1] * 1.2f, 0.0f, 1.0f);
        hsb1[2] = clamp(hsb1[2] * 1.2f, 0.0f, 1.0f);
        int rgb1 = Color.HSBtoRGB(hsb1[0], hsb1[1], hsb1[2]);
        Color enhancedColor1 = new Color((rgb1 >> 16) & 0xFF, (rgb1 >> 8) & 0xFF, rgb1 & 0xFF, color1.getAlpha());

        float[] hsb2 = Color.RGBtoHSB(color2.getRed(), color2.getGreen(), color2.getBlue(), null);
        hsb2[1] = clamp(hsb2[1] * 1.2f, 0.0f, 1.0f);
        hsb2[2] = clamp(hsb2[2] * 1.2f, 0.0f, 1.0f);
        int rgb2 = Color.HSBtoRGB(hsb2[0], hsb2[1], hsb2[2]);
        Color enhancedColor2 = new Color((rgb2 >> 16) & 0xFF, (rgb2 >> 8) & 0xFF, rgb2 & 0xFF, color2.getAlpha());

        return new Color(
                lerp((float)enhancedColor1.getRed() / 255.0f, (float)enhancedColor2.getRed() / 255.0f, clampValue),
                lerp((float)enhancedColor1.getGreen() / 255.0f, (float)enhancedColor2.getGreen() / 255.0f, clampValue),
                lerp((float)enhancedColor1.getBlue() / 255.0f, (float)enhancedColor2.getBlue() / 255.0f, clampValue),
                lerp((float)color1.getAlpha() / 255.0f, (float)color2.getAlpha() / 255.0f, clampValue)
        );
    }

    public static float lerp(float a, float b, float f) {
      return a + f * (b - a);
    }

    public static float clamp(float val, float min, float max) {
        if (val <= min) {
            val = min;
        }
        if (val >= max) {
            val = max;
        }
        return val;
    }
Animation.bruh:
public class AnimationUtil {
    public float anim, to, speed;
    long mc = System.currentTimeMillis();

    public AnimationUtil(float speed) {
        this.speed = speed;
    }

    public float getAnim() {
        int count = (int) ((System.currentTimeMillis() - mc) / 5);
        if (count > 0) {
            mc = System.currentTimeMillis();
        }
        for (int i = 0; i < count; i++) {
            anim = MathUtil.lerp(anim, to, speed);
        }
        return anim;
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


Думаю как гетнуть цвета вашей темы вы знаете, а так собственно там каждый запастить сможет
приколдесно
 
Начинающий
Статус
Оффлайн
Регистрация
15 Дек 2023
Сообщения
85
Реакции[?]
1
Поинты[?]
2K
ArrayList.docx:
public AnimationUtil animation = new AnimationUtil(0.1f);

@SubscribeEvent
    public void onRenderGameOverlay(RenderGameOverlayEvent.Text renderGameOverlay) {
        ArrayList<Feature> sortedFeatures = new ArrayList<>();
      
for (Feature feature : FeatureManager.features) {
                        if (feature.included) {
                            sortedFeatures.add(feature);
                        }
                    }
                    float y = 0;

                    sortedFeatures.sort((feature1, feature2) -> (int) (Font.font.getWidth(feature2.name) - Font.font.getWidth(feature1.name)));

                    int[] mval = new int[]{0};
                        for (Feature feature : sortedFeatures) {
                            feature.animation.to = feature.included ? 1 : 0;
                            if (feature.animation.to > 0.1) {
                                float finalY = y;
                                int finalArrayListX = arrayListX;
                                int finalArrayListY = arrayListY;
                                mval[0] = mval[0] - 1;
                                int num = mval[0];
                                int color1 = getColor(num * 5);
                                int color2 = getColor((num + 1) * 5);

                                DrawHelper.drawGradientRect(finalArrayListX, finalArrayListY + finalY, Font.font.getWidth(feature.name) - 0.5f, 10.5f, new Color(color2, true), new Color(color1, true), new Color(color2, true), new Color(color1, true));

                                DrawHelper.drawRoundedGradientBlurredRect(finalArrayListX + 2, finalArrayListY + finalY, Font.font.getWidth(feature.name) - 4.5f, 10.5f, 0, 13, new Color(color2), new Color(color1), new Color(color2), new Color(color1));
                            }
                            StyledFontRenderer.drawString(renderGameOverlay.getMatrixStack(), Font.font, feature.name, arrayListX - 1.5f, arrayListY + y, new Color(255, 255, 255));
                            y += feature.animation.getAnim() * 10;
                        }
Methods:
public int getColor(float offset) {
        int rgb = TwoColoreffect(color1, color2, (double)Math.abs(System.currentTimeMillis() / 10L) / 100.0 + 6.0 * ((double)offset * 0.1) / 60.0).getRGB();

        int red = (rgb >> 16) & 0xFF;
        int green = (rgb >> 8) & 0xFF;
        int blue = rgb & 0xFF;

        int alpha = 255;

        return (alpha << 24) | (red << 16) | (green << 8) | blue;
    }

public static Color TwoColoreffect(Color color1, Color color2, double n) {
        float clampValue = clamp((float)Math.sin(Math.PI * 6 * (n / 4.0 % 1.0)) / 2.0f + 0.5f, 0.0f, 1.0f);

        float[] hsb1 = Color.RGBtoHSB(color1.getRed(), color1.getGreen(), color1.getBlue(), null);
        hsb1[1] = clamp(hsb1[1] * 1.2f, 0.0f, 1.0f);
        hsb1[2] = clamp(hsb1[2] * 1.2f, 0.0f, 1.0f);
        int rgb1 = Color.HSBtoRGB(hsb1[0], hsb1[1], hsb1[2]);
        Color enhancedColor1 = new Color((rgb1 >> 16) & 0xFF, (rgb1 >> 8) & 0xFF, rgb1 & 0xFF, color1.getAlpha());

        float[] hsb2 = Color.RGBtoHSB(color2.getRed(), color2.getGreen(), color2.getBlue(), null);
        hsb2[1] = clamp(hsb2[1] * 1.2f, 0.0f, 1.0f);
        hsb2[2] = clamp(hsb2[2] * 1.2f, 0.0f, 1.0f);
        int rgb2 = Color.HSBtoRGB(hsb2[0], hsb2[1], hsb2[2]);
        Color enhancedColor2 = new Color((rgb2 >> 16) & 0xFF, (rgb2 >> 8) & 0xFF, rgb2 & 0xFF, color2.getAlpha());

        return new Color(
                lerp((float)enhancedColor1.getRed() / 255.0f, (float)enhancedColor2.getRed() / 255.0f, clampValue),
                lerp((float)enhancedColor1.getGreen() / 255.0f, (float)enhancedColor2.getGreen() / 255.0f, clampValue),
                lerp((float)enhancedColor1.getBlue() / 255.0f, (float)enhancedColor2.getBlue() / 255.0f, clampValue),
                lerp((float)color1.getAlpha() / 255.0f, (float)color2.getAlpha() / 255.0f, clampValue)
        );
    }

    public static float lerp(float a, float b, float f) {
      return a + f * (b - a);
    }

    public static float clamp(float val, float min, float max) {
        if (val <= min) {
            val = min;
        }
        if (val >= max) {
            val = max;
        }
        return val;
    }
Animation.bruh:
public class AnimationUtil {
    public float anim, to, speed;
    long mc = System.currentTimeMillis();

    public AnimationUtil(float speed) {
        this.speed = speed;
    }

    public float getAnim() {
        int count = (int) ((System.currentTimeMillis() - mc) / 5);
        if (count > 0) {
            mc = System.currentTimeMillis();
        }
        for (int i = 0; i < count; i++) {
            anim = MathUtil.lerp(anim, to, speed);
        }
        return anim;
    }
}
Пожалуйста, авторизуйтесь для просмотра ссылки.

Пожалуйста, авторизуйтесь для просмотра ссылки.


Думаю как гетнуть цвета вашей темы вы знаете, а так собственно там каждый запастить сможет
нихуя, красиво
 
Похожие темы
Сверху Снизу