fix crash without rf api

This commit is contained in:
Blood-Asp 2015-12-21 18:44:07 +01:00
parent cc3631c8ae
commit 9781ccd9ee
2 changed files with 15 additions and 12 deletions

View file

@ -239,17 +239,6 @@ public class GT_Mod
GregTech_API.mRFExplosions = GregTech_API.sOPStuff.get(ConfigCategories.general, "RFExplosions", false);
GregTech_API.meIOLoaded = Loader.isModLoaded("EnderIO");
if(GregTech_API.mOutputRF||GregTech_API.mInputRF){
try {
Class tClass = cofh.api.energy.IEnergyReceiver.class;
tClass.getCanonicalName();
} catch (Exception e) {
GregTech_API.mOutputRF = false;
GregTech_API.mInputRF = false;
System.err.println("RF API not found");
}
}
gregtechproxy.mChangeHarvestLevels = GregTech_API.sMaterialProperties.get("havestLevel", "activateHarvestLevelChange", false);
if(gregtechproxy.mChangeHarvestLevels){
gregtechproxy.mGraniteHavestLevel = (int) GregTech_API.sMaterialProperties.get("havestLevel", "graniteHarvestLevel", 3);
@ -680,6 +669,15 @@ public class GT_Mod
}
}
}
if(GregTech_API.mOutputRF||GregTech_API.mInputRF){
GT_Utility.checkAvailabilities();
if(!GT_Utility.RF_CHECK){
GregTech_API.mOutputRF = false;
GregTech_API.mInputRF = false;
}
}
achievements = new GT_Achievements();
Map.Entry<IRecipeInput, RecipeOutput> tRecipe;
GT_Log.out.println("GT_Mod: Loading finished, deallocating temporary Init Variables.");

View file

@ -85,7 +85,7 @@ public class GT_Utility {
private static final Map<GT_ItemStack, FluidContainerData> sFilledContainerToData = new HashMap<GT_ItemStack, FluidContainerData>();
private static final Map<GT_ItemStack, Map<Fluid, FluidContainerData>> sEmptyContainerToFluidToData = new HashMap<GT_ItemStack, Map<Fluid, FluidContainerData>>();
public static volatile int VERSION = 509;
public static boolean TE_CHECK = false, BC_CHECK = false, CHECK_ALL = true;
public static boolean TE_CHECK = false, BC_CHECK = false, CHECK_ALL = true, RF_CHECK = false;
public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new HashMap<GT_PlayedSound, Integer>();
private static int sBookCount = 0;
@ -336,6 +336,11 @@ public class GT_Utility {
tClass.getCanonicalName();
BC_CHECK = true;
} catch (Throwable e) {/**/}
try {
Class tClass = cofh.api.energy.IEnergyReceiver.class;
tClass.getCanonicalName();
RF_CHECK = true;
} catch (Throwable e) {/**/}
CHECK_ALL = false;
}
}