Исходник MainMenu

Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
471
Реакции[?]
2
Поинты[?]
1K

Перед прочтением основного контента ниже, пожалуйста, обратите внимание на обновление внутри секции Майна на нашем форуме. У нас появились:

  • бесплатные читы для Майнкрафт — любое использование на свой страх и риск;
  • маркетплейс Майнкрафт — абсолютно любая коммерция, связанная с игрой, за исключением продажи читов (аккаунты, предоставления услуг, поиск кодеров читов и так далее);
  • приватные читы для Minecraft — в этом разделе только платные хаки для игры, покупайте группу "Продавец" и выставляйте на продажу свой софт;
  • обсуждения и гайды — всё тот же раздел с вопросами, но теперь модернизированный: поиск нужных хаков, пати с игроками-читерами и другая полезная информация.

Спасибо!

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

CODE -

Код:
public class MainMenuScreen extends Screen implements IMinecraft {

    public static final RenderSkyboxCube PANORAMA_RESOURCES = new RenderSkyboxCube(new ResourceLocation("textures/gui/title/background/panorama"));
    private static final ResourceLocation PANORAMA_OVERLAY_TEXTURES = new ResourceLocation("textures/gui/title/background/panorama_overlay.png");
    private static final ResourceLocation ACCESSIBILITY_TEXTURES = new ResourceLocation("textures/gui/accessibility.png");
    private final boolean showTitleWronglySpelled;
    private static final ResourceLocation MINECRAFT_TITLE_TEXTURES = new ResourceLocation("textures/gui/title/minecraft.png");
    private static final ResourceLocation MINECRAFT_TITLE_EDITION = new ResourceLocation("textures/gui/title/edition.png");
    private int widthCopyright;
    private int widthCopyrightRest;
    private Screen realmsNotification;
    private boolean hasCheckedForRealmsNotification;
    @Nullable
    private String splashText;
    private final RenderSkybox panorama = new RenderSkybox(PANORAMA_RESOURCES);
    private final boolean showFadeInAnimation;
    private long firstRenderTime;


    public MainMenuScreen() {
        this(false);
    }


