Search in sources :

Example 1 with ICompatModule

use of techreborn.compat.ICompatModule in project TechReborn by TechReborn.

the class Core method preinit.

@Mod.EventHandler
public void preinit(FMLPreInitializationEvent event) throws IllegalAccessException, InstantiationException {
    event.getModMetadata().version = ModInfo.MOD_VERSION;
    INSTANCE = this;
    FMLCommonHandler.instance().bus().register(this);
    MinecraftForge.EVENT_BUS.register(this);
    configDir = new File(event.getModConfigurationDirectory(), "techreborn");
    if (!configDir.exists()) {
        configDir.mkdir();
    }
    config = ConfigTechReborn.initialize(new File(configDir, "main.cfg"));
    worldGen = new TechRebornWorldGen();
    worldGen.configFile = (new File(configDir, "ores.json"));
    worldGen.hConfigFile = (new File(configDir, "ores.hjson"));
    TechRebornAPI.subItemRetriever = new SubItemRetriever();
    for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
        compatModule.preInit(event);
    }
    // Register ModBlocks
    ModBlocks.init();
    // Register Fluids
    ModFluids.init();
    // Register ModItems
    ModItems.init();
    // Entitys
    EntityRegistry.registerModEntity(EntityNukePrimed.class, "nuke", 0, INSTANCE, 160, 5, true);
    proxy.preInit(event);
    RecipeConfigManager.load(event.getModConfigurationDirectory());
    versionChecker = new VersionChecker("TechReborn", new ModInfo());
    versionChecker.checkVersionThreaded();
    logHelper.info("PreInitialization Complete");
}
Also used : VersionChecker(reborncore.common.util.VersionChecker) TechRebornWorldGen(techreborn.world.TechRebornWorldGen) ICompatModule(techreborn.compat.ICompatModule) File(java.io.File) ModInfo(techreborn.lib.ModInfo)

Example 2 with ICompatModule

use of techreborn.compat.ICompatModule in project TechReborn by TechReborn.

the class Core method init.

@Mod.EventHandler
public void init(FMLInitializationEvent event) throws IllegalAccessException, InstantiationException {
    // World gen
    VeinWorldGenerator.registerTRVeins();
    if (ConfigTechReborn.veinOres) {
        GameRegistry.registerWorldGenerator(VeinWorldGenerator.INSTANCE, 0);
    }
    // Registers Chest Loot
    ModLoot.init();
    // Multiparts
    ModParts.init();
    // Sounds
    ModSounds.init();
    // Compat
    for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
        compatModule.init(event);
    }
    MinecraftForge.EVENT_BUS.register(new StackWIPHandler());
    // Ore Dictionary
    OreDict.init();
    // Recipes
    StopWatch watch = new StopWatch();
    watch.start();
    ModRecipes.init();
    logHelper.all(watch + " : main recipes");
    watch.stop();
    // Client only init, needs to be done before parts system
    proxy.init(event);
    // WorldGen
    worldGen.load();
    if (!ConfigTechReborn.veinOres) {
        GameRegistry.registerWorldGenerator(worldGen, 0);
    }
    // DungeonLoot.init();
    // Register Gui Handler
    NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
    // Achievements
    TRAchievements.init();
    // Multiblock events
    MinecraftForge.EVENT_BUS.register(new MultiblockEventHandler());
    // IDSU manager
    IDSUManager.INSTANCE = new IDSUManager();
    // Event busses
    MinecraftForge.EVENT_BUS.register(IDSUManager.INSTANCE);
    MinecraftForge.EVENT_BUS.register(new MultiblockServerTickHandler());
    MinecraftForge.EVENT_BUS.register(new TRTickHandler());
    MinecraftForge.EVENT_BUS.register(new OreUnifier());
    // Scrapbox
    if (config.ScrapboxDispenser) {
        BlockDispenser.DISPENSE_BEHAVIOR_REGISTRY.putObject(ModItems.scrapBox, new BehaviorDispenseScrapbox());
    }
    logHelper.info("Initialization Complete");
}
Also used : MultiblockServerTickHandler(reborncore.common.multiblock.MultiblockServerTickHandler) MultiblockEventHandler(reborncore.common.multiblock.MultiblockEventHandler) BehaviorDispenseScrapbox(techreborn.dispenser.BehaviorDispenseScrapbox) OreUnifier(techreborn.events.OreUnifier) ICompatModule(techreborn.compat.ICompatModule) StackWIPHandler(techreborn.utils.StackWIPHandler) TRTickHandler(techreborn.events.TRTickHandler) GuiHandler(techreborn.client.GuiHandler) IDSUManager(techreborn.tiles.idsu.IDSUManager) StopWatch(org.apache.commons.lang3.time.StopWatch)

Example 3 with ICompatModule

use of techreborn.compat.ICompatModule in project TechReborn by TechReborn.

the class Core method postinit.

@Mod.EventHandler
public void postinit(FMLPostInitializationEvent event) throws Exception {
    // Has to be done here as Buildcraft registers their recipes late
    for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
        compatModule.postInit(event);
    }
    proxy.postInit(event);
    logHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
// RecipeHandler.scanForDupeRecipes();
// RecipeConfigManager.save();
// recipeCompact.saveMissingItems(configDir);
}
Also used : ICompatModule(techreborn.compat.ICompatModule)

Aggregations

ICompatModule (techreborn.compat.ICompatModule)3 File (java.io.File)1 StopWatch (org.apache.commons.lang3.time.StopWatch)1 MultiblockEventHandler (reborncore.common.multiblock.MultiblockEventHandler)1 MultiblockServerTickHandler (reborncore.common.multiblock.MultiblockServerTickHandler)1 VersionChecker (reborncore.common.util.VersionChecker)1 GuiHandler (techreborn.client.GuiHandler)1 BehaviorDispenseScrapbox (techreborn.dispenser.BehaviorDispenseScrapbox)1 OreUnifier (techreborn.events.OreUnifier)1 TRTickHandler (techreborn.events.TRTickHandler)1 ModInfo (techreborn.lib.ModInfo)1 IDSUManager (techreborn.tiles.idsu.IDSUManager)1 StackWIPHandler (techreborn.utils.StackWIPHandler)1 TechRebornWorldGen (techreborn.world.TechRebornWorldGen)1