@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); } }
@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); }
@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); }
@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")); }
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"); } }
@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); } }
@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"); } }
@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(); }
@Subscribe public void modConstruction(FMLConstructionEvent event) { }
@EventHandler public void constr(FMLConstructionEvent event) { this.initHandler.findModules(event); }
@Subscribe public void modConstruction(FMLConstructionEvent evt) { NetworkRegistry.INSTANCE.register(this, this.getClass(), null, evt.getASMHarvestedData()); FMLNetworkHandler.registerChannel(this, evt.getSide()); }
@Subscribe public void modConstruction(FMLConstructionEvent evt) { NetworkRegistry.INSTANCE.register(this, this.getClass(), "*", evt.getASMHarvestedData()); ForgeNetworkHandler.registerChannel(this, evt.getSide()); }
@Subscribe public void constructMod(final FMLConstructionEvent event) { Injector.inject(this, Injector.Phase.Construct, new Object[0]); FanLoader.migrate(FanLoader.State.Loaded); }
@Subscribe public void modConstruction(FMLConstructionEvent evt) {}
@Subscribe public void modConstruction(FMLConstructionEvent event) { loader = event.getModClassLoader(); }
@Subscribe public void construct(FMLConstructionEvent event) { doProgress(State.CONSTRUCT, this); }
@SubscribeEvent public void modConstruction(FMLConstructionEvent event) {}
@Mod.EventHandler public void construct(final FMLConstructionEvent event) { proxy.construct(event); }
@Mod.EventHandler public void onConstruct(FMLConstructionEvent event) { GadomancyApi.setInstance(new DefaultApiHandler()); proxy.onConstruct(); }
@EventHandler public void modConstructing(FMLConstructionEvent event) { }
@Subscribe public void onModConstruct(FMLConstructionEvent evt) {}
@Subscribe public void modConstruction(FMLConstructionEvent evt){ }