Search in sources :

Example 1 with MCFormatter

use of crafttweaker.mc1120.formatting.MCFormatter in project CraftTweaker by CraftTweaker.

the class CraftTweaker method onConstruction.

@EventHandler
public void onConstruction(FMLConstructionEvent event) {
    CrafttweakerImplementationAPI.init(new MCOreDict(), recipes = new MCRecipeManager(), new MCFurnaceManager(), MCGame.INSTANCE, new MCLoadedMods(), new MCFormatter(), new MCVanilla(), new MCItemUtils(), new MCBrewing());
    CrafttweakerImplementationAPI.logger.addLogger(new MCLogger(new File("crafttweaker.log")));
    CrafttweakerImplementationAPI.platform = MCPlatformFunctions.INSTANCE;
    File globalDir = new File("scripts");
    if (!globalDir.exists())
        globalDir.mkdirs();
    scriptsGlobal = new ScriptProviderDirectory(globalDir);
    CrafttweakerImplementationAPI.setScriptProvider(scriptsGlobal);
    if (event.getSide().isServer()) {
        CraftTweakerAPI.tweaker.setNetworkSide(NetworkSide.SIDE_SERVER);
    } else {
        CraftTweakerAPI.tweaker.setNetworkSide(NetworkSide.SIDE_CLIENT);
    }
    // register the modloaded preprocessor which can't be in the API package as it needs access to MC
    CraftTweakerAPI.tweaker.getPreprocessorManager().registerPreprocessorAction("modloaded", ModLoadedPreprocessor::new);
}
Also used : MCItemUtils(crafttweaker.mc1120.item.MCItemUtils) MCVanilla(crafttweaker.mc1120.vanilla.MCVanilla) MCBrewing(crafttweaker.mc1120.brewing.MCBrewing) ModLoadedPreprocessor(crafttweaker.mc1120.preprocessors.ModLoadedPreprocessor) MCOreDict(crafttweaker.mc1120.oredict.MCOreDict) MCRecipeManager(crafttweaker.mc1120.recipes.MCRecipeManager) MCFormatter(crafttweaker.mc1120.formatting.MCFormatter) ScriptProviderDirectory(crafttweaker.runtime.providers.ScriptProviderDirectory) MCFurnaceManager(crafttweaker.mc1120.furnace.MCFurnaceManager) File(java.io.File) MCLogger(crafttweaker.mc1120.logger.MCLogger) MCLoadedMods(crafttweaker.mc1120.mods.MCLoadedMods) EventHandler(net.minecraftforge.fml.common.Mod.EventHandler)

Aggregations

MCBrewing (crafttweaker.mc1120.brewing.MCBrewing)1 MCFormatter (crafttweaker.mc1120.formatting.MCFormatter)1 MCFurnaceManager (crafttweaker.mc1120.furnace.MCFurnaceManager)1 MCItemUtils (crafttweaker.mc1120.item.MCItemUtils)1 MCLogger (crafttweaker.mc1120.logger.MCLogger)1 MCLoadedMods (crafttweaker.mc1120.mods.MCLoadedMods)1 MCOreDict (crafttweaker.mc1120.oredict.MCOreDict)1 ModLoadedPreprocessor (crafttweaker.mc1120.preprocessors.ModLoadedPreprocessor)1 MCRecipeManager (crafttweaker.mc1120.recipes.MCRecipeManager)1 MCVanilla (crafttweaker.mc1120.vanilla.MCVanilla)1 ScriptProviderDirectory (crafttweaker.runtime.providers.ScriptProviderDirectory)1 File (java.io.File)1 EventHandler (net.minecraftforge.fml.common.Mod.EventHandler)1