Search in sources :

Example 1 with ICompat

use of gregapi.compat.ICompat in project gregtech6 by GregTech6.

the class GT_API method onModInit2.

@Override
public void onModInit2(FMLInitializationEvent aEvent) {
    if (MD.CHSL.mLoaded)
        try {
            Carving.chisel.getGroup("cobblestone").setOreName(null);
            Carving.chisel.getGroup("glowstone").setOreName(null);
        } catch (Throwable e) {
            e.printStackTrace(ERR);
        }
    OUT.println(getModNameForLog() + ": If the Loading Bar somehow Freezes at this Point, then you definetly ran out of Memory or permgenspace, look at the other Logs to confirm it.");
    OreDictManager.INSTANCE.enableRegistrations();
    for (ICompat tCompat : ICompat.COMPAT_CLASSES) try {
        tCompat.onLoad(aEvent);
    } catch (Throwable e) {
        e.printStackTrace(ERR);
    }
}
Also used : ICompat(gregapi.compat.ICompat)

Example 2 with ICompat

use of gregapi.compat.ICompat in project gregtech6 by GregTech6.

the class GT_API method onModPostInit2.

@Override
public void onModPostInit2(FMLPostInitializationEvent aEvent) {
    if (MD.IC2.mLoaded) {
        PotionsGT.ID_RADIATION = ic2.api.info.Info.POTION_RADIATION.id;
    }
    if (MD.ENVM.mLoaded) {
        PotionsGT.ID_DEHYDRATION = enviromine.EnviroPotion.dehydration.id;
        PotionsGT.ID_FROSTBITE = enviromine.EnviroPotion.frostbite.id;
        PotionsGT.ID_HEATSTROKE = enviromine.EnviroPotion.heatstroke.id;
        PotionsGT.ID_HYPOTHERMIA = enviromine.EnviroPotion.hypothermia.id;
        PotionsGT.ID_INSANITY = enviromine.EnviroPotion.insanity.id;
    }
    if (MD.IE.mLoaded) {
        PotionsGT.ID_FLAMMABLE = blusunrize.immersiveengineering.common.util.IEPotions.flammable.id;
        PotionsGT.ID_SLIPPERY = blusunrize.immersiveengineering.common.util.IEPotions.slippery.id;
        PotionsGT.ID_CONDUCTIVE = blusunrize.immersiveengineering.common.util.IEPotions.conductive.id;
        PotionsGT.ID_STICKY = blusunrize.immersiveengineering.common.util.IEPotions.sticky.id;
    }
    EnergyCompat.checkAvailabilities();
    ToolCompat.checkAvailabilities();
    ST.checkAvailabilities();
    OUT.println(getModNameForLog() + ": If the Loading Bar somehow Freezes at this Point, then you definetly ran out of Memory or permgenspace, look at the other Logs to confirm it.");
    OreDictManager.INSTANCE.onPostLoad();
    ICover tCover = new CoverRedstoneTorch();
    CoverRegistry.put(ST.make(Blocks.redstone_torch, 1, 0), tCover);
    CoverRegistry.put(ST.make(Blocks.unlit_redstone_torch, 1, 0), tCover);
    CoverRegistry.put(ST.make(Items.repeater, 1, 0), new CoverRedstoneRepeater());
    OreDictPrefix.applyAllStackSizes();
    // Doesn't fucking work, the Chisel API is pure garbage...
    // if (MD.CHSL.mLoaded) {
    // if (MD.EtFu.mLoaded) {
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "granite|" +MD.EtFu.mID+":stone|1");
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "diorite|" +MD.EtFu.mID+":stone|3");
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "andesite|"+MD.EtFu.mID+":stone|5");
    // }
    // if (MD.BOTA.mLoaded) {
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "granite|" +MD.BOTA.mID+":stone|3");
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "diorite|" +MD.BOTA.mID+":stone|2");
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "andesite|"+MD.BOTA.mID+":stone|0");
    // }
    // if (MD.GT.mLoaded) {
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "granite|" +MD.GT.mID+":gt.stone.granite|0");
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "diorite|" +MD.GT.mID+":gt.stone.diorite|0");
    // FMLInterModComms.sendRuntimeMessage(GAPI, "ChiselAPI|Carving", "variation:add", "andesite|"+MD.GT.mID+":gt.stone.andesite|0");
    // }
    // }
    // Saving the Lang File.
    LanguageHandler.save();
    if (mPlayerLogger != null)
        new Thread(mPlayerLogger).start();
    for (ICompat tCompat : ICompat.COMPAT_CLASSES) try {
        tCompat.onPostLoad(aEvent);
    } catch (Throwable e) {
        e.printStackTrace(ERR);
    }
    for (OreDictMaterial tMaterial : OreDictMaterial.MATERIAL_ARRAY) if (tMaterial != null && !tMaterial.contains(TD.Properties.INVALID_MATERIAL)) {
        if (tMaterial.mID < 10000)
            MAT_LOG.print(" ");
        if (tMaterial.mID < 1000)
            MAT_LOG.print(" ");
        if (tMaterial.mID < 100)
            MAT_LOG.print(" ");
        if (tMaterial.mID < 10)
            MAT_LOG.print(" ");
        MAT_LOG.print(tMaterial.mID);
        MAT_LOG.print(": ");
        MAT_LOG.print(tMaterial.mNameInternal);
        MAT_LOG.println();
    }
}
Also used : ICompat(gregapi.compat.ICompat) OreDictMaterial(gregapi.oredict.OreDictMaterial) CoverRedstoneRepeater(gregapi.cover.covers.CoverRedstoneRepeater) CoverRedstoneTorch(gregapi.cover.covers.CoverRedstoneTorch) ICover(gregapi.cover.ICover)

