Jump to content

[BUG] ModLoader::isGUIOpen incorrectly compares an instance to its Class


MarcinS

Recommended Posts

    @SideOnly(CLIENT)
    public static boolean isGUIOpen(Class<? extends GuiScreen> gui)
    {
        return FMLClientHandler.instance().getClient().currentScreen != null && FMLClientHandler.instance().getClient().currentScreen.equals(gui);
    }

 

This code copmpares an instance of class GuiScreen to class extending GuiScreen, which will always be false. Here is how the code should be:

    @SideOnly(CLIENT)
    public static boolean isGUIOpen(Class<? extends GuiScreen> gui)
    {
        return FMLClientHandler.instance().getClient().currentScreen != null && FMLClientHandler.instance().getClient().currentScreen.getClass().equals(gui);
    }

Link to comment
Share on other sites

    @SideOnly(CLIENT)
    public static boolean isGUIOpen(Class<? extends GuiScreen> gui)
    {
        return FMLClientHandler.instance().getClient().currentScreen != null && FMLClientHandler.instance().getClient().currentScreen.equals(gui);
    }

 

This code copmpares an instance of class GuiScreen to class extending GuiScreen, which will always be false. Here is how the code should be:

    @SideOnly(CLIENT)
    public static boolean isGUIOpen(Class<? extends GuiScreen> gui)
    {
        return FMLClientHandler.instance().getClient().currentScreen != null && FMLClientHandler.instance().getClient().currentScreen.getClass().equals(gui);
    }

Link to comment
Share on other sites

File an issue at the bt if you havent already.

https://github.com/MinecraftForge/MinecraftForge/issues

Read the EAQ before posting! OR ELSE!

 

This isn't building better software, its trying to grab a place in the commit list of a highly visible github project.

 

www.forgeessentials.com

 

Don't PM me, I don't check this account unless I have to.

Link to comment
Share on other sites

File an issue at the bt if you havent already.

https://github.com/MinecraftForge/MinecraftForge/issues

Read the EAQ before posting! OR ELSE!

 

This isn't building better software, its trying to grab a place in the commit list of a highly visible github project.

 

www.forgeessentials.com

 

Don't PM me, I don't check this account unless I have to.

Link to comment
Share on other sites

Actually file it to FML since it's FML's end of things. Same goes for your other post about the Registry.

Small oversights can be fixed easily if reported properly.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Actually file it to FML since it's FML's end of things. Same goes for your other post about the Registry.

Small oversights can be fixed easily if reported properly.

I do Forge for free, however the servers to run it arn't free, so anything is appreciated.
Consider supporting the team on Patreon

Link to comment
Share on other sites

Actually file it to FML since it's FML's end of things. Same goes for your other post about the Registry.

Small oversights can be fixed easily if reported properly.

Can you give me an URL, where I can find some kind of Bugzilla for FML? I already was given the GitHub address for Forge, so I'm sorted on that front.

 

Thank you in advance!

Link to comment
Share on other sites

Actually file it to FML since it's FML's end of things. Same goes for your other post about the Registry.

Small oversights can be fixed easily if reported properly.

Can you give me an URL, where I can find some kind of Bugzilla for FML? I already was given the GitHub address for Forge, so I'm sorted on that front.

 

Thank you in advance!

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.