本文整理汇总了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);
}
}
示例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);
}
示例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);
}
示例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"));
}
示例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");
}
}
示例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);
}
}
示例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");
}
}
示例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();
}
示例9: modConstruction
import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent event)
{
}
示例10: constr
import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@EventHandler
public void constr(FMLConstructionEvent event) {
this.initHandler.findModules(event);
}
示例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());
}
示例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());
}
示例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);
}
示例14: modConstruction
import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent evt) {}
示例15: modConstruction
import cpw.mods.fml.common.event.FMLConstructionEvent; //导入依赖的package包/类
@Subscribe
public void modConstruction(FMLConstructionEvent event) {
loader = event.getModClassLoader();
}