Example 3 with ICompat

use of gregapi.compat.ICompat in project gregtech6 by GregTech6.

the class Abstract_Mod method onModServerStopping.

public void onModServerStopping(FMLServerStoppingEvent aEvent) {
    loadRunnables(mBeforeServerStopping);
    mStartedServerStopping++;
    if (mProxy != null)
        mProxy.onProxyBeforeServerStopping(this, aEvent);
    onModServerStopping2(aEvent);
    for (ICompat tCompat : mCompatClasses) try {
        tCompat.onServerStopping(aEvent);
    } catch (Throwable e) {
        e.printStackTrace(ERR);
    }
    if (mProxy != null)
        mProxy.onProxyAfterServerStopping(this, aEvent);
    mFinishedServerStopping++;
    loadRunnables(mAfterServerStopping);
}
Also used : ICompat(gregapi.compat.ICompat)

Example 4 with ICompat

use of gregapi.compat.ICompat in project gregtech6 by GregTech6.

the class Abstract_Mod method onModPreInit.

// Just add Calls to these from within your Mods load phases.
public void onModPreInit(FMLPreInitializationEvent aEvent) {
    if (mStartedPreInit)
        return;
    try {
        mProxy = getProxy();
        OUT.println(getModNameForLog() + ": ======================");
        ORD.println(getModNameForLog() + ": ======================");
        loadRunnables("Before PreInit", mBeforePreInit);
        mBeforePreInit.clear();
        mBeforePreInit = null;
        OUT.println(getModNameForLog() + ": PreInit-Phase started!");
        ORD.println(getModNameForLog() + ": PreInit-Phase started!");
        mStartedPreInit = T;
        sStartedPreInit++;
        if (mProxy != null)
            mProxy.onProxyBeforePreInit(this, aEvent);
        onModPreInit2(aEvent);
        if (mProxy != null)
            mProxy.onProxyAfterPreInit(this, aEvent);
        sFinishedPreInit++;
        mFinishedPreInit = T;
        OUT.println(getModNameForLog() + ": PreInit-Phase finished!");
        ORD.println(getModNameForLog() + ": PreInit-Phase finished!");
        if (!mCompatClasses.isEmpty()) {
            UT.LoadingBar.start("Loading Compat (PreInit)", mCompatClasses.size());
            for (ICompat tCompat : mCompatClasses) {
                String tString = tCompat.toString();
                UT.LoadingBar.step(UT.Code.stringValid(tString) ? tString : "UNNAMED");
                try {
                    tCompat.onPreLoad(aEvent);
                } catch (Throwable e) {
                    e.printStackTrace(ERR);
                }
            }
            UT.LoadingBar.finish();
        }
        loadRunnables("After PreInit", mAfterPreInit);
        mAfterPreInit.clear();
        mAfterPreInit = null;
        loadRunnables("Saving Configs", sConfigs);
        if (sFinishedPreInit >= sModCountUsingGTAPI)
            for (Abstract_Mod tMod : MODS_USING_GT_API) try {
                tMod.onModFinalPreInit(aEvent);
            } catch (Throwable e) {
                e.printStackTrace(ERR);
            }
        OUT.println(getModNameForLog() + ": =======================");
        ORD.println(getModNameForLog() + ": =======================");
    } catch (Throwable e) {
        loadRunnables("Saving Configs after Exception!", sConfigs);
        e.printStackTrace(ERR);
        throw new RuntimeException(e);
    }
}
Also used : ICompat(gregapi.compat.ICompat)