    @Override
    public void init(Minecraft minecraft, int width, int height) {
        super.init(minecraft, width, height);
        if (ClientUtils.unHook) {
            if (this.splashText == null) {
                this.splashText = this.minecraft.getSplashes().getSplashText();
            }

            this.widthCopyright = this.font.getStringWidth("Copyright Mojang AB. Do not distribute!");
            this.widthCopyrightRest = this.width - this.widthCopyright - 2;
            int j = this.height / 4 + 48;
            Button button;
            this.addSingleplayerMultiplayerButtons(j, 24);

            if (Reflector.ModListScreen_Constructor.exists()) {
                button = ReflectorForge.makeButtonMods(this, j, 24);
                this.addButton(button);
            }

            this.addButton(new ImageButton(this.width / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.WIDGETS_LOCATION, 256, 256, (p_lambda$init$0_1_) -> this.minecraft.displayGuiScreen(new LanguageScreen(this, this.minecraft.gameSettings, this.minecraft.getLanguageManager())), new TranslationTextComponent("narrator.button.language")));
            this.addButton(new Button(this.width / 2 - 100, j + 72 + 12, 98, 20, new TranslationTextComponent("menu.options"), (p_lambda$init$1_1_) -> this.minecraft.displayGuiScreen(new OptionsScreen(this, this.minecraft.gameSettings))));
            this.addButton(new Button(this.width / 2 + 2, j + 72 + 12, 98, 20, new TranslationTextComponent("menu.quit"), (p_lambda$init$2_1_) -> this.minecraft.shutdown()));
            this.addButton(new ImageButton(this.width / 2 + 104, j + 72 + 12, 20, 20, 0, 0, 20, ACCESSIBILITY_TEXTURES, 32, 64, (p_lambda$init$3_1_) -> this.minecraft.displayGuiScreen(new AccessibilityScreen(this, this.minecraft.gameSettings)), new TranslationTextComponent("narrator.button.accessibility")));
            this.minecraft.setConnectedToRealms(false);

            if (this.minecraft.gameSettings.realmsNotifications && !this.hasCheckedForRealmsNotification) {
                RealmsBridgeScreen realmsbridgescreen = new RealmsBridgeScreen();
                this.realmsNotification = realmsbridgescreen.func_239555_b_(this);
                this.hasCheckedForRealmsNotification = true;
            }

            if (this.areRealmsNotificationsEnabled()) {
                this.realmsNotification.init(this.minecraft, this.width, this.height);
            }

            return;
        }

        int buttonWidth = 140;
        int buttonHeight = 25;
        int offset = buttonHeight + 5;
        int centerY = mw.scaledHeight() / 2 - 50;

        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY, buttonWidth, buttonHeight, new StringTextComponent("Singleplayer"), p_onPress_1_ -> mc.displayGuiScreen(new WorldSelectionScreen(this))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset, buttonWidth, buttonHeight, new StringTextComponent("Multiplayer"), p_onPress_1_ -> mc.displayGuiScreen(new MultiplayerScreen(this))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 2, buttonWidth, buttonHeight, new StringTextComponent("Alt Manager"), p_onPress_1_ -> mc.displayGuiScreen(Manager.ALT)));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 3, buttonWidth, buttonHeight, new StringTextComponent("Settings"), p_onPress_1_ -> mc.displayGuiScreen(new OptionsScreen(this, this.minecraft.gameSettings))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 4, buttonWidth, buttonHeight, new StringTextComponent("Exit"), p_onPress_1_ -> mc.shutdownMinecraftApplet()));
    }

    private boolean areRealmsNotificationsEnabled() {
        return this.minecraft.gameSettings.realmsNotifications && this.realmsNotification != null;
    }

    private void addSingleplayerMultiplayerButtons(int yIn, int rowHeightIn) {
        this.addButton(new Button(this.width / 2 - 100, yIn, 200, 20, new TranslationTextComponent("menu.singleplayer"), (p_lambda$addSingleplayerMultiplayerButtons$4_1_) -> this.minecraft.displayGuiScreen(new WorldSelectionScreen(this))));
        boolean flag = this.minecraft.isMultiplayerEnabled();
        Button.ITooltip button$itooltip = flag ? Button.field_238486_s_ : (p_lambda$addSingleplayerMultiplayerButtons$5_1_, p_lambda$addSingleplayerMultiplayerButtons$5_2_, p_lambda$addSingleplayerMultiplayerButtons$5_3_, p_lambda$addSingleplayerMultiplayerButtons$5_4_) ->
        {
            if (!p_lambda$addSingleplayerMultiplayerButtons$5_1_.active) {
                this.renderTooltip(p_lambda$addSingleplayerMultiplayerButtons$5_2_, this.minecraft.fontRenderer.trimStringToWidth(new TranslationTextComponent("title.multiplayer.disabled"), Math.max(this.width / 2 - 43, 170)), p_lambda$addSingleplayerMultiplayerButtons$5_3_, p_lambda$addSingleplayerMultiplayerButtons$5_4_);
            }
        };
        this.addButton(new Button(this.width / 2 - 100, yIn + rowHeightIn * 1, 200, 20, new TranslationTextComponent("menu.multiplayer"), (p_lambda$addSingleplayerMultiplayerButtons$6_1_) ->
        {
            Screen screen = this.minecraft.gameSettings.skipMultiplayerWarning ? new MultiplayerScreen(this) : new MultiplayerWarningScreen(this);
            this.minecraft.displayGuiScreen(screen);
        }, button$itooltip)).active = flag;
        this.addButton(new Button(this.width / 2 - 100, yIn + rowHeightIn * 2, 200, 20, new TranslationTextComponent("menu.online"), (p_lambda$addSingleplayerMultiplayerButtons$7_1_) -> this.switchToRealms(), button$itooltip)).active = flag;
        if (Reflector.ModListScreen_Constructor.exists() && this.buttons.size() > 0) {
            Widget widget = this.buttons.get(this.buttons.size() - 1);
            widget.x = this.width / 2 + 2;
            widget.setWidth(98);
        }
    }

    private void switchToRealms() {
        RealmsBridgeScreen realmsbridgescreen = new RealmsBridgeScreen();
        realmsbridgescreen.func_231394_a_(this);
    }

    public MainMenuScreen(boolean fadeIn) {
        super(new TranslationTextComponent("narrator.screen.title"));
        this.showFadeInAnimation = fadeIn;
        this.showTitleWronglySpelled = (double) (new Random()).nextFloat() < 1.0E-4D;
    }

    public void tick() {
        if (this.areRealmsNotificationsEnabled()) {
            this.realmsNotification.tick();
        }
    }

    public static CompletableFuture<Void> loadAsync(TextureManager texMngr, Executor backgroundExecutor) {
        return CompletableFuture.allOf(texMngr.loadAsync(MINECRAFT_TITLE_TEXTURES, backgroundExecutor), texMngr.loadAsync(MINECRAFT_TITLE_EDITION, backgroundExecutor), texMngr.loadAsync(PANORAMA_OVERLAY_TEXTURES, backgroundExecutor), PANORAMA_RESOURCES.loadAsync(texMngr, backgroundExecutor));
    }

    public boolean isPauseScreen() {
        return false;
    }

    public boolean shouldCloseOnEsc() {
        return false;

    }



    private final BetterText info = new BetterText(List.of(" ", "Welcome, " + ClientUtils.me.getName()), 4500);
    private final BetterText like = new BetterText(List.of(" ", "Сделано с любовью, Acidka!"), 4500);
    private final Animation hover1 = new DecelerateAnimation(150, 3);
    private final Animation hover2 = new DecelerateAnimation(150, 3);
    private final Animation hover3 = new DecelerateAnimation(150, 3);

    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        if (ClientUtils.unHook) {
            if (this.firstRenderTime == 0L && this.showFadeInAnimation) {
                this.firstRenderTime = Util.milliTime();
                }



            float f = this.showFadeInAnimation ? (float) (Util.milliTime() - this.firstRenderTime) / 1000.0F : 1.0F;
            RenderSystem.disableDepthTest();
            fill(matrixStack, 0, 0, this.width, this.height, -1);
            this.panorama.render(partialTicks, MathHelper.clamp(f, 0.0F, 1.0F));
            int j = this.width / 2 - 137;
            this.minecraft.getTextureManager().bindTexture(PANORAMA_OVERLAY_TEXTURES);
            RenderSystem.enableBlend();
            RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.showFadeInAnimation ? (float) MathHelper.ceil(MathHelper.clamp(f, 0.0F, 1.0F)) : 1.0F);
            blit(matrixStack, 0, 0, this.width, this.height, 0.0F, 0.0F, 16, 128, 16, 128);
            float f1 = this.showFadeInAnimation ? MathHelper.clamp(f - 1.0F, 0.0F, 1.0F) : 1.0F;
            int l = MathHelper.ceil(f1 * 255.0F) << 24;

            if ((l & -67108864) != 0) {
                this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_TEXTURES);
                RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);

                if (this.showTitleWronglySpelled) {
                    this.blitBlackOutline(j, 30, (p_lambda$render$10_2_, p_lambda$render$10_3_) ->
                    {
                        this.blit(matrixStack, p_lambda$render$10_2_ + 0, p_lambda$render$10_3_, 0, 0, 99, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99, p_lambda$render$10_3_, 129, 0, 27, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99 + 26, p_lambda$render$10_3_, 126, 0, 3, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99 + 26 + 3, p_lambda$render$10_3_, 99, 0, 26, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 155, p_lambda$render$10_3_, 0, 45, 155, 44);
                    });
                } else {
                    this.blitBlackOutline(j, 30, (p_lambda$render$11_2_, p_lambda$render$11_3_) ->
                    {
                        this.blit(matrixStack, p_lambda$render$11_2_ + 0, p_lambda$render$11_3_, 0, 0, 155, 44);
                        this.blit(matrixStack, p_lambda$render$11_2_ + 155, p_lambda$render$11_3_, 0, 45, 155, 44);
                    });
                }

                this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_EDITION);
                blit(matrixStack, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);

                if (Reflector.ForgeHooksClient_renderMainMenu.exists()) {
                    Reflector.callVoid(Reflector.ForgeHooksClient_renderMainMenu, this, matrixStack, this.font, this.width, this.height, l);
                }

                if (this.splashText != null) {
                    RenderSystem.pushMatrix();
                    RenderSystem.translatef((float) (this.width / 2 + 90), 70.0F, 0.0F);
                    RenderSystem.rotatef(-20.0F, 0.0F, 0.0F, 1.0F);
                    float f2 = 1.8F - MathHelper.abs(MathHelper.sin((float) (Util.milliTime() % 1000L) / 1000.0F * ((float) Math.PI * 2F)) * 0.1F);
                    f2 = f2 * 100.0F / (float) (this.font.getStringWidth(this.splashText) + 32);
                    RenderSystem.scalef(f2, f2, f2);
                    drawCenteredString(matrixStack, this.font, this.splashText, 0, -8, 16776960 | l);
                    RenderSystem.popMatrix();
                }

                String s = "Minecraft " + SharedConstants.getVersion().getName();

                if (this.minecraft.isDemo()) {
                    s = s + " Demo";
                } else {
                    s = s + ("release".equalsIgnoreCase(this.minecraft.getVersionType()) ? "" : "/" + this.minecraft.getVersionType());
                }

                if (this.minecraft.isModdedClient()) {
                    s = s + I18n.format("menu.modded");
                }

                if (Reflector.BrandingControl.exists()) {
                    if (Reflector.BrandingControl_forEachLine.exists()) {
                        BiConsumer<Integer, String> biconsumer = (p_lambda$render$12_3_, p_lambda$render$12_4_) -> drawString(matrixStack, this.font, p_lambda$render$12_4_, 2, this.height - (10 + p_lambda$render$12_3_ * (9 + 1)), 16777215 | l);
                        Reflector.call(Reflector.BrandingControl_forEachLine, true, true, biconsumer);
                    }

                    if (Reflector.BrandingControl_forEachAboveCopyrightLine.exists()) {
                        BiConsumer<Integer, String> biconsumer1 = (p_lambda$render$13_3_, p_lambda$render$13_4_) -> drawString(matrixStack, this.font, p_lambda$render$13_4_, this.width - this.font.getStringWidth(p_lambda$render$13_4_), this.height - (10 + (p_lambda$render$13_3_ + 1) * (9 + 1)), 16777215 | l);
                        Reflector.call(Reflector.BrandingControl_forEachAboveCopyrightLine, biconsumer1);
                    }
                } else {
                    drawString(matrixStack, this.font, s, 2, this.height - 10, 16777215 | l);
                }

                drawString(matrixStack, this.font, "Copyright Mojang AB. Do not distribute!", this.widthCopyrightRest, this.height - 10, 16777215 | l);

                if (mouseX > this.widthCopyrightRest && mouseX < this.widthCopyrightRest + this.widthCopyright && mouseY > this.height - 10 && mouseY < this.height) {
                    fill(matrixStack, this.widthCopyrightRest, this.height - 1, this.widthCopyrightRest + this.widthCopyright, this.height, 16777215 | l);
                }

                for (Widget widget : this.buttons) {
                    widget.setAlpha(f1);
                }

                if (this.areRealmsNotificationsEnabled() && f1 >= 1.0F) {
                    this.realmsNotification.render(matrixStack, mouseX, mouseY, partialTicks);
                }

                super.render(matrixStack, mouseX, mouseY, partialTicks);
            }

            return;
        }

        Vec2i fixed = ScaleMath.getMouse(mouseX, mouseY);
        mouseX = fixed.getX();
        mouseY = fixed.getY();

        int scaledWidth = mw.scaledWidth();
        int scaledHeight = mw.scaledHeight();

        float centerX = scaledWidth / 2f;
        float centerY = scaledHeight / 2f;

        mc.gameRenderer.setupOverlayRendering(2);
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/i.png"), 0, 0, scaledWidth, scaledHeight, -1);

        boolean hovered1 = RenderUtils.isInRegion(mouseX, mouseY, centerX + 444, centerY + 220, 16, 16);
        hover1.setDirection(hovered1 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered2 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f, centerY + 110, 16, 16);
        hover2.setDirection(hovered2 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered3 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f + 415, centerY + 220, 16, 16);
        hover3.setDirection(hovered3 ? Direction.FORWARDS : Direction.BACKWARDS);

        GaussianBlur.applyBlur(() -> RenderUtils.Render2D.drawRound(centerX - 277 / 2f, centerY - 275.5f / 2f, 277, 275.5f, 10, -1), 40, 2);
        RenderUtils.Render2D.drawRound(centerX - 262 / 2f, centerY - 235 / 2f, 262, 245,25, ColorUtils.rgba(69, 23, 255,65));
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/vk.png"), centerX + 444, (float) (centerY + 220 - hover1.getOutput()), 16, 16, -1);
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/discord.png"), centerX - 16 / 2f + 415, (float) (centerY + 220 - hover3.getOutput()), 16, 16, -1);

        Fonts.fontBold[32].drawCenteredString(matrixStack, info.output, centerX, centerY - 90, -1);
        Fonts.font[24].drawCenteredString(matrixStack, like.output, centerX-390, centerY+240, -1);
        RenderUtils.Render2D.drawRound(centerX + 390, centerY  +204, 90, 45,20, ColorUtils.rgba(69, 23, 255,65));

        renderSnow(matrixStack);
        super.render(matrixStack, mouseX, mouseY, partialTicks);
        mc.gameRenderer.setupOverlayRendering();
    }

    public boolean mouseClicked(double mouseX, double mouseY, int button) {
        Vec2i fixed = ScaleMath.getMouse((int) mouseX, (int) mouseY);
        mouseX = fixed.getX();
        mouseY = fixed.getY();

        int scaledWidth = mw.scaledWidth();
        int scaledHeight = mw.scaledHeight();

        float centerX = scaledWidth / 2f;
        float centerY = scaledHeight / 2f;

        boolean hovered1 = RenderUtils.isInRegion(mouseX, mouseY, centerX + 444, centerY + 220, 16, 16);
        hover1.setDirection(hovered1 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered2 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f +415, centerY + 220, 16, 16);
        hover2.setDirection(hovered2 ? Direction.FORWARDS : Direction.BACKWARDS);

        if (hovered1) {
            Util.getOSType().openURI("https://vk.com/wissendclient");
        } else if (hovered2) {
            Util.getOSType().openURI("https://discord.gg/wissend");
        }

        return super.mouseClicked(mouseX, mouseY, button);
    }

    public void onClose() {
        if (this.realmsNotification != null) {
            this.realmsNotification.onClose();
        }
    }
    class snowflake {
        public float x;
        public float y;
        public float size;
        public float alpha;
    }

    int snowflake_count = 59;

    public List<snowflake> sfs = new ArrayList<snowflake>();

    boolean created = false;
    private final TimerUtils bolvan = new TimerUtils();

    protected void renderSnowflake(MatrixStack matrixStack, snowflake snowflake) {
        Fonts.font[new Random().nextInt(15, 22)].drawString(matrixStack, "?", snowflake.x, snowflake.y, ColorUtils.rgba(255, 255, 255, snowflake.alpha));
    }

    protected void createSnowflakeList() {
        if(!created) {
            for (int i = 1; i <= snowflake_count; i++) {
                snowflake s = new snowflake();
                s.x = new Random().nextInt(140, 1900);
                s.y = new Random().nextInt(-192, 33);
                s.alpha = new Random().nextInt(60, 255);
                s.size = 1;
                sfs.add(s);
                if (i == snowflake_count) { created = true; }
            }
        }
    }

    int f = 1;

    protected void createSnowflakes(MatrixStack matrixStack) {
        if(!created) { return; }

        long l = 10;
        if(bolvan.hasTimeElapsed(l)) {
            for (int i = 1; i <= sfs.size()-1; i++) {
                sfs.get(i).x = sfs.get(i).x - 1;
                sfs.get(i).y = sfs.get(i).y + 1;
                if(i <= sfs.size()-1) { bolvan.reset(); }
            }
        }

        for(int i = 0; i <= sfs.size()-1; i++){
            renderSnowflake(matrixStack, sfs.get(i));
        }

        if (sfs.get(sfs.size()-8).y > 60*f) {
            created = false;
            f++;
        }
        if(sfs.get(sfs.size()-8).y > 1050){
            for (int i = 1; i <= snowflake_count; i++) { sfs.remove(i); f-=0.5; }
        }
    }

    public void renderSnow(MatrixStack matrixStack) {
        createSnowflakeList();
        createSnowflakes(matrixStack);
    }

    public static class CustomButton extends AbstractButton {

        public static final Button.ITooltip field_238486_s_ = (button, matrixStack, mouseX, mouseY) -> {};
        protected final Button.IPressable onPress;
        protected final Button.ITooltip onTooltip;


        public CustomButton(int x, int y, int width, int height, ITextComponent title, Button.IPressable pressedAction) {
            this(x, y, width, height, title, pressedAction, field_238486_s_);
        }

        public CustomButton(int x, int y, int width, int height, ITextComponent title, Button.IPressable pressedAction, Button.ITooltip onTooltip) {
            super(x, y, width, height, title);
            this.onPress = pressedAction;
            this.onTooltip = onTooltip;
        }

        public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
            RenderUtils.Render2D.drawRound(x, y, width, height, 6, ColorUtils.rgba(69, 23, 255,75));
            Fonts.font[22].drawCenteredString(matrixStack, this.getMessage().getString(), x + width / 2f, y + height / 2f - Fonts.font[22].getFontHeight() / 2f + 1.5f, -1);
        }


        public void onPress() {
            this.onPress.onPress(this);
        }
