Краш при создании своего меню

Версия Minecraft
1.7.10
201
6
32
Java:
package ru.Rofler.CoreMenu.gui;

import java.awt.Desktop;
import java.net.URL;

import org.lwjgl.opengl.GL11;

import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiLabel;
import net.minecraft.client.gui.GuiMainMenu;
import net.minecraft.client.multiplayer.GuiConnecting;
import net.minecraft.client.multiplayer.ServerData;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;
import ru.Rofler.CoreMenu.CoreMenu;

public class CoreMainMenu extends GuiMainMenu
{
    int btnSelected = 0;
    public int MX = 0;
    public int MY = 0;
    int lastId = 0;
    public String URL_SITE = "siteurl", URL_DONATE = "donateurl";
    protected boolean isClicked = false;
    public static final ResourceLocation textureback = new ResourceLocation(CoreMenu.MODID + ":textures/gui/borderbackscreen.png");


    @Override
    public void initGui() {
            int i = this.width / 2 - 450;
            this.buttonList.clear();
            this.buttonList.add(new CustomButtonJoinGame(1001, i + this.height / 4 + 48, + 30 + 12, 145, 20, I18n.format("", new Object[0])));
            this.buttonList.add(new CustomButtonOpenLinkSite(1002, i + this.height / 4 + 48, + 50 + 12, 145, 20, I18n.format("", new Object[0])));
            this.buttonList.add(new CustomButtonOpenLinkGroup(1003, i + this.height / 4 + 48, + 70 + 12, 145, 20, I18n.format("", new Object[0])));
            this.buttonList.add(new CustomButtonCloseGame(1004, i + this.height / 4 + 48, + 90 + 12, 145, 20, I18n.format("", new Object[0])));
    }
   
    public void actionPerformed(GuiButton btn)
    {
        if (btn.id == 1001)
        {
        this.mc.displayGuiScreen(new GuiConnecting(this, this.mc, new ServerData("NameServer", "SERVER-IP", isClicked)));
        }
       
        switch(btn.id)
        {
        case 1002:
        try
        {
        Desktop.getDesktop().browse((new URL(URL_SITE)).toURI());
        }
       
        catch (Exception var5)
        {
        var5.printStackTrace();
        }
        break;

        case 1003:
        try
        {
        Desktop.getDesktop().browse((new URL(URL_DONATE)).toURI());
        }
       
        catch (Exception var6) {
        var6.printStackTrace();
        }
        break;
        }

       
        if (btn.id == 1004)
        {
            this.mc.shutdown();
        }
        }

    @Override
    public void drawScreen(int x, int y, float t) {
        this.MX = x;
        this.MY = y;
        super.mc.renderEngine.bindTexture(textureback);
        this.drawCompleteImage(0, 0, this.width, this.height);


        int k1;

        for (k1 = 0; k1 < this.buttonList.size(); ++k1)
            ((CustomButtonJoinGame)this.buttonList.get(k1)).drawButton(this.mc, x, y);
       
        int k2;
       
        for (k2 = 0; k2 < this.buttonList.size(); ++k2)
            ((CustomButtonOpenLinkSite)this.buttonList.get(k2)).drawButton(this.mc, x, y);
       
        int k3;
       
        for (k3 = 0; k3 < this.buttonList.size(); ++k3)
            ((CustomButtonOpenLinkGroup)this.buttonList.get(k3)).drawButton(this.mc, x, y);
       
        int k4;
       
        for (k4 = 0; k4 < this.buttonList.size(); ++k4)
            ((CustomButtonCloseGame)this.buttonList.get(k4)).drawButton(this.mc, x, y);


        }


    boolean isHover(int xx, int yy, int xx1, int yy1) {
        return isClicked;
    }

