    001package cpw.mods.fml.common.event;
    002
    003import com.google.common.base.Throwables;
    004
    005import cpw.mods.fml.common.Loader;
    006import cpw.mods.fml.common.LoaderState.ModState;
    007
    008public class FMLPostInitializationEvent extends FMLStateEvent
    009{
    010    public FMLPostInitializationEvent(Object... data)
    011    {
    012        super(data);
    013    }
    014
    015    @Override
    016    public ModState getModState()
    017    {
    018        return ModState.POSTINITIALIZED;
    019    }
    020
    021    public Object buildSoftDependProxy(String modId, String className)
    022    {
    023        if (Loader.isModLoaded(modId))
    024        {
    025            try
    026            {
    027                Class<?> clz = Class.forName(className,true,Loader.instance().getModClassLoader());
    028                return clz.newInstance();
    029            }
    030            catch (Exception e)
    031            {
    032                Throwables.propagateIfPossible(e);
    033                return null;
    034            }
    035        }
    036        return null;
    037    }
    038}