// NOT SELFCODE ONLY PASTE
    }
}
 
ППХУДЕР
Начинающий
Статус
Оффлайн
Регистрация
10 Фев 2020
Сообщения
418
Реакции[?]
23
Поинты[?]
6K
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
471
Реакции[?]
2
Поинты[?]
1K
Начинающий
Статус
Оффлайн
Регистрация
19 Июл 2023
Сообщения
23
Реакции[?]
0
Поинты[?]
0
ППХУДЕР
Начинающий
Статус
Оффлайн
Регистрация
10 Фев 2020
Сообщения
418
Реакции[?]
23
Поинты[?]
6K
а например какие можно использовать? по мне сине фиолетовые оттенки очень красиво смотрятся
ну с опытом ты это поймешь, но для начала, как минимум, твое меню максимально монотонно, не вызывает никакого интереса, скорее даже отталкивает как дефолт паста экспы какой-нибудь
 
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
471
Реакции[?]
2
Поинты[?]
1K

Пожалуйста, зарегистрируйтесь или авторизуйтесь, чтобы увидеть содержимое.


ну с опытом ты это поймешь, но для начала, как минимум, твое меню максимально монотонно, не вызывает никакого интереса, скорее даже отталкивает как дефолт паста экспы какой-нибудь
ну пока что это и есть дефолт паста экспы,но спасибо за советик
 
Начинающий
Статус
Оффлайн
Регистрация
29 Мар 2024
Сообщения
165
Реакции[?]
2
Поинты[?]
0
SS -
Пожалуйста, авторизуйтесь для просмотра ссылки.

CODE -

Код:
public class MainMenuScreen extends Screen implements IMinecraft {

    public static final RenderSkyboxCube PANORAMA_RESOURCES = new RenderSkyboxCube(new ResourceLocation("textures/gui/title/background/panorama"));
    private static final ResourceLocation PANORAMA_OVERLAY_TEXTURES = new ResourceLocation("textures/gui/title/background/panorama_overlay.png");
    private static final ResourceLocation ACCESSIBILITY_TEXTURES = new ResourceLocation("textures/gui/accessibility.png");
    private final boolean showTitleWronglySpelled;
    private static final ResourceLocation MINECRAFT_TITLE_TEXTURES = new ResourceLocation("textures/gui/title/minecraft.png");
    private static final ResourceLocation MINECRAFT_TITLE_EDITION = new ResourceLocation("textures/gui/title/edition.png");
    private int widthCopyright;
    private int widthCopyrightRest;
    private Screen realmsNotification;
    private boolean hasCheckedForRealmsNotification;
    @Nullable
    private String splashText;
    private final RenderSkybox panorama = new RenderSkybox(PANORAMA_RESOURCES);
    private final boolean showFadeInAnimation;
    private long firstRenderTime;


    public MainMenuScreen() {
        this(false);
    }