    private void drawCompleteImage(int posX, int posY, int width, int height) {
        GL11.glPushMatrix();
        GL11.glTranslatef((float)posX, (float)posY, 0.0F);
        GL11.glBegin(7);
        GL11.glTexCoord2f(0.0F, 0.0F);
        GL11.glVertex3f(0.0F, 0.0F, 0.0F);
        GL11.glTexCoord2f(0.0F, 1.0F);
        GL11.glVertex3f(0.0F, (float)height, 0.0F);
        GL11.glTexCoord2f(1.0F, 1.0F);
        GL11.glVertex3f((float)width, (float)height, 0.0F);
        GL11.glTexCoord2f(1.0F, 0.0F);
        GL11.glVertex3f((float)width, 0.0F, 0.0F);
        GL11.glEnd();
        GL11.glPopMatrix();
    }
}

Код и краш.
При запуске майнкрафта крашит, не могу понять почему.
 
Краш-лог
---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 03.12.19 20:36
Description: Rendering screen

java.lang.ClassCastException: ru.Rofler.CoreMenu.gui.CustomButtonOpenLinkSite cannot be cast to ru.Rofler.CoreMenu.gui.CustomButtonJoinGame
at ru.Rofler.CoreMenu.gui.CoreMainMenu.func_73863_a(CoreMainMenu.java:89)
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
at ru.Rofler.CoreMenu.gui.CoreMainMenu.func_73863_a(CoreMainMenu.java:89)

-- Screen render details --
Details:
Screen name: ru.Rofler.CoreMenu.gui.CoreMainMenu
Mouse location: Scaled: (108, 151). Absolute: (216, 227)
Screen size: Scaled: (463, 265). Absolute: (925, 530). Scale factor of 2
Stacktrace:
at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)
at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
at net.minecraft.client.main.Main.main(SourceFile:148)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
Minecraft Version: 1.7.10
Operating System: Windows 10 (amd64) version 10.0
Java Version: 1.8.0_231, Oracle Corporation
Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
Memory: 291754720 bytes (278 MB) / 436207616 bytes (416 MB) up to 7079985152 bytes (6752 MB)
JVM Flags: 8 total; -Xmn128M -Xmx6729M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 5 mods loaded, 5 mods active
States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
UCHIJA mcp{9.05} [Minecraft Coder Pack] (minecraft.jar)
UCHIJA FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar)
UCHIJA Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar)
UCHIJA coremenu{coremenu v1.7.10_0.0.4} [CoreMenu] (modid-1.0.jar)
UCHIJA tlauncher_custom_cape_skin{1.0} [TLSkinCape] (tlskincape_1.7.10-1.4.jar)
GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 430.86' Renderer: 'GeForce GTX 1060 3GB/PCIe/SSE2'
Launched Version: Forge 1.7.10
LWJGL: 2.9.1
OpenGL: GeForce GTX 1060 3GB/PCIe/SSE2 GL version 4.6.0 NVIDIA 430.86, NVIDIA Corporation
GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

Is Modded: Definitely; Client brand changed to 'fml,forge'
Type: Client (map_client.txt)
Resource Packs: []
Current Language: Русский (Россия)
Profiler Position: N/A (disabled)
Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
Anisotropic Filtering: Off (1)
Краш-лог:
---- Minecraft Crash Report ----
// Don't be sad, have a hug! <3

Time: 03.12.19 20:36
Description: Rendering screen

java.lang.ClassCastException: ru.Rofler.CoreMenu.gui.CustomButtonOpenLinkSite cannot be cast to ru.Rofler.CoreMenu.gui.CustomButtonJoinGame
	at ru.Rofler.CoreMenu.gui.CoreMainMenu.func_73863_a(CoreMainMenu.java:89)
	at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)
	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
	at net.minecraft.client.main.Main.main(SourceFile:148)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)


A detailed walkthrough of the error, its code path and all known details is as follows:
---------------------------------------------------------------------------------------

-- Head --
Stacktrace:
	at ru.Rofler.CoreMenu.gui.CoreMainMenu.func_73863_a(CoreMainMenu.java:89)

-- Screen render details --
Details:
	Screen name: ru.Rofler.CoreMenu.gui.CoreMainMenu
	Mouse location: Scaled: (108, 151). Absolute: (216, 227)
	Screen size: Scaled: (463, 265). Absolute: (925, 530). Scale factor of 2
