diff options
Diffstat (limited to 'src/Java/gtPlusPlus/GTplusplus.java')
-rw-r--r-- | src/Java/gtPlusPlus/GTplusplus.java | 102 |
1 files changed, 65 insertions, 37 deletions
diff --git a/src/Java/gtPlusPlus/GTplusplus.java b/src/Java/gtPlusPlus/GTplusplus.java index 540f4db79a..4d7643e0b0 100644 --- a/src/Java/gtPlusPlus/GTplusplus.java +++ b/src/Java/gtPlusPlus/GTplusplus.java @@ -187,15 +187,55 @@ public class GTplusplus implements ActionListener { * @param event - The {@link EventHandler} object passed through from FML to {@link #GTplusplus()}'s {@link #instance}. */ @Mod.EventHandler - public void onLoadComplete(FMLLoadCompleteEvent event) { + public void onLoadComplete(FMLLoadCompleteEvent event) { + tryPatchTurbineTextures(); + generateGregtechRecipeMaps(); + } + + public static void tryPatchTurbineTextures() { + if (enableAnimatedTurbines) { + BlockIcons h = Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE; + BlockIcons h2 = Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE; + try { + Logger.INFO("Trying to patch GT textures to make Turbines animated."); + IIcon aIcon = TexturesGtBlock.Overlay_Machine_Turbine_Active.getIcon(); + //IIcon aOverlay = TexturesGtBlock.Overlay_Machine_Turbine_Active.getOverlayIcon(); + if (ReflectionUtils.setField(h, "mIcon", aIcon)) { + Logger.INFO("Patched Gas Turbine Icon."); + /*if (ReflectionUtils.setField(h, "mOverlay", aOverlay)) { + Logger.INFO("Patched Gas Turbine Overlay Icon."); + }*/ + } + if (ReflectionUtils.setField(h2, "mIcon", aIcon)) { + Logger.INFO("Patched Steam Turbine Icon."); + /*if (ReflectionUtils.setField(h2, "mOverlay", aOverlay)) { + Logger.INFO("Patched Steam Turbine Overlay Icon."); + }*/ + } + } + catch (Throwable e) { + e.printStackTrace(); + } + } + } + + protected void generateGregtechRecipeMaps() { + + int[] mValidCount = new int[] {0, 0, 0}; + int[] mInvalidCount = new int[] {0, 0, 0}; + int[] mOriginalCount = new int[] {0, 0, 0}; + RecipeGen_BlastSmelterGT_GTNH.generateGTNHBlastSmelterRecipesFromEBFList(); FishPondFakeRecipe.generateFishPondRecipes(); //Large Centrifuge generation + mOriginalCount[0] = GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList.size(); for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sCentrifugeRecipes.mRecipeList) { if (x != null) { - if (ItemUtils.checkForInvalidItems(x.mInputs)) { - CORE.RA.addMultiblockCentrifugeRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) { + if (CORE.RA.addMultiblockCentrifugeRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) { + mValidCount[0]++; + } } else { Logger.INFO("[Recipe] Error generating Large Centrifuge recipe."); @@ -205,13 +245,19 @@ public class GTplusplus implements ActionListener { Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(x.mFluidOutputs)); } } + else { + mInvalidCount[0]++; + } } //Large Electrolyzer generation + mOriginalCount[1] = GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList.size(); for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sElectrolyzerRecipes.mRecipeList) { if (x != null) { - if (ItemUtils.checkForInvalidItems(x.mInputs)) { - CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); + if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) { + if (CORE.RA.addMultiblockElectrolyzerRecipe(x.mInputs, x.mFluidInputs, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) { + mValidCount[1]++; + } } else { Logger.INFO("[Recipe] Error generating Large Electrolyzer recipe."); @@ -221,9 +267,13 @@ public class GTplusplus implements ActionListener { Logger.INFO("Fluid Outputs: "+ItemUtils.getArrayStackNames(x.mFluidOutputs)); } } + else { + mInvalidCount[1]++; + } } //Advanced Vacuum Freezer generation + mOriginalCount[2] = GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList.size(); for (GT_Recipe x : GT_Recipe.GT_Recipe_Map.sVacuumRecipes.mRecipeList) { if (x != null && RecipeUtils.doesGregtechRecipeHaveEqualCells(x)) { int mTime = (x.mDuration/2); @@ -238,42 +288,20 @@ public class GTplusplus implements ActionListener { mr3++; } y[slot] = FluidUtils.getFluidStack("cryotheum", mTime); - if (ItemUtils.checkForInvalidItems(x.mInputs)) { - CORE.RA.addAdvancedFreezerRecipe(x.mInputs, y, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue); - } - } - } - - Logger.INFO("[Bedrock Miner] Initial OreType Scan"); - MiningUtils.iterateAllOreTypes(); - tryPatchTurbineTextures(); - } - - public static void tryPatchTurbineTextures() { - if (enableAnimatedTurbines) { - BlockIcons h = Textures.BlockIcons.GAS_TURBINE_SIDE_ACTIVE; - BlockIcons h2 = Textures.BlockIcons.STEAM_TURBINE_SIDE_ACTIVE; - try { - Logger.INFO("Trying to patch GT textures to make Turbines animated."); - IIcon aIcon = TexturesGtBlock.Overlay_Machine_Turbine_Active.getIcon(); - //IIcon aOverlay = TexturesGtBlock.Overlay_Machine_Turbine_Active.getOverlayIcon(); - if (ReflectionUtils.setField(h, "mIcon", aIcon)) { - Logger.INFO("Patched Gas Turbine Icon."); - /*if (ReflectionUtils.setField(h, "mOverlay", aOverlay)) { - Logger.INFO("Patched Gas Turbine Overlay Icon."); - }*/ - } - if (ReflectionUtils.setField(h2, "mIcon", aIcon)) { - Logger.INFO("Patched Steam Turbine Icon."); - /*if (ReflectionUtils.setField(h2, "mOverlay", aOverlay)) { - Logger.INFO("Patched Steam Turbine Overlay Icon."); - }*/ + if (ItemUtils.checkForInvalidItems(x.mInputs, x.mOutputs)) { + if (CORE.RA.addAdvancedFreezerRecipe(x.mInputs, y, x.mFluidOutputs, x.mOutputs, x.mChances, x.mDuration, x.mEUt, x.mSpecialValue)) { + mValidCount[2]++; + } } } - catch (Throwable e) { - e.printStackTrace(); + else { + mInvalidCount[2]++; } } + String[] machineName = new String[] {"Centrifuge", "Electrolyzer", "Vacuum Freezer"}; + for (int i=0;i<3;i++) { + Logger.INFO("[Recipe] Generated "+mValidCount[i]+" recipes for the Industrial "+machineName+". The original machine can process "+mOriginalCount[i]+" recipes, meaning "+mInvalidCount[i]+" are invalid for this Multiblock's processing in some way."); + } } protected void dumpGtRecipeMap(final GT_Recipe_Map r) { |