    @Override
    public void init(Minecraft minecraft, int width, int height) {
        super.init(minecraft, width, height);
        if (ClientUtils.unHook) {
            if (this.splashText == null) {
                this.splashText = this.minecraft.getSplashes().getSplashText();
            }

            this.widthCopyright = this.font.getStringWidth("Copyright Mojang AB. Do not distribute!");
            this.widthCopyrightRest = this.width - this.widthCopyright - 2;
            int j = this.height / 4 + 48;
            Button button;
            this.addSingleplayerMultiplayerButtons(j, 24);

            if (Reflector.ModListScreen_Constructor.exists()) {
                button = ReflectorForge.makeButtonMods(this, j, 24);
                this.addButton(button);
            }

            this.addButton(new ImageButton(this.width / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.WIDGETS_LOCATION, 256, 256, (p_lambda$init$0_1_) -> this.minecraft.displayGuiScreen(new LanguageScreen(this, this.minecraft.gameSettings, this.minecraft.getLanguageManager())), new TranslationTextComponent("narrator.button.language")));
            this.addButton(new Button(this.width / 2 - 100, j + 72 + 12, 98, 20, new TranslationTextComponent("menu.options"), (p_lambda$init$1_1_) -> this.minecraft.displayGuiScreen(new OptionsScreen(this, this.minecraft.gameSettings))));
            this.addButton(new Button(this.width / 2 + 2, j + 72 + 12, 98, 20, new TranslationTextComponent("menu.quit"), (p_lambda$init$2_1_) -> this.minecraft.shutdown()));
            this.addButton(new ImageButton(this.width / 2 + 104, j + 72 + 12, 20, 20, 0, 0, 20, ACCESSIBILITY_TEXTURES, 32, 64, (p_lambda$init$3_1_) -> this.minecraft.displayGuiScreen(new AccessibilityScreen(this, this.minecraft.gameSettings)), new TranslationTextComponent("narrator.button.accessibility")));
            this.minecraft.setConnectedToRealms(false);

            if (this.minecraft.gameSettings.realmsNotifications && !this.hasCheckedForRealmsNotification) {
                RealmsBridgeScreen realmsbridgescreen = new RealmsBridgeScreen();
                this.realmsNotification = realmsbridgescreen.func_239555_b_(this);
                this.hasCheckedForRealmsNotification = true;
            }

            if (this.areRealmsNotificationsEnabled()) {
                this.realmsNotification.init(this.minecraft, this.width, this.height);
            }

            return;
        }

        int buttonWidth = 140;
        int buttonHeight = 25;
        int offset = buttonHeight + 5;
        int centerY = mw.scaledHeight() / 2 - 50;

        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY, buttonWidth, buttonHeight, new StringTextComponent("Singleplayer"), p_onPress_1_ -> mc.displayGuiScreen(new WorldSelectionScreen(this))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset, buttonWidth, buttonHeight, new StringTextComponent("Multiplayer"), p_onPress_1_ -> mc.displayGuiScreen(new MultiplayerScreen(this))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 2, buttonWidth, buttonHeight, new StringTextComponent("Alt Manager"), p_onPress_1_ -> mc.displayGuiScreen(Manager.ALT)));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 3, buttonWidth, buttonHeight, new StringTextComponent("Settings"), p_onPress_1_ -> mc.displayGuiScreen(new OptionsScreen(this, this.minecraft.gameSettings))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 4, buttonWidth, buttonHeight, new StringTextComponent("Exit"), p_onPress_1_ -> mc.shutdownMinecraftApplet()));
    }

    private boolean areRealmsNotificationsEnabled() {
        return this.minecraft.gameSettings.realmsNotifications && this.realmsNotification != null;
    }

    private void addSingleplayerMultiplayerButtons(int yIn, int rowHeightIn) {
        this.addButton(new Button(this.width / 2 - 100, yIn, 200, 20, new TranslationTextComponent("menu.singleplayer"), (p_lambda$addSingleplayerMultiplayerButtons$4_1_) -> this.minecraft.displayGuiScreen(new WorldSelectionScreen(this))));
        boolean flag = this.minecraft.isMultiplayerEnabled();
        Button.ITooltip button$itooltip = flag ? Button.field_238486_s_ : (p_lambda$addSingleplayerMultiplayerButtons$5_1_, p_lambda$addSingleplayerMultiplayerButtons$5_2_, p_lambda$addSingleplayerMultiplayerButtons$5_3_, p_lambda$addSingleplayerMultiplayerButtons$5_4_) ->
        {
            if (!p_lambda$addSingleplayerMultiplayerButtons$5_1_.active) {
                this.renderTooltip(p_lambda$addSingleplayerMultiplayerButtons$5_2_, this.minecraft.fontRenderer.trimStringToWidth(new TranslationTextComponent("title.multiplayer.disabled"), Math.max(this.width / 2 - 43, 170)), p_lambda$addSingleplayerMultiplayerButtons$5_3_, p_lambda$addSingleplayerMultiplayerButtons$5_4_);
            }
        };
        this.addButton(new Button(this.width / 2 - 100, yIn + rowHeightIn * 1, 200, 20, new TranslationTextComponent("menu.multiplayer"), (p_lambda$addSingleplayerMultiplayerButtons$6_1_) ->
        {
            Screen screen = this.minecraft.gameSettings.skipMultiplayerWarning ? new MultiplayerScreen(this) : new MultiplayerWarningScreen(this);
            this.minecraft.displayGuiScreen(screen);
        }, button$itooltip)).active = flag;
        this.addButton(new Button(this.width / 2 - 100, yIn + rowHeightIn * 2, 200, 20, new TranslationTextComponent("menu.online"), (p_lambda$addSingleplayerMultiplayerButtons$7_1_) -> this.switchToRealms(), button$itooltip)).active = flag;
        if (Reflector.ModListScreen_Constructor.exists() && this.buttons.size() > 0) {
            Widget widget = this.buttons.get(this.buttons.size() - 1);
            widget.x = this.width / 2 + 2;
            widget.setWidth(98);
        }
    }

    private void switchToRealms() {
        RealmsBridgeScreen realmsbridgescreen = new RealmsBridgeScreen();
        realmsbridgescreen.func_231394_a_(this);
    }

    public MainMenuScreen(boolean fadeIn) {
        super(new TranslationTextComponent("narrator.screen.title"));
        this.showFadeInAnimation = fadeIn;
        this.showTitleWronglySpelled = (double) (new Random()).nextFloat() < 1.0E-4D;
    }

    public void tick() {
        if (this.areRealmsNotificationsEnabled()) {
            this.realmsNotification.tick();
        }
    }

    public static CompletableFuture<Void> loadAsync(TextureManager texMngr, Executor backgroundExecutor) {
        return CompletableFuture.allOf(texMngr.loadAsync(MINECRAFT_TITLE_TEXTURES, backgroundExecutor), texMngr.loadAsync(MINECRAFT_TITLE_EDITION, backgroundExecutor), texMngr.loadAsync(PANORAMA_OVERLAY_TEXTURES, backgroundExecutor), PANORAMA_RESOURCES.loadAsync(texMngr, backgroundExecutor));
    }

    public boolean isPauseScreen() {
        return false;
    }

    public boolean shouldCloseOnEsc() {
        return false;

    }



    private final BetterText info = new BetterText(List.of(" ", "Welcome, " + ClientUtils.me.getName()), 4500);
    private final BetterText like = new BetterText(List.of(" ", "Сделано с любовью, Acidka!"), 4500);
    private final Animation hover1 = new DecelerateAnimation(150, 3);
    private final Animation hover2 = new DecelerateAnimation(150, 3);
    private final Animation hover3 = new DecelerateAnimation(150, 3);

    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        if (ClientUtils.unHook) {
            if (this.firstRenderTime == 0L && this.showFadeInAnimation) {
                this.firstRenderTime = Util.milliTime();
                }



            float f = this.showFadeInAnimation ? (float) (Util.milliTime() - this.firstRenderTime) / 1000.0F : 1.0F;
            RenderSystem.disableDepthTest();
            fill(matrixStack, 0, 0, this.width, this.height, -1);
            this.panorama.render(partialTicks, MathHelper.clamp(f, 0.0F, 1.0F));
            int j = this.width / 2 - 137;
            this.minecraft.getTextureManager().bindTexture(PANORAMA_OVERLAY_TEXTURES);
            RenderSystem.enableBlend();
            RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.showFadeInAnimation ? (float) MathHelper.ceil(MathHelper.clamp(f, 0.0F, 1.0F)) : 1.0F);
            blit(matrixStack, 0, 0, this.width, this.height, 0.0F, 0.0F, 16, 128, 16, 128);
            float f1 = this.showFadeInAnimation ? MathHelper.clamp(f - 1.0F, 0.0F, 1.0F) : 1.0F;
            int l = MathHelper.ceil(f1 * 255.0F) << 24;

            if ((l & -67108864) != 0) {
                this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_TEXTURES);
                RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);

                if (this.showTitleWronglySpelled) {
                    this.blitBlackOutline(j, 30, (p_lambda$render$10_2_, p_lambda$render$10_3_) ->
                    {
                        this.blit(matrixStack, p_lambda$render$10_2_ + 0, p_lambda$render$10_3_, 0, 0, 99, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99, p_lambda$render$10_3_, 129, 0, 27, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99 + 26, p_lambda$render$10_3_, 126, 0, 3, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99 + 26 + 3, p_lambda$render$10_3_, 99, 0, 26, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 155, p_lambda$render$10_3_, 0, 45, 155, 44);
                    });
                } else {
                    this.blitBlackOutline(j, 30, (p_lambda$render$11_2_, p_lambda$render$11_3_) ->
                    {
                        this.blit(matrixStack, p_lambda$render$11_2_ + 0, p_lambda$render$11_3_, 0, 0, 155, 44);
                        this.blit(matrixStack, p_lambda$render$11_2_ + 155, p_lambda$render$11_3_, 0, 45, 155, 44);
                    });
                }

                this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_EDITION);
                blit(matrixStack, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);

                if (Reflector.ForgeHooksClient_renderMainMenu.exists()) {
                    Reflector.callVoid(Reflector.ForgeHooksClient_renderMainMenu, this, matrixStack, this.font, this.width, this.height, l);
                }

                if (this.splashText != null) {
                    RenderSystem.pushMatrix();
                    RenderSystem.translatef((float) (this.width / 2 + 90), 70.0F, 0.0F);
                    RenderSystem.rotatef(-20.0F, 0.0F, 0.0F, 1.0F);
                    float f2 = 1.8F - MathHelper.abs(MathHelper.sin((float) (Util.milliTime() % 1000L) / 1000.0F * ((float) Math.PI * 2F)) * 0.1F);
                    f2 = f2 * 100.0F / (float) (this.font.getStringWidth(this.splashText) + 32);
                    RenderSystem.scalef(f2, f2, f2);
                    drawCenteredString(matrixStack, this.font, this.splashText, 0, -8, 16776960 | l);
                    RenderSystem.popMatrix();
                }

                String s = "Minecraft " + SharedConstants.getVersion().getName();

                if (this.minecraft.isDemo()) {
                    s = s + " Demo";
                } else {
                    s = s + ("release".equalsIgnoreCase(this.minecraft.getVersionType()) ? "" : "/" + this.minecraft.getVersionType());
                }

                if (this.minecraft.isModdedClient()) {
                    s = s + I18n.format("menu.modded");
                }

                if (Reflector.BrandingControl.exists()) {
                    if (Reflector.BrandingControl_forEachLine.exists()) {
                        BiConsumer<Integer, String> biconsumer = (p_lambda$render$12_3_, p_lambda$render$12_4_) -> drawString(matrixStack, this.font, p_lambda$render$12_4_, 2, this.height - (10 + p_lambda$render$12_3_ * (9 + 1)), 16777215 | l);
                        Reflector.call(Reflector.BrandingControl_forEachLine, true, true, biconsumer);
                    }

                    if (Reflector.BrandingControl_forEachAboveCopyrightLine.exists()) {
                        BiConsumer<Integer, String> biconsumer1 = (p_lambda$render$13_3_, p_lambda$render$13_4_) -> drawString(matrixStack, this.font, p_lambda$render$13_4_, this.width - this.font.getStringWidth(p_lambda$render$13_4_), this.height - (10 + (p_lambda$render$13_3_ + 1) * (9 + 1)), 16777215 | l);
                        Reflector.call(Reflector.BrandingControl_forEachAboveCopyrightLine, biconsumer1);
                    }
                } else {
                    drawString(matrixStack, this.font, s, 2, this.height - 10, 16777215 | l);
                }

                drawString(matrixStack, this.font, "Copyright Mojang AB. Do not distribute!", this.widthCopyrightRest, this.height - 10, 16777215 | l);

                if (mouseX > this.widthCopyrightRest && mouseX < this.widthCopyrightRest + this.widthCopyright && mouseY > this.height - 10 && mouseY < this.height) {
                    fill(matrixStack, this.widthCopyrightRest, this.height - 1, this.widthCopyrightRest + this.widthCopyright, this.height, 16777215 | l);
                }

                for (Widget widget : this.buttons) {
                    widget.setAlpha(f1);
                }

                if (this.areRealmsNotificationsEnabled() && f1 >= 1.0F) {
                    this.realmsNotification.render(matrixStack, mouseX, mouseY, partialTicks);
                }

                super.render(matrixStack, mouseX, mouseY, partialTicks);
            }

            return;
        }

        Vec2i fixed = ScaleMath.getMouse(mouseX, mouseY);
        mouseX = fixed.getX();
        mouseY = fixed.getY();

        int scaledWidth = mw.scaledWidth();
        int scaledHeight = mw.scaledHeight();

        float centerX = scaledWidth / 2f;
        float centerY = scaledHeight / 2f;

        mc.gameRenderer.setupOverlayRendering(2);
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/i.png"), 0, 0, scaledWidth, scaledHeight, -1);

        boolean hovered1 = RenderUtils.isInRegion(mouseX, mouseY, centerX + 444, centerY + 220, 16, 16);
        hover1.setDirection(hovered1 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered2 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f, centerY + 110, 16, 16);
        hover2.setDirection(hovered2 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered3 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f + 415, centerY + 220, 16, 16);
        hover3.setDirection(hovered3 ? Direction.FORWARDS : Direction.BACKWARDS);

        GaussianBlur.applyBlur(() -> RenderUtils.Render2D.drawRound(centerX - 277 / 2f, centerY - 275.5f / 2f, 277, 275.5f, 10, -1), 40, 2);
        RenderUtils.Render2D.drawRound(centerX - 262 / 2f, centerY - 235 / 2f, 262, 245,25, ColorUtils.rgba(69, 23, 255,65));
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/vk.png"), centerX + 444, (float) (centerY + 220 - hover1.getOutput()), 16, 16, -1);
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/discord.png"), centerX - 16 / 2f + 415, (float) (centerY + 220 - hover3.getOutput()), 16, 16, -1);

        Fonts.fontBold[32].drawCenteredString(matrixStack, info.output, centerX, centerY - 90, -1);
        Fonts.font[24].drawCenteredString(matrixStack, like.output, centerX-390, centerY+240, -1);
        RenderUtils.Render2D.drawRound(centerX + 390, centerY  +204, 90, 45,20, ColorUtils.rgba(69, 23, 255,65));

        renderSnow(matrixStack);
        super.render(matrixStack, mouseX, mouseY, partialTicks);
        mc.gameRenderer.setupOverlayRendering();
    }

    public boolean mouseClicked(double mouseX, double mouseY, int button) {
        Vec2i fixed = ScaleMath.getMouse((int) mouseX, (int) mouseY);
        mouseX = fixed.getX();
        mouseY = fixed.getY();

        int scaledWidth = mw.scaledWidth();
        int scaledHeight = mw.scaledHeight();

        float centerX = scaledWidth / 2f;
        float centerY = scaledHeight / 2f;

        boolean hovered1 = RenderUtils.isInRegion(mouseX, mouseY, centerX + 444, centerY + 220, 16, 16);
        hover1.setDirection(hovered1 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered2 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f +415, centerY + 220, 16, 16);
        hover2.setDirection(hovered2 ? Direction.FORWARDS : Direction.BACKWARDS);

        if (hovered1) {
            Util.getOSType().openURI("https://vk.com/wissendclient");
        } else if (hovered2) {
            Util.getOSType().openURI("https://discord.gg/wissend");
        }

        return super.mouseClicked(mouseX, mouseY, button);
    }

    public void onClose() {
        if (this.realmsNotification != null) {
            this.realmsNotification.onClose();
        }
    }
    class snowflake {
        public float x;
        public float y;
        public float size;
        public float alpha;
    }

    int snowflake_count = 59;

    public List<snowflake> sfs = new ArrayList<snowflake>();

    boolean created = false;
    private final TimerUtils bolvan = new TimerUtils();

    protected void renderSnowflake(MatrixStack matrixStack, snowflake snowflake) {
        Fonts.font[new Random().nextInt(15, 22)].drawString(matrixStack, "?", snowflake.x, snowflake.y, ColorUtils.rgba(255, 255, 255, snowflake.alpha));
    }

    protected void createSnowflakeList() {
        if(!created) {
            for (int i = 1; i <= snowflake_count; i++) {
                snowflake s = new snowflake();
                s.x = new Random().nextInt(140, 1900);
                s.y = new Random().nextInt(-192, 33);
                s.alpha = new Random().nextInt(60, 255);
                s.size = 1;
                sfs.add(s);
                if (i == snowflake_count) { created = true; }
            }
        }
    }

    int f = 1;

    protected void createSnowflakes(MatrixStack matrixStack) {
        if(!created) { return; }

        long l = 10;
        if(bolvan.hasTimeElapsed(l)) {
            for (int i = 1; i <= sfs.size()-1; i++) {
                sfs.get(i).x = sfs.get(i).x - 1;
                sfs.get(i).y = sfs.get(i).y + 1;
                if(i <= sfs.size()-1) { bolvan.reset(); }
            }
        }

        for(int i = 0; i <= sfs.size()-1; i++){
            renderSnowflake(matrixStack, sfs.get(i));
        }

        if (sfs.get(sfs.size()-8).y > 60*f) {
            created = false;
            f++;
        }
        if(sfs.get(sfs.size()-8).y > 1050){
            for (int i = 1; i <= snowflake_count; i++) { sfs.remove(i); f-=0.5; }
        }
    }

    public void renderSnow(MatrixStack matrixStack) {
        createSnowflakeList();
        createSnowflakes(matrixStack);
    }

    public static class CustomButton extends AbstractButton {

        public static final Button.ITooltip field_238486_s_ = (button, matrixStack, mouseX, mouseY) -> {};
        protected final Button.IPressable onPress;
        protected final Button.ITooltip onTooltip;


        public CustomButton(int x, int y, int width, int height, ITextComponent title, Button.IPressable pressedAction) {
            this(x, y, width, height, title, pressedAction, field_238486_s_);
        }

        public CustomButton(int x, int y, int width, int height, ITextComponent title, Button.IPressable pressedAction, Button.ITooltip onTooltip) {
            super(x, y, width, height, title);
            this.onPress = pressedAction;
            this.onTooltip = onTooltip;
        }

        public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
            RenderUtils.Render2D.drawRound(x, y, width, height, 6, ColorUtils.rgba(69, 23, 255,75));
            Fonts.font[22].drawCenteredString(matrixStack, this.getMessage().getString(), x + width / 2f, y + height / 2f - Fonts.font[22].getFontHeight() / 2f + 1.5f, -1);
        }


        public void onPress() {
            this.onPress.onPress(this);
        }