Example 5 with ICompat

use of gregapi.compat.ICompat in project gregtech6 by GregTech6.

the class Abstract_Mod method onModPostInit.

public void onModPostInit(FMLPostInitializationEvent aEvent) {
    if (mStartedPostInit)
        return;
    try {
        OUT.println(getModNameForLog() + ": =======================");
        ORD.println(getModNameForLog() + ": =======================");
        loadRunnables("Before PostInit", mBeforePostInit);
        mBeforePostInit.clear();
        mBeforePostInit = null;
        OUT.println(getModNameForLog() + ": PostInit-Phase started!");
        ORD.println(getModNameForLog() + ": PostInit-Phase started!");
        mStartedPostInit = T;
        sStartedPostInit++;
        if (mProxy != null)
            mProxy.onProxyBeforePostInit(this, aEvent);
        onModPostInit2(aEvent);
        if (mProxy != null)
            mProxy.onProxyAfterPostInit(this, aEvent);
        sFinishedPostInit++;
        mFinishedPostInit = T;
        OUT.println(getModNameForLog() + ": PostInit-Phase finished!");
        ORD.println(getModNameForLog() + ": PostInit-Phase finished!");
        if (!mCompatClasses.isEmpty()) {
            UT.LoadingBar.start("Loading Compat (PostInit)", mCompatClasses.size());
            for (ICompat tCompat : mCompatClasses) {
                String tString = tCompat.toString();
                UT.LoadingBar.step(UT.Code.stringValid(tString) ? tString : "UNNAMED");
                try {
                    tCompat.onPostLoad(aEvent);
                } catch (Throwable e) {
                    e.printStackTrace(ERR);
                }
            }
            UT.LoadingBar.finish();
        }
        loadRunnables("After PostInit", mAfterPostInit);
        mAfterPostInit.clear();
        mAfterPostInit = null;
        loadRunnables("Finalize", mFinalize);
        mFinalize.clear();
        mFinalize = null;
        if (sFinishedPostInit >= sModCountUsingGTAPI)
            for (Abstract_Mod tMod : MODS_USING_GT_API) try {
                tMod.onModFinalPostInit(aEvent);
            } catch (Throwable e) {
                e.printStackTrace(ERR);
            }
        sFinalized++;
        mFinalized = T;
        if (sFinalized >= sModCountUsingGTAPI) {
            CR.stopBuffering();
        }
        loadRunnables("Saving Configs", sConfigs);
        OUT.println(getModNameForLog() + ": ========================");
        ORD.println(getModNameForLog() + ": ========================");
    } catch (Throwable e) {
        loadRunnables("Saving Configs after Exception!", sConfigs);
        e.printStackTrace(ERR);
        throw new RuntimeException(e);
    }
}
Also used : ICompat(gregapi.compat.ICompat)

Aggregations

ICompat (gregapi.compat.ICompat)10 OreDictMaterial (gregapi.oredict.OreDictMaterial)2 Config (gregapi.config.Config)1 ICover (gregapi.cover.ICover)1 CoverRedstoneRepeater (gregapi.cover.covers.CoverRedstoneRepeater)1 CoverRedstoneTorch (gregapi.cover.covers.CoverRedstoneTorch)1 Enchantment_EnderDamage (gregapi.enchants.Enchantment_EnderDamage)1 Enchantment_Radioactivity (gregapi.enchants.Enchantment_Radioactivity)1 Enchantment_SlimeDamage (gregapi.enchants.Enchantment_SlimeDamage)1 Enchantment_WerewolfDamage (gregapi.enchants.Enchantment_WerewolfDamage)1 ItemEmptySlot (gregapi.item.ItemEmptySlot)1 ItemFluidDisplay (gregapi.item.ItemFluidDisplay)1 ItemIntegratedCircuit (gregapi.item.ItemIntegratedCircuit)1 LoaderOreDictReRegistrations (gregapi.load.LoaderOreDictReRegistrations)1 LogBuffer (gregapi.log.LogBuffer)1 LoggerPlayerActivity (gregapi.log.LoggerPlayerActivity)1 NetworkHandler (gregapi.network.NetworkHandler)1 OreDictPrefix (gregapi.oredict.OreDictPrefix)1 File (java.io.File)1 PrintStream (java.io.PrintStream)1