net.minecraftforge.fml.common.event.FMLConstructionEvent Java Examples

The following examples show how to use net.minecraftforge.fml.common.event.FMLConstructionEvent. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: OpenModsCore.java    From OpenModsLib with MIT License 6 votes vote down vote up
@Subscribe
public void modConstruction(FMLConstructionEvent evt) {
	OpenModsClassTransformer.instance().injectAsmData(evt.getASMHarvestedData());
	FMLCommonHandler.instance().registerCrashCallable(new ICrashCallable() {

		@Override
		public String call() throws Exception {
			return OpenModsClassTransformer.instance().listStates();
		}

		@Override
		public String getLabel() {
			return "OpenModsLib class transformers";
		}
	});
}
 
Example #2
Source File: I18nUpdateMod.java    From I18nUpdateMod with MIT License 5 votes vote down vote up
@Mod.EventHandler
public void construct(FMLConstructionEvent event) {
    // 国际化检查
    if (I18nConfig.internationalization.openI18n && !isChinese()) {
        return;
    }

    DownloadInfoHelper.init();

    // 设置中文
    if (I18nConfig.download.setupChinese) {
        setupLang();
    }

    if (!I18nConfig.download.shouldDownload) {
        return;
    }

    ResourcePackBuilder builder = new ResourcePackBuilder();
    boolean needUpdate = builder.checkUpdate();
    ResourcePackInstaller.setResourcesRepository();

    if (needUpdate) {
        String localPath;
        try {
            localPath = new File(I18nUtils.getLocalRepositoryFolder(I18nConfig.download.localRepoPath), "I18nRepo").getPath();
        } catch (IllegalArgumentException e) {
            shouldDisplayErrorScreen = true;
            return;
        }
        ResourcePackRepository repo = new ResourcePackRepository(localPath, builder.getAssetDomains());
        RepoUpdateManager updateManager = new RepoUpdateManager(repo);
        updateManager.update();
        if (updateManager.getStatus() == DownloadStatus.SUCCESS) {
            builder.updateAllNeededFilesFromRepo(repo);
            builder.touch();
            ShowNoticeFirst.shouldShowNotice = true;
        }
    }
}
 
Example #3
Source File: TofuMain.java    From TofuCraftReload with MIT License 4 votes vote down vote up
@EventHandler
public void construct(FMLConstructionEvent event) {
    MinecraftForge.EVENT_BUS.register(this);

    FluidRegistry.enableUniversalBucket();
}
 
Example #4
Source File: SakuraMain.java    From Sakura_mod with MIT License 4 votes vote down vote up
@EventHandler
public void construct(FMLConstructionEvent event) {
    MinecraftForge.EVENT_BUS.register(this);

    FluidRegistry.enableUniversalBucket();
}
 
Example #5
Source File: SentientBread.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void onConstruction(FMLConstructionEvent event)
{
    isLoaded = SubModLoader.isSubModLoaded(this);
}
 
Example #6
Source File: ModTest.java    From CommunityMod with GNU Lesser General Public License v2.1 4 votes vote down vote up
@Override
public void onConstruction(FMLConstructionEvent event)
{
    isLoaded = SubModLoader.isSubModLoaded(this);
}
 
Example #7
Source File: ProductionLine.java    From Production-Line with MIT License 4 votes vote down vote up
@Mod.EventHandler
public void construct(FMLConstructionEvent event) {
    MinecraftForge.EVENT_BUS.register(INSTANCE);
}
 
Example #8
Source File: ModContainer.java    From AdvancedRocketry with MIT License 4 votes vote down vote up
@SubscribeEvent
public void modConstruction(FMLConstructionEvent event) {}