本文整理汇总了Java中cpw.mods.fml.common.FMLModContainer类的典型用法代码示例。如果您正苦于以下问题:Java FMLModContainer类的具体用法?Java FMLModContainer怎么用?Java FMLModContainer使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
FMLModContainer类属于cpw.mods.fml.common包,在下文中一共展示了FMLModContainer类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getModIDs
import cpw.mods.fml.common.FMLModContainer; //导入依赖的package包/类
public static String[] getModIDs()
{
List<ModContainer> modList = Loader.instance().getActiveModList();
List<String> modIDs = new ArrayList<String>();
for (ModContainer modContainer : modList)
{
if (modContainer instanceof FMLModContainer)
{
modIDs.add(modContainer.getModId());
}
}
Collections.sort(modIDs, new Comparator<String>()
{
@Override
public int compare(String o1, String o2)
{
return Loader.instance().getIndexedModList().get(o1).getName().compareTo(Loader.instance().getIndexedModList().get(o2).getName());
}
});
return modIDs.toArray(new String[modIDs.size()]);
}
示例2: getVersionProperties
import cpw.mods.fml.common.FMLModContainer; //导入依赖的package包/类
public Properties getVersionProperties()
{
if (this.modContainer instanceof FMLModContainer)
{
return ((FMLModContainer)this.modContainer).searchForVersionProperties();
}
return null;
}
示例3: construct
import cpw.mods.fml.common.FMLModContainer; //导入依赖的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);
}
示例4: dump
import cpw.mods.fml.common.FMLModContainer; //导入依赖的package包/类
@Override
public Iterable<String[]> dump(int mode) {
List<String[]> list = new LinkedList<String[]>();
for (ModContainer mod : Loader.instance().getModList()) {
list.add(new String[] { mod.getModId(), mod.getName(), mod.getVersion(), String.valueOf(!(mod instanceof FMLModContainer)), String.valueOf(mod.canBeDisabled()), mod.getDependencies().toString() });
}
return list;
}