Java 类cpw.mods.fml.common.event.FMLConstructionEvent 实例源码

项目:ThermosRebased    文件:FanEventHandler.java   
@Subscribe
public void constructMod(final FMLConstructionEvent event) {
    try {
        final ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(this.mContainer.getSource());
        modClassLoader.clearNegativeCacheFor(this.mCandidate.getClassList());
        NetworkRegistry.INSTANCE.register(this.mContainer, (Class)this.mContainer.getClass(), (String)null, event.getASMHarvestedData());
        Injector.inject(this.mMod, Injector.Phase.Construct, FMLCommonHandler.instance().getSide());
    }
    catch (Throwable e) {
        throw new IllegalStateException("Cannot construct fan", e);
    }
}
项目:LambdaLib    文件:LLModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event) {
    log.info("LambdaLib|Core is loading.");

    // Get annotation information from forge asm data table.
    // This must be done before PreInit stage.
    ASMDataTable data = event.getASMHarvestedData();

    Set<String> removedClasses = Sets.newHashSet();
    { // Get removed classes
        String startupSide = FMLCommonHandler.instance().getSide().toString();
        Set<ASMData> sideData = data.getAll("cpw.mods.fml.relauncher.SideOnly");
        for (ASMData ad : sideData) if (ad.getClassName().equals(ad.getObjectName())) { // If is a class
            EnumHolder enumHolder = (EnumHolder) ad.getAnnotationInfo().get("value");
            try {
                String value = (String) ehFieldValue.get(enumHolder);
                if (!value.equals(startupSide)) {
                    removedClasses.add(ad.getClassName());
                }
            } catch (IllegalAccessException ex) {
                throw Throwables.propagate(ex);
            }
        }
    }

    LLModContainer.removedClasses.addAll(removedClasses);

    Set<String> registrants = mapToClass(data.getAll("cn.lambdalib.annoreg.core.Registrant"));
    registrants.removeAll(removedClasses);
    RegistrationManager.INSTANCE.annotationList(registrants);

    Set<String> registryTypes = mapToClass(data.getAll("cn.lambdalib.annoreg.core.RegistryTypeDecl"));
    registryTypes.removeAll(removedClasses);
    RegistrationManager.INSTANCE.addRegistryTypes(registryTypes);

    Set<String> registryMods = mapToClass(data.getAll("cn.lambdalib.annoreg.core.RegistrationMod"));
    registryMods.removeAll(removedClasses);
    RegistrationManager.INSTANCE.addAnnotationMod(registryMods);
}
项目:BetterLoadingScreen_1.7    文件:BetterLoadingScreen.java   
@EventHandler
public void construct(FMLConstructionEvent event) {
    ModLoadingListener thisListener = null;
    for (ModContainer mod : Loader.instance().getActiveModList()) {
        if (mod instanceof FMLModContainer) {
            EventBus bus = null;
            try {
                // Its a bit questionable to be changing FML itself, but reflection is better than ASM transforming
                // forge
                Field f = FMLModContainer.class.getDeclaredField("eventBus");
                f.setAccessible(true);
                bus = (EventBus) f.get(mod);
            }
            catch (Throwable t) {
                t.printStackTrace();
            }
            if (bus != null) {
                if (mod.getModId().equals(Lib.Mod.ID)) {
                    thisListener = new ModLoadingListener(mod);
                    bus.register(thisListener);
                }
                else
                    bus.register(new ModLoadingListener(mod));
            }
        }
    }
    if (thisListener != null)
        ModLoadingListener.doProgress(State.CONSTRUCT, thisListener);
}
项目:EventDebug    文件:EventDebug.java   
@EventHandler
public void construct(FMLConstructionEvent evt) {
    MinecraftForge.EVENT_BUS.register(collector.createProbe("FORGE-EVENT"));
    MinecraftForge.ORE_GEN_BUS.register(collector.createProbe("FORGE-ORE"));
    MinecraftForge.TERRAIN_GEN_BUS.register(collector.createProbe("FORGE-TERRAIN"));
    FMLCommonHandler.instance().bus().register(collector.createProbe("FML"));
}
项目:Config-Patcher    文件:CommonProxy.java   
public void construct(FMLConstructionEvent event) {
    this.directoryMain = Loader.instance().getConfigDir();

    final File configFile = new File(this.directoryMain, Reference.MODID + ".cfg");
    ConfigurationHandler.init(configFile);

    this.directoryOverride = FileHelper.getCanonicalFile(this.directoryMain.getParentFile(), this.directoryMain.getName() + "-override");

    if (ConfigurationHandler.shouldPatch()) {
        new Patch(this.directoryMain, this.directoryOverride).execute();
    } else if (ConfigurationHandler.generate) {
        this.directoryBase = FileHelper.getCanonicalFile(this.directoryMain.getParentFile(), this.directoryMain.getName() + "-base");
        this.directoryDiff = FileHelper.getCanonicalFile(this.directoryOverride, "auto-generated");
    }
}
项目:RuneCraftery    文件:ModLoaderModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
    try
    {
        ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(modSource);
        EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
        this.gameTickHandler = new BaseModTicker(ticks, false);
        this.guiTickHandler = new BaseModTicker(ticks.clone(), true);
        Class<? extends BaseModProxy> modClazz = (Class<? extends BaseModProxy>) modClassLoader.loadBaseModClass(modClazzName);
        configureMod(modClazz, event.getASMHarvestedData());
        isNetworkMod = FMLNetworkHandler.instance().registerNetworkMod(this, modClazz, event.getASMHarvestedData());
        ModLoaderNetworkHandler dummyHandler = null;
        if (!isNetworkMod)
        {
            FMLLog.fine("Injecting dummy network mod handler for BaseMod %s", getModId());
            dummyHandler = new ModLoaderNetworkHandler(this);
            FMLNetworkHandler.instance().registerNetworkMod(dummyHandler);
        }
        Constructor<? extends BaseModProxy> ctor = modClazz.getConstructor();
        ctor.setAccessible(true);
        mod = modClazz.newInstance();
        if (dummyHandler != null)
        {
            dummyHandler.setBaseMod(mod);
        }
        ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), new ILanguageAdapter.JavaAdapter());
    }
    catch (Exception e)
    {
        controller.errorOccurred(this, e);
        Throwables.propagateIfPossible(e);
    }
}
项目:RuneCraftery    文件:ModLoaderModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
    try
    {
        ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(modSource);
        EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
        this.gameTickHandler = new BaseModTicker(ticks, false);
        this.guiTickHandler = new BaseModTicker(ticks.clone(), true);
        Class<? extends BaseModProxy> modClazz = (Class<? extends BaseModProxy>) modClassLoader.loadBaseModClass(modClazzName);
        configureMod(modClazz, event.getASMHarvestedData());
        isNetworkMod = FMLNetworkHandler.instance().registerNetworkMod(this, modClazz, event.getASMHarvestedData());
        ModLoaderNetworkHandler dummyHandler = null;
        if (!isNetworkMod)
        {
            FMLLog.fine("Injecting dummy network mod handler for BaseMod %s", getModId());
            dummyHandler = new ModLoaderNetworkHandler(this);
            FMLNetworkHandler.instance().registerNetworkMod(dummyHandler);
        }
        Constructor<? extends BaseModProxy> ctor = modClazz.getConstructor();
        ctor.setAccessible(true);
        mod = modClazz.newInstance();
        if (dummyHandler != null)
        {
            dummyHandler.setBaseMod(mod);
        }
        ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), new ILanguageAdapter.JavaAdapter());
    }
    catch (Exception e)
    {
        controller.errorOccurred(this, e);
        Throwables.propagateIfPossible(e);
    }
}
项目:RuneCraftery    文件:ForgeDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    FMLLog.info("Registering Forge Packet Handler");
    try
    {
        FMLNetworkHandler.instance().registerNetworkMod(new ForgeNetworkHandler(this));
        FMLLog.info("Succeeded registering Forge Packet Handler");
    }
    catch (Exception e)
    {
        FMLLog.log(Level.SEVERE, e, "Failed to register packet handler for Forge");
    }
}
项目:RuneCraftery    文件:ForgeDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    FMLLog.info("Registering Forge Packet Handler");
    try
    {
        FMLNetworkHandler.instance().registerNetworkMod(new ForgeNetworkHandler(this));
        FMLLog.info("Succeeded registering Forge Packet Handler");
    }
    catch (Exception e)
    {
        FMLLog.log(Level.SEVERE, e, "Failed to register packet handler for Forge");
    }
}
项目:BetterNutritionMod    文件:ModLoaderModContainer.java   
@Subscribe
public void constructMod(FMLConstructionEvent event)
{
    try
    {
        ModClassLoader modClassLoader = event.getModClassLoader();
        modClassLoader.addFile(modSource);
        EnumSet<TickType> ticks = EnumSet.noneOf(TickType.class);
        this.gameTickHandler = new BaseModTicker(ticks, false);
        this.guiTickHandler = new BaseModTicker(ticks.clone(), true);
        Class<? extends BaseModProxy> modClazz = (Class<? extends BaseModProxy>) modClassLoader.loadBaseModClass(modClazzName);
        configureMod(modClazz, event.getASMHarvestedData());
        isNetworkMod = FMLNetworkHandler.instance().registerNetworkMod(this, modClazz, event.getASMHarvestedData());
        ModLoaderNetworkHandler dummyHandler = null;
        if (!isNetworkMod)
        {
            FMLLog.fine("Injecting dummy network mod handler for BaseMod %s", getModId());
            dummyHandler = new ModLoaderNetworkHandler(this);
            FMLNetworkHandler.instance().registerNetworkMod(dummyHandler);
        }
        Constructor<? extends BaseModProxy> ctor = modClazz.getConstructor();
        ctor.setAccessible(true);
        mod = modClazz.newInstance();
        if (dummyHandler != null)
        {
            dummyHandler.setBaseMod(mod);
        }
        ProxyInjector.inject(this, event.getASMHarvestedData(), FMLCommonHandler.instance().getSide(), new ILanguageAdapter.JavaAdapter());
    }
    catch (Exception e)
    {
        controller.errorOccurred(this, e);
        Throwables.propagateIfPossible(e);
    }
}
项目:BetterNutritionMod    文件:ForgeDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    FMLLog.info("Registering Forge Packet Handler");
    try
    {
        FMLNetworkHandler.instance().registerNetworkMod(new ForgeNetworkHandler(this));
        FMLLog.info("Succeeded registering Forge Packet Handler");
    }
    catch (Exception e)
    {
        FMLLog.log(Level.SEVERE, e, "Failed to register packet handler for Forge");
    }
}
项目:OpenPeripheral    文件:OpenPeripheralCore.java   
@Mod.EventHandler
public void construct(FMLConstructionEvent evt) {
    ArchitectureChecker.INSTANCE.register(Constants.ARCH_COMPUTER_CRAFT, new ComputerCraftChecker());
    ArchitectureChecker.INSTANCE.register(Constants.ARCH_OPEN_COMPUTERS, new OpenComputersChecker());

    apiSetup.setupApis();
    apiSetup.installProviderAccess();

    if (ArchitectureChecker.INSTANCE.isEnabled(Constants.ARCH_OPEN_COMPUTERS)) ModuleOpenComputers.init();
    if (ArchitectureChecker.INSTANCE.isEnabled(Constants.ARCH_COMPUTER_CRAFT)) ModuleComputerCraft.init();
}
项目:Sound-Physics    文件:SPDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent event)
{

}
项目:ThaumOres    文件:ThaumOresMod.java   
@EventHandler
public void constr(FMLConstructionEvent event) {
    this.initHandler.findModules(event);
}
项目:TRHS_Club_Mod_2016    文件:FMLContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData());
    FMLNetworkHandler.registerChannel(this, evt.getSide());
}
项目:TRHS_Club_Mod_2016    文件:ForgeModContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData());
    ForgeNetworkHandler.registerChannel(this, evt.getSide());
}
项目:ThermosRebased    文件:ImagineModContainer.java   
@Subscribe
public void constructMod(final FMLConstructionEvent event) {
    Injector.inject(this, Injector.Phase.Construct, new Object[0]);
    FanLoader.migrate(FanLoader.State.Loaded);
}
项目:RorysMod    文件:RorysModCore.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt) {}
项目:CollectiveFramework    文件:DummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent event) {
    loader = event.getModClassLoader();
}
项目:BetterLoadingScreen_1.7    文件:ModLoadingListener.java   
@Subscribe
public void construct(FMLConstructionEvent event) {
    doProgress(State.CONSTRUCT, this);
}
项目:CauldronGit    文件:FMLContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData());
    FMLNetworkHandler.registerChannel(this, evt.getSide());
}
项目:CauldronGit    文件:ForgeModContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData());
    ForgeNetworkHandler.registerChannel(this, evt.getSide());
}
项目:AdvancedRocketry    文件:ModContainer.java   
@SubscribeEvent
public void modConstruction(FMLConstructionEvent event) {}
项目:Config-Patcher    文件:ConfigPatcher.java   
@Mod.EventHandler
public void construct(final FMLConstructionEvent event) {
    proxy.construct(event);
}
项目:Gadomancy    文件:Gadomancy.java   
@Mod.EventHandler
public void onConstruct(FMLConstructionEvent event) {
    GadomancyApi.setInstance(new DefaultApiHandler());
    proxy.onConstruct();
}
项目:Helper-API    文件:Helper.java   
@EventHandler
public void modConstructing(FMLConstructionEvent event)
{

}
项目:Cauldron    文件:FMLContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData());
    FMLNetworkHandler.registerChannel(this, evt.getSide());
}
项目:Cauldron    文件:ForgeModContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData());
    ForgeNetworkHandler.registerChannel(this, evt.getSide());
}
项目:Cauldron    文件:FMLContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData());
    FMLNetworkHandler.registerChannel(this, evt.getSide());
}
项目:Cauldron    文件:ForgeModContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData());
    ForgeNetworkHandler.registerChannel(this, evt.getSide());
}
项目:Cauldron    文件:FMLContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData());
    FMLNetworkHandler.registerChannel(this, evt.getSide());
}
项目:Cauldron    文件:ForgeModContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData());
    ForgeNetworkHandler.registerChannel(this, evt.getSide());
}
项目:Whodunit    文件:Mod.java   
@Subscribe
public void onModConstruct(FMLConstructionEvent evt) {}
项目:World-Generation-Manager    文件:GenerationDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt){
}
项目:ShoulderSurfing    文件:ShoulderSurfing.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt){

}
项目:ShoulderSurfing    文件:ShoulderSurfing.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt){

}
项目:CreeperBurnCore    文件:CBDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt){

}
项目:ExplosionDropsCore    文件:EDDummyContainer.java   
@Subscribe
public void modConstruction(FMLConstructionEvent evt){

}