// NOT SELFCODE ONLY PASTE
    }
}
imba
 
Начинающий
Статус
Оффлайн
Регистрация
20 Апр 2021
Сообщения
1,246
Реакции[?]
26
Поинты[?]
39K
SS -
Пожалуйста, авторизуйтесь для просмотра ссылки.

CODE -

Код:
public class MainMenuScreen extends Screen implements IMinecraft {

    public static final RenderSkyboxCube PANORAMA_RESOURCES = new RenderSkyboxCube(new ResourceLocation("textures/gui/title/background/panorama"));
    private static final ResourceLocation PANORAMA_OVERLAY_TEXTURES = new ResourceLocation("textures/gui/title/background/panorama_overlay.png");
    private static final ResourceLocation ACCESSIBILITY_TEXTURES = new ResourceLocation("textures/gui/accessibility.png");
    private final boolean showTitleWronglySpelled;
    private static final ResourceLocation MINECRAFT_TITLE_TEXTURES = new ResourceLocation("textures/gui/title/minecraft.png");
    private static final ResourceLocation MINECRAFT_TITLE_EDITION = new ResourceLocation("textures/gui/title/edition.png");
    private int widthCopyright;
    private int widthCopyrightRest;
    private Screen realmsNotification;
    private boolean hasCheckedForRealmsNotification;
    @Nullable
    private String splashText;
    private final RenderSkybox panorama = new RenderSkybox(PANORAMA_RESOURCES);
    private final boolean showFadeInAnimation;
    private long firstRenderTime;


