本文整理汇总了Java中cpw.mods.fml.common.event.FMLConstructionEvent.getModClassLoader方法的典型用法代码示例。如果您正苦于以下问题:Java FMLConstructionEvent.getModClassLoader方法的具体用法?Java FMLConstructionEvent.getModClassLoader怎么用?Java FMLConstructionEvent.getModClassLoader使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cpw.mods.fml.common.event.FMLConstructionEvent
的用法示例。
在下文中一共展示了FMLConstructionEvent.getModClassLoader方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
}
示例2: 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);
}
}
示例3: modConstruction
import cpw.mods.fml.common.event.FMLConstructionEvent; //导入方法依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent event) {
loader = event.getModClassLoader();
}