Jump to content

[Unsolved]postInit method and checking for other mods


WH-Reaper

Recommended Posts

Hello,

I wanted to ask if someone knows any command to check for certain mod(probably by modId) in postInit method. something like

if(modListContains("someModId"))
{
   //do some stuff
}

 

Thanks in advance :)

Sorry for mistakes, English is not my mother tongue

Link to comment
Share on other sites

i use for RedPowerWorld Integration   

 

 

@PostInit

    public void modsLoaded(FMLPostInitializationEvent event) {

if (Loader.isModLoaded("RedPowerWorld")) {

            try {

                rp2Stone = (Block) Class.forName("com.eloraam.redpower.RedPowerWorld").getField("blockStone").get(null);

 

                  //sniped the things that i do with that             

                }

 

                LogHelper.log(Level.INFO, "Loaded RP2 World addon");

            }

            catch (Exception e) {

                LogHelper.log(Level.SEVERE, "Could not load RP2 World addon");

                e.printStackTrace(System.err);

            }

        }

         

    }

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

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