    public MainMenuScreen() {
        this(false);
    }


    @Override
    public void init(Minecraft minecraft, int width, int height) {
        super.init(minecraft, width, height);
        if (ClientUtils.unHook) {
            if (this.splashText == null) {
                this.splashText = this.minecraft.getSplashes().getSplashText();
            }

            this.widthCopyright = this.font.getStringWidth("Copyright Mojang AB. Do not distribute!");
            this.widthCopyrightRest = this.width - this.widthCopyright - 2;
            int j = this.height / 4 + 48;
            Button button;
            this.addSingleplayerMultiplayerButtons(j, 24);

            if (Reflector.ModListScreen_Constructor.exists()) {
                button = ReflectorForge.makeButtonMods(this, j, 24);
                this.addButton(button);
            }

            this.addButton(new ImageButton(this.width / 2 - 124, j + 72 + 12, 20, 20, 0, 106, 20, Button.WIDGETS_LOCATION, 256, 256, (p_lambda$init$0_1_) -> this.minecraft.displayGuiScreen(new LanguageScreen(this, this.minecraft.gameSettings, this.minecraft.getLanguageManager())), new TranslationTextComponent("narrator.button.language")));
            this.addButton(new Button(this.width / 2 - 100, j + 72 + 12, 98, 20, new TranslationTextComponent("menu.options"), (p_lambda$init$1_1_) -> this.minecraft.displayGuiScreen(new OptionsScreen(this, this.minecraft.gameSettings))));
            this.addButton(new Button(this.width / 2 + 2, j + 72 + 12, 98, 20, new TranslationTextComponent("menu.quit"), (p_lambda$init$2_1_) -> this.minecraft.shutdown()));
            this.addButton(new ImageButton(this.width / 2 + 104, j + 72 + 12, 20, 20, 0, 0, 20, ACCESSIBILITY_TEXTURES, 32, 64, (p_lambda$init$3_1_) -> this.minecraft.displayGuiScreen(new AccessibilityScreen(this, this.minecraft.gameSettings)), new TranslationTextComponent("narrator.button.accessibility")));
            this.minecraft.setConnectedToRealms(false);

            if (this.minecraft.gameSettings.realmsNotifications && !this.hasCheckedForRealmsNotification) {
                RealmsBridgeScreen realmsbridgescreen = new RealmsBridgeScreen();
                this.realmsNotification = realmsbridgescreen.func_239555_b_(this);
                this.hasCheckedForRealmsNotification = true;
            }

            if (this.areRealmsNotificationsEnabled()) {
                this.realmsNotification.init(this.minecraft, this.width, this.height);
            }

            return;
        }

        int buttonWidth = 140;
        int buttonHeight = 25;
        int offset = buttonHeight + 5;
        int centerY = mw.scaledHeight() / 2 - 50;

        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY, buttonWidth, buttonHeight, new StringTextComponent("Singleplayer"), p_onPress_1_ -> mc.displayGuiScreen(new WorldSelectionScreen(this))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset, buttonWidth, buttonHeight, new StringTextComponent("Multiplayer"), p_onPress_1_ -> mc.displayGuiScreen(new MultiplayerScreen(this))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 2, buttonWidth, buttonHeight, new StringTextComponent("Alt Manager"), p_onPress_1_ -> mc.displayGuiScreen(Manager.ALT)));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 3, buttonWidth, buttonHeight, new StringTextComponent("Settings"), p_onPress_1_ -> mc.displayGuiScreen(new OptionsScreen(this, this.minecraft.gameSettings))));
        this.addButton(new CustomButton((mw.scaledWidth() - buttonWidth) / 2, centerY + offset * 4, buttonWidth, buttonHeight, new StringTextComponent("Exit"), p_onPress_1_ -> mc.shutdownMinecraftApplet()));
    }

    private boolean areRealmsNotificationsEnabled() {
        return this.minecraft.gameSettings.realmsNotifications && this.realmsNotification != null;
    }

    private void addSingleplayerMultiplayerButtons(int yIn, int rowHeightIn) {
        this.addButton(new Button(this.width / 2 - 100, yIn, 200, 20, new TranslationTextComponent("menu.singleplayer"), (p_lambda$addSingleplayerMultiplayerButtons$4_1_) -> this.minecraft.displayGuiScreen(new WorldSelectionScreen(this))));
        boolean flag = this.minecraft.isMultiplayerEnabled();
        Button.ITooltip button$itooltip = flag ? Button.field_238486_s_ : (p_lambda$addSingleplayerMultiplayerButtons$5_1_, p_lambda$addSingleplayerMultiplayerButtons$5_2_, p_lambda$addSingleplayerMultiplayerButtons$5_3_, p_lambda$addSingleplayerMultiplayerButtons$5_4_) ->
        {
            if (!p_lambda$addSingleplayerMultiplayerButtons$5_1_.active) {
                this.renderTooltip(p_lambda$addSingleplayerMultiplayerButtons$5_2_, this.minecraft.fontRenderer.trimStringToWidth(new TranslationTextComponent("title.multiplayer.disabled"), Math.max(this.width / 2 - 43, 170)), p_lambda$addSingleplayerMultiplayerButtons$5_3_, p_lambda$addSingleplayerMultiplayerButtons$5_4_);
            }
        };
        this.addButton(new Button(this.width / 2 - 100, yIn + rowHeightIn * 1, 200, 20, new TranslationTextComponent("menu.multiplayer"), (p_lambda$addSingleplayerMultiplayerButtons$6_1_) ->
        {
            Screen screen = this.minecraft.gameSettings.skipMultiplayerWarning ? new MultiplayerScreen(this) : new MultiplayerWarningScreen(this);
            this.minecraft.displayGuiScreen(screen);
        }, button$itooltip)).active = flag;
        this.addButton(new Button(this.width / 2 - 100, yIn + rowHeightIn * 2, 200, 20, new TranslationTextComponent("menu.online"), (p_lambda$addSingleplayerMultiplayerButtons$7_1_) -> this.switchToRealms(), button$itooltip)).active = flag;
        if (Reflector.ModListScreen_Constructor.exists() && this.buttons.size() > 0) {
            Widget widget = this.buttons.get(this.buttons.size() - 1);
            widget.x = this.width / 2 + 2;
            widget.setWidth(98);
        }
    }

    private void switchToRealms() {
        RealmsBridgeScreen realmsbridgescreen = new RealmsBridgeScreen();
        realmsbridgescreen.func_231394_a_(this);
    }

    public MainMenuScreen(boolean fadeIn) {
        super(new TranslationTextComponent("narrator.screen.title"));
        this.showFadeInAnimation = fadeIn;
        this.showTitleWronglySpelled = (double) (new Random()).nextFloat() < 1.0E-4D;
    }

    public void tick() {
        if (this.areRealmsNotificationsEnabled()) {
            this.realmsNotification.tick();
        }
    }

    public static CompletableFuture<Void> loadAsync(TextureManager texMngr, Executor backgroundExecutor) {
        return CompletableFuture.allOf(texMngr.loadAsync(MINECRAFT_TITLE_TEXTURES, backgroundExecutor), texMngr.loadAsync(MINECRAFT_TITLE_EDITION, backgroundExecutor), texMngr.loadAsync(PANORAMA_OVERLAY_TEXTURES, backgroundExecutor), PANORAMA_RESOURCES.loadAsync(texMngr, backgroundExecutor));
    }

    public boolean isPauseScreen() {
        return false;
    }

    public boolean shouldCloseOnEsc() {
        return false;

    }



    private final BetterText info = new BetterText(List.of(" ", "Welcome, " + ClientUtils.me.getName()), 4500);
    private final BetterText like = new BetterText(List.of(" ", "Сделано с любовью, Acidka!"), 4500);
    private final Animation hover1 = new DecelerateAnimation(150, 3);
    private final Animation hover2 = new DecelerateAnimation(150, 3);
    private final Animation hover3 = new DecelerateAnimation(150, 3);

    public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
        if (ClientUtils.unHook) {
            if (this.firstRenderTime == 0L && this.showFadeInAnimation) {
                this.firstRenderTime = Util.milliTime();
                }



            float f = this.showFadeInAnimation ? (float) (Util.milliTime() - this.firstRenderTime) / 1000.0F : 1.0F;
            RenderSystem.disableDepthTest();
            fill(matrixStack, 0, 0, this.width, this.height, -1);
            this.panorama.render(partialTicks, MathHelper.clamp(f, 0.0F, 1.0F));
            int j = this.width / 2 - 137;
            this.minecraft.getTextureManager().bindTexture(PANORAMA_OVERLAY_TEXTURES);
            RenderSystem.enableBlend();
            RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
            RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.showFadeInAnimation ? (float) MathHelper.ceil(MathHelper.clamp(f, 0.0F, 1.0F)) : 1.0F);
            blit(matrixStack, 0, 0, this.width, this.height, 0.0F, 0.0F, 16, 128, 16, 128);
            float f1 = this.showFadeInAnimation ? MathHelper.clamp(f - 1.0F, 0.0F, 1.0F) : 1.0F;
            int l = MathHelper.ceil(f1 * 255.0F) << 24;

            if ((l & -67108864) != 0) {
                this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_TEXTURES);
                RenderSystem.color4f(1.0F, 1.0F, 1.0F, f1);

                if (this.showTitleWronglySpelled) {
                    this.blitBlackOutline(j, 30, (p_lambda$render$10_2_, p_lambda$render$10_3_) ->
                    {
                        this.blit(matrixStack, p_lambda$render$10_2_ + 0, p_lambda$render$10_3_, 0, 0, 99, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99, p_lambda$render$10_3_, 129, 0, 27, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99 + 26, p_lambda$render$10_3_, 126, 0, 3, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 99 + 26 + 3, p_lambda$render$10_3_, 99, 0, 26, 44);
                        this.blit(matrixStack, p_lambda$render$10_2_ + 155, p_lambda$render$10_3_, 0, 45, 155, 44);
                    });
                } else {
                    this.blitBlackOutline(j, 30, (p_lambda$render$11_2_, p_lambda$render$11_3_) ->
                    {
                        this.blit(matrixStack, p_lambda$render$11_2_ + 0, p_lambda$render$11_3_, 0, 0, 155, 44);
                        this.blit(matrixStack, p_lambda$render$11_2_ + 155, p_lambda$render$11_3_, 0, 45, 155, 44);
                    });
                }

                this.minecraft.getTextureManager().bindTexture(MINECRAFT_TITLE_EDITION);
                blit(matrixStack, j + 88, 67, 0.0F, 0.0F, 98, 14, 128, 16);

                if (Reflector.ForgeHooksClient_renderMainMenu.exists()) {
                    Reflector.callVoid(Reflector.ForgeHooksClient_renderMainMenu, this, matrixStack, this.font, this.width, this.height, l);
                }

                if (this.splashText != null) {
                    RenderSystem.pushMatrix();
                    RenderSystem.translatef((float) (this.width / 2 + 90), 70.0F, 0.0F);
                    RenderSystem.rotatef(-20.0F, 0.0F, 0.0F, 1.0F);
                    float f2 = 1.8F - MathHelper.abs(MathHelper.sin((float) (Util.milliTime() % 1000L) / 1000.0F * ((float) Math.PI * 2F)) * 0.1F);
                    f2 = f2 * 100.0F / (float) (this.font.getStringWidth(this.splashText) + 32);
                    RenderSystem.scalef(f2, f2, f2);
                    drawCenteredString(matrixStack, this.font, this.splashText, 0, -8, 16776960 | l);
                    RenderSystem.popMatrix();
                }

                String s = "Minecraft " + SharedConstants.getVersion().getName();

                if (this.minecraft.isDemo()) {
                    s = s + " Demo";
                } else {
                    s = s + ("release".equalsIgnoreCase(this.minecraft.getVersionType()) ? "" : "/" + this.minecraft.getVersionType());
                }

                if (this.minecraft.isModdedClient()) {
                    s = s + I18n.format("menu.modded");
                }

                if (Reflector.BrandingControl.exists()) {
                    if (Reflector.BrandingControl_forEachLine.exists()) {
                        BiConsumer<Integer, String> biconsumer = (p_lambda$render$12_3_, p_lambda$render$12_4_) -> drawString(matrixStack, this.font, p_lambda$render$12_4_, 2, this.height - (10 + p_lambda$render$12_3_ * (9 + 1)), 16777215 | l);
                        Reflector.call(Reflector.BrandingControl_forEachLine, true, true, biconsumer);
                    }

                    if (Reflector.BrandingControl_forEachAboveCopyrightLine.exists()) {
                        BiConsumer<Integer, String> biconsumer1 = (p_lambda$render$13_3_, p_lambda$render$13_4_) -> drawString(matrixStack, this.font, p_lambda$render$13_4_, this.width - this.font.getStringWidth(p_lambda$render$13_4_), this.height - (10 + (p_lambda$render$13_3_ + 1) * (9 + 1)), 16777215 | l);
                        Reflector.call(Reflector.BrandingControl_forEachAboveCopyrightLine, biconsumer1);
                    }
                } else {
                    drawString(matrixStack, this.font, s, 2, this.height - 10, 16777215 | l);
                }

                drawString(matrixStack, this.font, "Copyright Mojang AB. Do not distribute!", this.widthCopyrightRest, this.height - 10, 16777215 | l);

                if (mouseX > this.widthCopyrightRest && mouseX < this.widthCopyrightRest + this.widthCopyright && mouseY > this.height - 10 && mouseY < this.height) {
                    fill(matrixStack, this.widthCopyrightRest, this.height - 1, this.widthCopyrightRest + this.widthCopyright, this.height, 16777215 | l);
                }

                for (Widget widget : this.buttons) {
                    widget.setAlpha(f1);
                }

                if (this.areRealmsNotificationsEnabled() && f1 >= 1.0F) {
                    this.realmsNotification.render(matrixStack, mouseX, mouseY, partialTicks);
                }

                super.render(matrixStack, mouseX, mouseY, partialTicks);
            }

            return;
        }

        Vec2i fixed = ScaleMath.getMouse(mouseX, mouseY);
        mouseX = fixed.getX();
        mouseY = fixed.getY();

        int scaledWidth = mw.scaledWidth();
        int scaledHeight = mw.scaledHeight();

        float centerX = scaledWidth / 2f;
        float centerY = scaledHeight / 2f;

        mc.gameRenderer.setupOverlayRendering(2);
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/i.png"), 0, 0, scaledWidth, scaledHeight, -1);

        boolean hovered1 = RenderUtils.isInRegion(mouseX, mouseY, centerX + 444, centerY + 220, 16, 16);
        hover1.setDirection(hovered1 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered2 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f, centerY + 110, 16, 16);
        hover2.setDirection(hovered2 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered3 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f + 415, centerY + 220, 16, 16);
        hover3.setDirection(hovered3 ? Direction.FORWARDS : Direction.BACKWARDS);

        GaussianBlur.applyBlur(() -> RenderUtils.Render2D.drawRound(centerX - 277 / 2f, centerY - 275.5f / 2f, 277, 275.5f, 10, -1), 40, 2);
        RenderUtils.Render2D.drawRound(centerX - 262 / 2f, centerY - 235 / 2f, 262, 245,25, ColorUtils.rgba(69, 23, 255,65));
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/vk.png"), centerX + 444, (float) (centerY + 220 - hover1.getOutput()), 16, 16, -1);
        RenderUtils.Render2D.drawImage(new ResourceLocation("wissend/images/mainmenu/discord.png"), centerX - 16 / 2f + 415, (float) (centerY + 220 - hover3.getOutput()), 16, 16, -1);

        Fonts.fontBold[32].drawCenteredString(matrixStack, info.output, centerX, centerY - 90, -1);
        Fonts.font[24].drawCenteredString(matrixStack, like.output, centerX-390, centerY+240, -1);
        RenderUtils.Render2D.drawRound(centerX + 390, centerY  +204, 90, 45,20, ColorUtils.rgba(69, 23, 255,65));

        renderSnow(matrixStack);
        super.render(matrixStack, mouseX, mouseY, partialTicks);
        mc.gameRenderer.setupOverlayRendering();
    }

    public boolean mouseClicked(double mouseX, double mouseY, int button) {
        Vec2i fixed = ScaleMath.getMouse((int) mouseX, (int) mouseY);
        mouseX = fixed.getX();
        mouseY = fixed.getY();

        int scaledWidth = mw.scaledWidth();
        int scaledHeight = mw.scaledHeight();

        float centerX = scaledWidth / 2f;
        float centerY = scaledHeight / 2f;

        boolean hovered1 = RenderUtils.isInRegion(mouseX, mouseY, centerX + 444, centerY + 220, 16, 16);
        hover1.setDirection(hovered1 ? Direction.FORWARDS : Direction.BACKWARDS);

        boolean hovered2 = RenderUtils.isInRegion(mouseX, mouseY, centerX - 16 / 2f +415, centerY + 220, 16, 16);
        hover2.setDirection(hovered2 ? Direction.FORWARDS : Direction.BACKWARDS);

        if (hovered1) {
            Util.getOSType().openURI("https://vk.com/wissendclient");
        } else if (hovered2) {
            Util.getOSType().openURI("https://discord.gg/wissend");
        }

        return super.mouseClicked(mouseX, mouseY, button);
    }

    public void onClose() {
        if (this.realmsNotification != null) {
            this.realmsNotification.onClose();
        }
    }
    class snowflake {
        public float x;
        public float y;
        public float size;
        public float alpha;
    }

    int snowflake_count = 59;

    public List<snowflake> sfs = new ArrayList<snowflake>();

    boolean created = false;
    private final TimerUtils bolvan = new TimerUtils();

    protected void renderSnowflake(MatrixStack matrixStack, snowflake snowflake) {
        Fonts.font[new Random().nextInt(15, 22)].drawString(matrixStack, "?", snowflake.x, snowflake.y, ColorUtils.rgba(255, 255, 255, snowflake.alpha));
    }

    protected void createSnowflakeList() {
        if(!created) {
            for (int i = 1; i <= snowflake_count; i++) {
                snowflake s = new snowflake();
                s.x = new Random().nextInt(140, 1900);
                s.y = new Random().nextInt(-192, 33);
                s.alpha = new Random().nextInt(60, 255);
                s.size = 1;
                sfs.add(s);
                if (i == snowflake_count) { created = true; }
            }
        }
    }

    int f = 1;

    protected void createSnowflakes(MatrixStack matrixStack) {
        if(!created) { return; }

        long l = 10;
        if(bolvan.hasTimeElapsed(l)) {
            for (int i = 1; i <= sfs.size()-1; i++) {
                sfs.get(i).x = sfs.get(i).x - 1;
                sfs.get(i).y = sfs.get(i).y + 1;
                if(i <= sfs.size()-1) { bolvan.reset(); }
            }
        }

        for(int i = 0; i <= sfs.size()-1; i++){
            renderSnowflake(matrixStack, sfs.get(i));
        }

        if (sfs.get(sfs.size()-8).y > 60*f) {
            created = false;
            f++;
        }
        if(sfs.get(sfs.size()-8).y > 1050){
            for (int i = 1; i <= snowflake_count; i++) { sfs.remove(i); f-=0.5; }
        }
    }

    public void renderSnow(MatrixStack matrixStack) {
        createSnowflakeList();
        createSnowflakes(matrixStack);
    }

    public static class CustomButton extends AbstractButton {

        public static final Button.ITooltip field_238486_s_ = (button, matrixStack, mouseX, mouseY) -> {};
        protected final Button.IPressable onPress;
        protected final Button.ITooltip onTooltip;


        public CustomButton(int x, int y, int width, int height, ITextComponent title, Button.IPressable pressedAction) {
            this(x, y, width, height, title, pressedAction, field_238486_s_);
        }

        public CustomButton(int x, int y, int width, int height, ITextComponent title, Button.IPressable pressedAction, Button.ITooltip onTooltip) {
            super(x, y, width, height, title);
            this.onPress = pressedAction;
            this.onTooltip = onTooltip;
        }

        public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
            RenderUtils.Render2D.drawRound(x, y, width, height, 6, ColorUtils.rgba(69, 23, 255,75));
            Fonts.font[22].drawCenteredString(matrixStack, this.getMessage().getString(), x + width / 2f, y + height / 2f - Fonts.font[22].getFontHeight() / 2f + 1.5f, -1);
        }


        public void onPress() {
            this.onPress.onPress(this);
        }
// NOT SELFCODE ONLY PASTE
    }
}
майкнрафт можно было и открытым держать а не ждать 50 секунд до загрузки.
 
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
471
Реакции[?]
2
Поинты[?]
1K
Начинающий
Статус
Оффлайн
Регистрация
26 Дек 2023
Сообщения
471
Реакции[?]
2
Поинты[?]
1K
ну попробуй)
интересно что у тебя выйдет, хотя я тебе даже не показал фулл результат свой.
ну типо что тут делать? кнопки отрендерить 20 секунд, надпись 10, ну и с глсл я еще не работал, но постараюсь
 
Начинающий
Статус
Оффлайн
Регистрация
20 Апр 2021
Сообщения
1,246
Реакции[?]
26
Поинты[?]
39K
ну типо что тут делать? кнопки отрендерить 20 секунд, надпись 10, ну и с глсл я еще не работал, но постараюсь
шрифт подобрать, кнопки не такие простые как ты думаешь, я же говорил что не фулл результат)
про шейдер молчишь?
 
Сверху Снизу