Stacktrace:
	at net.minecraft.client.renderer.EntityRenderer.func_78480_b(EntityRenderer.java:1061)
	at net.minecraft.client.Minecraft.func_71411_J(Minecraft.java:1001)
	at net.minecraft.client.Minecraft.func_99999_d(Minecraft.java:898)
	at net.minecraft.client.main.Main.main(SourceFile:148)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at net.minecraft.launchwrapper.Launch.launch(Launch.java:135)
	at net.minecraft.launchwrapper.Launch.main(Launch.java:28)

-- System Details --
Details:
	Minecraft Version: 1.7.10
	Operating System: Windows 10 (amd64) version 10.0
	Java Version: 1.8.0_231, Oracle Corporation
	Java VM Version: Java HotSpot(TM) 64-Bit Server VM (mixed mode), Oracle Corporation
	Memory: 291754720 bytes (278 MB) / 436207616 bytes (416 MB) up to 7079985152 bytes (6752 MB)
	JVM Flags: 8 total; -Xmn128M -Xmx6729M -XX:+UnlockExperimentalVMOptions -XX:+UseG1GC -XX:G1NewSizePercent=20 -XX:G1ReservePercent=20 -XX:MaxGCPauseMillis=50 -XX:G1HeapRegionSize=32M
	AABB Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
	IntCache: cache: 0, tcache: 0, allocated: 0, tallocated: 0
	FML: MCP v9.05 FML v7.10.99.99 Minecraft Forge 10.13.4.1614 5 mods loaded, 5 mods active
	States: 'U' = Unloaded 'L' = Loaded 'C' = Constructed 'H' = Pre-initialized 'I' = Initialized 'J' = Post-initialized 'A' = Available 'D' = Disabled 'E' = Errored
	UCHIJA	mcp{9.05} [Minecraft Coder Pack] (minecraft.jar) 
	UCHIJA	FML{7.10.99.99} [Forge Mod Loader] (forge-1.7.10-10.13.4.1614-1.7.10.jar) 
	UCHIJA	Forge{10.13.4.1614} [Minecraft Forge] (forge-1.7.10-10.13.4.1614-1.7.10.jar) 
	UCHIJA	coremenu{coremenu v1.7.10_0.0.4} [CoreMenu] (modid-1.0.jar) 
	UCHIJA	tlauncher_custom_cape_skin{1.0} [TLSkinCape] (tlskincape_1.7.10-1.4.jar) 
	GL info: ' Vendor: 'NVIDIA Corporation' Version: '4.6.0 NVIDIA 430.86' Renderer: 'GeForce GTX 1060 3GB/PCIe/SSE2'
	Launched Version: Forge 1.7.10
	LWJGL: 2.9.1
	OpenGL: GeForce GTX 1060 3GB/PCIe/SSE2 GL version 4.6.0 NVIDIA 430.86, NVIDIA Corporation
	GL Caps: Using GL 1.3 multitexturing.
Using framebuffer objects because OpenGL 3.0 is supported and separate blending is supported.
Anisotropic filtering is supported and maximum anisotropy is 16.
Shaders are available because OpenGL 2.1 is supported.

	Is Modded: Definitely; Client brand changed to 'fml,forge'
	Type: Client (map_client.txt)
	Resource Packs: []
	Current Language: Русский (Россия)
	Profiler Position: N/A (disabled)
	Vec3 Pool Size: 0 (0 bytes; 0 MB) allocated, 0 (0 bytes; 0 MB) used
	Anisotropic Filtering: Off (1)
1,038
57
229
В 89 строке должно быть this.buttonList.draw(...)
Без всяких лишних скобок и приведения типов типо CustomButton... Их быть не должно.
Также остальные циклов не нужны
 
1,038
57
229
Java:
@Override
    public void drawScreen(int x, int y, float t) {
        super.mc.renderEngine.bindTexture(textureback);
        this.MX = x;
        this.MY = y;
        this.drawCompleteImage(0, 0, this.width, this.height);

        for (int k1 = 0; k1 < this.buttonList.size(); ++k1)
            this.buttonList.get(k1).drawButton(this.mc, x, y);
   
    }
 
Последнее редактирование:
1,038
57
229
можно её увидеть?
 
Последнее редактирование:
Сверху