本文整理汇总了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();
}
示例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();
}
示例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);
}
示例4: load
import cpw.mods.fml.common.event.FMLLoadEvent; //导入依赖的package包/类
public void load(FMLLoadEvent event)
{
ModBiomes.load();
}
示例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();
}