diff options
author | miozune <miozune@gmail.com> | 2023-05-30 18:51:25 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-30 11:51:25 +0200 |
commit | fcaa54247a8d23455bc754434902506904c60df6 (patch) | |
tree | db754e6f83988fdf384ea038f0adc3ce411c2e03 /src/main/java/gtPlusPlus/core/item | |
parent | fdf1ba140c5cf044f22ee9d0598f4090b31a5f95 (diff) | |
download | GT5-Unofficial-fcaa54247a8d23455bc754434902506904c60df6.tar.gz GT5-Unofficial-fcaa54247a8d23455bc754434902506904c60df6.tar.bz2 GT5-Unofficial-fcaa54247a8d23455bc754434902506904c60df6.zip |
Remove recipe removal for rocket fuels (#643)
Diffstat (limited to 'src/main/java/gtPlusPlus/core/item')
-rw-r--r-- | src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java | 182 |
1 files changed, 0 insertions, 182 deletions
diff --git a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java index 5ce3b33cdb..b2f2912687 100644 --- a/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java +++ b/src/main/java/gtPlusPlus/core/item/chemistry/RocketFuels.java @@ -10,15 +10,11 @@ import net.minecraftforge.fluids.Fluid; import net.minecraftforge.fluids.FluidRegistry; import net.minecraftforge.fluids.FluidStack; -import cpw.mods.fml.common.event.FMLLoadCompleteEvent; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; import gregtech.api.util.GTPP_Recipe; -import gregtech.api.util.GT_Recipe; -import gregtech.api.util.GT_Recipe.GT_Recipe_Map; import gregtech.api.util.GT_Utility; import gtPlusPlus.api.objects.Logger; -import gtPlusPlus.api.objects.data.AutoMap; import gtPlusPlus.api.objects.minecraft.ItemPackage; import gtPlusPlus.core.item.base.BaseItemComponent; import gtPlusPlus.core.lib.CORE; @@ -660,182 +656,4 @@ public class RocketFuels extends ItemPackage { null, null); } - - @Override - public boolean onLoadComplete(FMLLoadCompleteEvent event) { - - Logger.INFO("Trying to remove GT recipes for '1,1dimethylhydrazine' && 'rocket_fuel' if they exist."); - - // Try Butcher recipes manually - - // 1,1Dimethylhydrazine - if (FluidRegistry.isFluidRegistered("1,1dimethylhydrazine")) { - Logger.INFO("Making sure all Chemical Reactor recipes for 1,1dimethylhydrazine have been removed."); - AutoMap<GT_Recipe> aToRemoveSingle = new AutoMap<GT_Recipe>(); - ItemStack aUnsymCell = ItemUtils.getItemStackOfAmountFromOreDict("cell1,1Dimethylhydrazine", 1); - FluidStack aUnsymFluid = FluidUtils.getFluidStack("1,1dimethylhydrazine", 1); - recipe: for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sChemicalRecipes.mRecipeList) { - if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) { - if (aRecipeSingleBlock.mOutputs != null && aRecipeSingleBlock.mOutputs.length > 0) { - for (ItemStack aOutputItem : aRecipeSingleBlock.mOutputs) { - ItemStack aTemp = aOutputItem.copy(); - aTemp.stackSize = 1; - if (GT_Utility.areStacksEqual(aTemp, aUnsymCell)) { - aToRemoveSingle.add(aRecipeSingleBlock); - continue recipe; - } - } - } - if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) { - for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) { - if (GT_Utility.areFluidsEqual(aOutput, aUnsymFluid)) { - aToRemoveSingle.add(aRecipeSingleBlock); - continue recipe; - } - } - } - } - } - // Handle Multi Also - AutoMap<GT_Recipe> aToRemoveMulti = new AutoMap<GT_Recipe>(); - recipe: for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList) { - if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) { - if (aRecipeSingleBlock.mOutputs != null && aRecipeSingleBlock.mOutputs.length > 0) { - for (ItemStack aOutputItem : aRecipeSingleBlock.mOutputs) { - ItemStack aTemp = aOutputItem.copy(); - aTemp.stackSize = 1; - if (GT_Utility.areStacksEqual(aTemp, aUnsymCell)) { - aToRemoveMulti.add(aRecipeSingleBlock); - continue recipe; - } - } - } - if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) { - for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) { - if (GT_Utility.areFluidsEqual(aOutput, aUnsymFluid)) { - aToRemoveMulti.add(aRecipeSingleBlock); - continue recipe; - } - } - } - } - } - if (!aToRemoveSingle.isEmpty()) { - Logger.INFO("Found " + aToRemoveSingle.size() + " single block recipes, removing by force."); - for (GT_Recipe remove : aToRemoveSingle) { - GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(remove); - } - } - if (!aToRemoveMulti.isEmpty()) { - Logger.INFO("Found " + aToRemoveSingle.size() + " multiblock recipes, removing by force."); - for (GT_Recipe remove : aToRemoveMulti) { - GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList.remove(remove); - } - } - } - - if (FluidRegistry.isFluidRegistered("rocket_fuel")) { - Logger.INFO("Making sure all Mixer recipes for rocket_fuel have been removed."); - AutoMap<GT_Recipe> aToRemoveSingle = new AutoMap<GT_Recipe>(); - FluidStack aRocketFluid = FluidUtils.getFluidStack("rocket_fuel", 1); - recipe: for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sMixerRecipes.mRecipeList) { - if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) { - if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) { - for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) { - if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) { - aToRemoveSingle.add(aRecipeSingleBlock); - continue recipe; - } - } - } - } - } - if (!aToRemoveSingle.isEmpty()) { - Logger.INFO("Found " + aToRemoveSingle.size() + " recipes, removing by force."); - for (GT_Recipe remove : aToRemoveSingle) { - GT_Recipe_Map.sMixerRecipes.mRecipeList.remove(remove); - } - aToRemoveSingle.clear(); - } - - Logger.INFO("Making sure all Chemical Reactor recipes for rocket_fuel have been removed."); - recipe: for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sChemicalRecipes.mRecipeList) { - if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) { - if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) { - for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) { - if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) { - aToRemoveSingle.add(aRecipeSingleBlock); - continue recipe; - } - } - } - } - } - // Handle Multi Also - AutoMap<GT_Recipe> aToRemoveMulti = new AutoMap<GT_Recipe>(); - recipe: for (GT_Recipe aRecipeSingleBlock : GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList) { - if (aRecipeSingleBlock != null && aRecipeSingleBlock.mEnabled) { - if (aRecipeSingleBlock.mFluidOutputs != null && aRecipeSingleBlock.mFluidOutputs.length > 0) { - for (FluidStack aOutput : aRecipeSingleBlock.mFluidOutputs) { - if (GT_Utility.areFluidsEqual(aOutput, aRocketFluid)) { - aToRemoveMulti.add(aRecipeSingleBlock); - continue recipe; - } - } - } - } - } - if (!aToRemoveSingle.isEmpty()) { - Logger.INFO("Found " + aToRemoveSingle.size() + " single block recipes, removing by force."); - for (GT_Recipe remove : aToRemoveSingle) { - GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(remove); - } - } - if (!aToRemoveMulti.isEmpty()) { - Logger.INFO("Found " + aToRemoveSingle.size() + " multiblock recipes, removing by force."); - for (GT_Recipe remove : aToRemoveMulti) { - GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList.remove(remove); - } - } - } - - Logger.INFO("Finished clean-up of GT Rocket Fuel Recipes."); - return true; - } - - private static GTPP_Recipe getHalfBakedRecipe(ItemStack[] aInputs, FluidStack[] aFluidInputs, int aEU) { - return new GTPP_Recipe(false, aInputs, null, null, null, aFluidInputs, null, 0, aEU, 0); - } - - public static boolean removeRecipe(GT_Recipe aRecipe, GT_Recipe_Map aMap) { - if (aMap != GT_Recipe_Map.sChemicalRecipes) { - GT_Recipe aFoundRecipe = aMap - .findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs); - boolean aSingle = false; - if (aFoundRecipe != null) { - Logger.INFO("Found Single Block Recipe, removing."); - aSingle = aMap.mRecipeList.remove(aFoundRecipe); - Logger.INFO("Success? " + aSingle); - } - return aSingle; - } else { - GT_Recipe aFoundRecipe = aMap - .findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs); - GT_Recipe aFoundRecipe2 = GT_Recipe_Map.sMultiblockChemicalRecipes - .findRecipe(null, false, true, aRecipe.mEUt, aRecipe.mFluidInputs, aRecipe.mInputs); - boolean aSingle = false; - boolean aMulti = false; - if (aFoundRecipe != null) { - Logger.INFO("Found Single Block Recipe, removing."); - aSingle = GT_Recipe_Map.sChemicalRecipes.mRecipeList.remove(aFoundRecipe); - Logger.INFO("Success? " + aSingle); - } - if (aFoundRecipe2 != null) { - Logger.INFO("Found Multiblock Recipe, removing."); - aMulti = GT_Recipe_Map.sMultiblockChemicalRecipes.mRecipeList.remove(aFoundRecipe2); - Logger.INFO("Success? " + aSingle); - } - return aSingle && aMulti; - } - } } |