Search in sources :

Example 1 with ChunkLoaderManager

use of buildcraft.lib.chunkload.ChunkLoaderManager in project BuildCraft by BuildCraft.

the class BCLib method preInit.

@Mod.EventHandler
public static void preInit(FMLPreInitializationEvent evt) {
    MOD_CONTAINER = Loader.instance().activeModContainer();
    BCLog.logger.info("");
    BCLog.logger.info("Starting BuildCraft " + BCLib.VERSION);
    BCLog.logger.info("Copyright (c) the BuildCraft team, 2011-2018");
    BCLog.logger.info("https://www.mod-buildcraft.com");
    if (!GIT_COMMIT_HASH.startsWith("${")) {
        BCLog.logger.info("Detailed Build Information:");
        BCLog.logger.info("  Branch " + GIT_BRANCH);
        BCLog.logger.info("  Commit " + GIT_COMMIT_HASH);
        BCLog.logger.info("    " + GIT_COMMIT_MSG);
        BCLog.logger.info("    committed by " + GIT_COMMIT_AUTHOR);
    }
    BCLog.logger.info("");
    BCLog.logger.info("Loaded Modules:");
    for (BCModules module : BCModules.VALUES) {
        if (module.isLoaded()) {
            BCLog.logger.info("  - " + module.lowerCaseName);
        }
    }
    BCLog.logger.info("Missing Modules:");
    for (BCModules module : BCModules.VALUES) {
        if (!module.isLoaded()) {
            BCLog.logger.info("  - " + module.lowerCaseName);
        }
    }
    BCLog.logger.info("");
    ExpressionDebugManager.logger = BCLog.logger::info;
    ExpressionCompat.setup();
    BCLibRegistries.fmlPreInit();
    BCLibProxy.getProxy().fmlPreInit();
    BCLibItems.fmlPreInit();
    BuildCraftObjectCaches.fmlPreInit();
    NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, BCLibProxy.getProxy());
    MinecraftForge.EVENT_BUS.register(BCLibEventDist.class);
    MinecraftForge.EVENT_BUS.register(MigrationManager.INSTANCE);
    MinecraftForge.EVENT_BUS.register(FluidManager.class);
    // Set max chunk limit for quarries: 1 chunk for quarry itself and 5 * 5 chunks square for working area
    ForgeChunkManager.getConfig().get(MODID, "maximumChunksPerTicket", 26);
    ForgeChunkManager.syncConfigDefaults();
    ForgeChunkManager.setForcedChunkLoadingCallback(BCLib.INSTANCE, ChunkLoaderManager::rebindTickets);
}
Also used : BCModules(buildcraft.api.BCModules) ChunkLoaderManager(buildcraft.lib.chunkload.ChunkLoaderManager)

Aggregations

BCModules (buildcraft.api.BCModules)1 ChunkLoaderManager (buildcraft.lib.chunkload.ChunkLoaderManager)1