• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java FMLLoadEvent类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: buildModList

import cpw.mods.fml.common.event.FMLLoadEvent; //导入依赖的package包/类
@Subscribe
public void buildModList(FMLLoadEvent event)
{
    Builder<String, EventBus> eventBus = ImmutableMap.builder();

    for (ModContainer mod : loader.getModList())
    {
        //Create mod logger, and make the EventBus logger a child of it.
        EventBus bus = new EventBus(mod.getModId());
        boolean isActive = mod.registerBus(bus, this);
        if (isActive)
        {
            activeModList.add(mod);
            modStates.put(mod.getModId(), ModState.UNLOADED);
            eventBus.put(mod.getModId(), bus);
            FMLCommonHandler.instance().addModToResourcePack(mod);
        }
        else
        {
            FMLLog.log(mod.getModId(), Level.WARN, "Mod %s has been disabled through configuration", mod.getModId());
            modStates.put(mod.getModId(), ModState.UNLOADED);
            modStates.put(mod.getModId(), ModState.DISABLED);
        }
    }

    eventChannels = eventBus.build();
}
 
开发者ID:SchrodingersSpy,项目名称:TRHS_Club_Mod_2016,代码行数:28,代码来源:LoadController.java


示例2: buildModList

import cpw.mods.fml.common.event.FMLLoadEvent; //导入依赖的package包/类
@Subscribe
public void buildModList(FMLLoadEvent event)
{
    this.modList = loader.getIndexedModList();
    Builder<String, EventBus> eventBus = ImmutableMap.builder();

    for (ModContainer mod : loader.getModList())
    {
        //Create mod logger, and make the EventBus logger a child of it.
        FMLRelaunchLog.makeLog(mod.getModId());
        Logger modLogger = Logger.getLogger(mod.getModId());
        Logger eventLog = Logger.getLogger(EventBus.class.getName() + "." + mod.getModId());
        eventLog.setParent(modLogger);
        
        EventBus bus = new EventBus(mod.getModId());
        boolean isActive = mod.registerBus(bus, this);
        if (isActive)
        {
            Level level = Logger.getLogger(mod.getModId()).getLevel();
            FMLLog.log(mod.getModId(), Level.FINE, "Mod Logging channel %s configured at %s level.", mod.getModId(), level == null ? "default" : level);
            FMLLog.log(mod.getModId(), Level.INFO, "Activating mod %s", mod.getModId());
            activeModList.add(mod);
            modStates.put(mod.getModId(), ModState.UNLOADED);
            eventBus.put(mod.getModId(), bus);
            FMLCommonHandler.instance().addModToResourcePack(mod);
        }
        else
        {
            FMLLog.log(mod.getModId(), Level.WARNING, "Mod %s has been disabled through configuration", mod.getModId());
            modStates.put(mod.getModId(), ModState.UNLOADED);
            modStates.put(mod.getModId(), ModState.DISABLED);
        }
    }

    eventChannels = eventBus.build();
    FMLCommonHandler.instance().updateResourcePackList();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:38,代码来源:LoadController.java


示例3: loadMods

import cpw.mods.fml.common.event.FMLLoadEvent; //导入依赖的package包/类
/**
 * Called from the hook to start mod loading. We trigger the
 * {@link #identifyMods()} and Constructing, Preinitalization, and Initalization phases here. Finally,
 * the mod list is frozen completely and is consider immutable from then on.
 */
public void loadMods()
{
    initializeLoader();
    mods = Lists.newArrayList();
    namedMods = Maps.newHashMap();
    modController = new LoadController(this);
    modController.transition(LoaderState.LOADING, false);
    discoverer = identifyMods();
    ModAPIManager.INSTANCE.manageAPI(modClassLoader, discoverer);
    disableRequestedMods();
    modController.distributeStateMessage(FMLLoadEvent.class);
    sortModList();
    ModAPIManager.INSTANCE.cleanupAPIContainers(modController.getActiveModList());
    ModAPIManager.INSTANCE.cleanupAPIContainers(mods);
    mods = ImmutableList.copyOf(mods);
    for (File nonMod : discoverer.getNonModLibs())
    {
        if (nonMod.isFile())
        {
            FMLLog.info("FML has found a non-mod file %s in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.", nonMod.getName());
            try
            {
                modClassLoader.addFile(nonMod);
            }
            catch (MalformedURLException e)
            {
                FMLLog.log(Level.ERROR, e, "Encountered a weird problem with non-mod file injection : %s", nonMod.getName());
            }
        }
    }
    modController.transition(LoaderState.CONSTRUCTING, false);
    modController.distributeStateMessage(LoaderState.CONSTRUCTING, modClassLoader, discoverer.getASMTable(), reverseDependencies);
    FMLLog.fine("Mod signature data");
    for (ModContainer mod : getActiveModList())
    {
        FMLLog.fine("\t%s(%s:%s): %s (%s)", mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName(), CertificateHelper.getFingerprint(mod.getSigningCertificate()));
    }
    if (getActiveModList().isEmpty())
    {
        FMLLog.fine("No user mod signature data found");
    }
    modController.transition(LoaderState.PREINITIALIZATION, false);
}
 
开发者ID:alexandrage,项目名称:CauldronGit,代码行数:49,代码来源:Loader.java


示例4: load

import cpw.mods.fml.common.event.FMLLoadEvent; //导入依赖的package包/类
public void load(FMLLoadEvent event)
{
	ModBiomes.load();
}
 
开发者ID:noobieteam,项目名称:Fallacia,代码行数:5,代码来源:Fallacia.java


示例5: loadMods

import cpw.mods.fml.common.event.FMLLoadEvent; //导入依赖的package包/类
/**
 * Called from the hook to start mod loading. We trigger the
 * {@link #identifyMods()} and Constructing, Preinitalization, and Initalization phases here. Finally,
 * the mod list is frozen completely and is consider immutable from then on.
 */
public void loadMods()
{
    initializeLoader();
    mods = Lists.newArrayList();
    namedMods = Maps.newHashMap();
    modController = new LoadController(this);
    modController.transition(LoaderState.LOADING, false);
    ModDiscoverer disc = identifyMods();
    ModAPIManager.INSTANCE.manageAPI(modClassLoader, disc);
    disableRequestedMods();
    FMLLog.fine("Reloading logging properties from %s", loggingProperties.getPath());
    FMLRelaunchLog.loadLogConfiguration(loggingProperties);
    FMLLog.fine("Reloaded logging properties");
    modController.distributeStateMessage(FMLLoadEvent.class);
    sortModList();
    ModAPIManager.INSTANCE.cleanupAPIContainers(modController.getActiveModList());
    ModAPIManager.INSTANCE.cleanupAPIContainers(mods);
    mods = ImmutableList.copyOf(mods);
    for (File nonMod : disc.getNonModLibs())
    {
        if (nonMod.isFile())
        {
            FMLLog.info("FML has found a non-mod file %s in your mods directory. It will now be injected into your classpath. This could severe stability issues, it should be removed if possible.", nonMod.getName());
            try
            {
                modClassLoader.addFile(nonMod);
            }
            catch (MalformedURLException e)
            {
                FMLLog.log(Level.SEVERE, e, "Encountered a weird problem with non-mod file injection : %s", nonMod.getName());
            }
        }
    }
    modController.transition(LoaderState.CONSTRUCTING, false);
    modController.distributeStateMessage(LoaderState.CONSTRUCTING, modClassLoader, disc.getASMTable());
    FMLLog.fine("Mod signature data");
    for (ModContainer mod : getActiveModList())
    {
        FMLLog.fine("\t%s(%s:%s): %s (%s)", mod.getModId(), mod.getName(), mod.getVersion(), mod.getSource().getName(), CertificateHelper.getFingerprint(mod.getSigningCertificate()));
    }
    if (getActiveModList().isEmpty())
    {
        FMLLog.fine("No user mod signature data found");
    }
    modController.transition(LoaderState.PREINITIALIZATION, false);
    modController.distributeStateMessage(LoaderState.PREINITIALIZATION, disc.getASMTable(), canonicalConfigDir);
    modController.transition(LoaderState.INITIALIZATION, false);
    GameData.validateRegistry();
}
 
开发者ID:HATB0T,项目名称:RuneCraftery,代码行数:55,代码来源:Loader.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java InvalidSignatureException类代码示例发布时间:2022-05-22
下一篇:
Java ClientResponseObserver类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap