当前位置: 首页>>代码示例>>Java>>正文


Java FMLConstructionEvent类代码示例

本文整理汇总了Java中cpw.mods.fml.common.event.FMLConstructionEvent的典型用法代码示例。如果您正苦于以下问题:Java FMLConstructionEvent类的具体用法?Java FMLConstructionEvent怎么用?Java FMLConstructionEvent使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


FMLConstructionEvent类属于cpw.mods.fml.common.event包,在下文中一共展示了FMLConstructionEvent类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: constructMod

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:CyberdyneCC,项目名称:ThermosRebased,代码行数:14,代码来源:FanEventHandler.java

示例2: constructMod

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:LambdaInnovation,项目名称:LambdaLib,代码行数:40,代码来源:LLModContainer.java

示例3: construct

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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);
}
 
开发者ID:AlexIIL,项目名称:BetterLoadingScreen_1.7,代码行数:30,代码来源:BetterLoadingScreen.java

示例4: construct

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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"));
}
 
开发者ID:boq,项目名称:EventDebug,代码行数:8,代码来源:EventDebug.java

示例5: construct

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
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");
    }
}
 
开发者ID:Lunatrius,项目名称:Config-Patcher,代码行数:16,代码来源:CommonProxy.java

示例6: constructMod

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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);
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:36,代码来源:ModLoaderModContainer.java

示例7: modConstruction

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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");
    }
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:15,代码来源:ForgeDummyContainer.java

示例8: construct

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@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();
}
 
开发者ID:OpenMods,项目名称:OpenPeripheral,代码行数:12,代码来源:OpenPeripheralCore.java

示例9: modConstruction

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent event)
{
	
}
 
开发者ID:sonicether,项目名称:Sound-Physics,代码行数:6,代码来源:SPDummyContainer.java

示例10: constr

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@EventHandler
public void constr(FMLConstructionEvent event) {
	this.initHandler.findModules(event);
}
 
开发者ID:MJaroslav,项目名称:ThaumOres,代码行数:5,代码来源:ThaumOresMod.java

示例11: modConstruction

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData());
    FMLNetworkHandler.registerChannel(this, evt.getSide());
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:7,代码来源:FMLContainer.java

示例12: modConstruction

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent evt)
{
    NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData());
    ForgeNetworkHandler.registerChannel(this, evt.getSide());
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:7,代码来源:ForgeModContainer.java

示例13: constructMod

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void constructMod(final FMLConstructionEvent event) {
    Injector.inject(this, Injector.Phase.Construct, new Object[0]);
    FanLoader.migrate(FanLoader.State.Loaded);
}
 
开发者ID:CyberdyneCC,项目名称:ThermosRebased,代码行数:6,代码来源:ImagineModContainer.java

示例14: modConstruction

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent evt) {}
 
开发者ID:roryclaasen,项目名称:RorysMod,代码行数:3,代码来源:RorysModCore.java

示例15: modConstruction

import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent event) {
	loader = event.getModClassLoader();
}
 
开发者ID:austinv11,项目名称:CollectiveFramework,代码行数:5,代码来源:DummyContainer.java


注:本文中的cpw.mods.fml.common.event.FMLConstructionEvent类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。