diff options
| author | Jason Mitchell <mitchej@gmail.com> | 2023-01-30 10:56:42 -0800 |
|---|---|---|
| committer | Jason Mitchell <mitchej@gmail.com> | 2023-01-30 10:56:42 -0800 |
| commit | 0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a (patch) | |
| tree | 1e2c649f3a6ce3f6b2babd0098a5f4819e9cd0b6 /src/main/java/gregtech/api/util/GT_ModHandler.java | |
| parent | f8cc82edeb9810c45cba762d733a2c909a302faa (diff) | |
| download | GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.gz GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.tar.bz2 GT5-Unofficial-0d9aab72aa570f13dc3e32e0d32b3f3a95f95e0a.zip | |
[ci skip] spotlessApply with the new settings
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_ModHandler.java')
| -rw-r--r-- | src/main/java/gregtech/api/util/GT_ModHandler.java | 1040 |
1 files changed, 464 insertions, 576 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java index f7bfb13cb2..c5060ff93f 100644 --- a/src/main/java/gregtech/api/util/GT_ModHandler.java +++ b/src/main/java/gregtech/api/util/GT_ModHandler.java @@ -10,28 +10,6 @@ import static gregtech.api.enums.GT_Values.RA; import static gregtech.api.enums.GT_Values.V; import static gregtech.api.enums.GT_Values.W; -import cpw.mods.fml.common.registry.GameRegistry; -import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OreDictNames; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.ToolDictNames; -import gregtech.api.interfaces.IDamagableItem; -import gregtech.api.interfaces.IItemContainer; -import gregtech.api.interfaces.internal.IGT_CraftingRecipe; -import gregtech.api.objects.GT_HashSet; -import gregtech.api.objects.GT_ItemStack; -import gregtech.api.objects.ItemData; -import ic2.api.item.IBoxable; -import ic2.api.item.IC2Items; -import ic2.api.item.IElectricItem; -import ic2.api.reactor.IReactorComponent; -import ic2.api.recipe.IRecipeInput; -import ic2.api.recipe.RecipeInputItemStack; -import ic2.api.recipe.RecipeOutput; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; @@ -44,6 +22,7 @@ import java.util.Map.Entry; import java.util.Objects; import java.util.Set; import java.util.stream.Collectors; + import net.minecraft.block.Block; import net.minecraft.enchantment.Enchantment; import net.minecraft.entity.EntityLivingBase; @@ -69,6 +48,29 @@ import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.oredict.ShapedOreRecipe; import net.minecraftforge.oredict.ShapelessOreRecipe; +import cpw.mods.fml.common.registry.GameRegistry; +import gregtech.api.GregTech_API; +import gregtech.api.enums.ConfigCategories; +import gregtech.api.enums.GT_Values; +import gregtech.api.enums.ItemList; +import gregtech.api.enums.Materials; +import gregtech.api.enums.OreDictNames; +import gregtech.api.enums.OrePrefixes; +import gregtech.api.enums.ToolDictNames; +import gregtech.api.interfaces.IDamagableItem; +import gregtech.api.interfaces.IItemContainer; +import gregtech.api.interfaces.internal.IGT_CraftingRecipe; +import gregtech.api.objects.GT_HashSet; +import gregtech.api.objects.GT_ItemStack; +import gregtech.api.objects.ItemData; +import ic2.api.item.IBoxable; +import ic2.api.item.IC2Items; +import ic2.api.item.IElectricItem; +import ic2.api.reactor.IReactorComponent; +import ic2.api.recipe.IRecipeInput; +import ic2.api.recipe.RecipeInputItemStack; +import ic2.api.recipe.RecipeOutput; + /** * NEVER INCLUDE THIS FILE IN YOUR MOD!!! * <p/> @@ -77,6 +79,7 @@ import net.minecraftforge.oredict.ShapelessOreRecipe; * Due to the many imports, this File can cause compile Problems if not all the APIs are installed */ public class GT_ModHandler { + public static final List<IRecipe> sSingleNonBlockDamagableRecipeList = new ArrayList<>(1000); private static final Map<String, ItemStack> sIC2ItemMap = new HashMap<>(); @@ -103,51 +106,50 @@ public class GT_ModHandler { private static final ItemStack sMt1 = new ItemStack(Blocks.dirt, 1, 0), sMt2 = new ItemStack(Blocks.dirt, 1, 0); private static final String s_H = "h", s_F = "f", s_I = "I", s_P = "P", s_R = "R"; private static final ItemStack[][] sShapes1 = new ItemStack[][] { - {sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null}, - {sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1}, - {null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1}, - {sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null}, - {sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1}, - {sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1}, - {null, null, null, sMt1, null, sMt1, sMt1, null, sMt1}, - {null, sMt1, null, null, sMt1, null, null, sMt2, null}, - {sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null}, - {null, sMt1, null, null, sMt2, null, null, sMt2, null}, - {sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null}, - {null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null}, - {sMt1, sMt1, null, null, sMt2, null, null, sMt2, null}, - {null, sMt1, sMt1, null, sMt2, null, null, sMt2, null}, - {null, sMt1, null, sMt1, null, null, null, sMt1, sMt2}, - {null, sMt1, null, null, null, sMt1, sMt2, sMt1, null}, - {null, sMt1, null, sMt1, null, sMt1, null, null, sMt2}, - {null, sMt1, null, sMt1, null, sMt1, sMt2, null, null}, - {null, sMt2, null, null, sMt1, null, null, sMt1, null}, - {null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1}, - {null, sMt2, null, null, sMt2, null, null, sMt1, null}, - {null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null}, - {null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1}, - {null, sMt2, null, null, sMt2, null, sMt1, sMt1, null}, - {sMt1, null, null, null, sMt2, null, null, null, sMt2}, - {null, null, sMt1, null, sMt2, null, sMt2, null, null}, - {sMt1, null, null, null, sMt2, null, null, null, null}, - {null, null, sMt1, null, sMt2, null, null, null, null}, - {sMt1, sMt2, null, null, null, null, null, null, null}, - {sMt2, sMt1, null, null, null, null, null, null, null}, - {sMt1, null, null, sMt2, null, null, null, null, null}, - {sMt2, null, null, sMt1, null, null, null, null, null}, - {sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null}, - {sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null}, - {null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1}, - {null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1}, - {sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null}, - {sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null}, - {null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1}, - {null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1}, - {sMt1, null, null, null, sMt1, null, null, null, null}, - {null, sMt1, null, sMt1, null, null, null, null, null}, - {sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null}, - {null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2} - }; + { sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1, null }, + { sMt1, null, sMt1, sMt1, null, sMt1, sMt1, sMt1, sMt1 }, + { null, sMt1, null, sMt1, sMt1, sMt1, sMt1, null, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, null, sMt1, null, null, null }, + { sMt1, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, null, sMt1, sMt1, null, sMt1 }, + { null, null, null, sMt1, null, sMt1, sMt1, null, sMt1 }, + { null, sMt1, null, null, sMt1, null, null, sMt2, null }, + { sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, + { null, sMt1, null, null, sMt2, null, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt2, null, null, sMt2, null }, + { null, sMt1, sMt1, null, sMt2, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, null, sMt2, null, null, sMt2, null }, + { null, sMt1, sMt1, null, sMt2, null, null, sMt2, null }, + { null, sMt1, null, sMt1, null, null, null, sMt1, sMt2 }, + { null, sMt1, null, null, null, sMt1, sMt2, sMt1, null }, + { null, sMt1, null, sMt1, null, sMt1, null, null, sMt2 }, + { null, sMt1, null, sMt1, null, sMt1, sMt2, null, null }, + { null, sMt2, null, null, sMt1, null, null, sMt1, null }, + { null, sMt2, null, null, sMt2, null, sMt1, sMt1, sMt1 }, + { null, sMt2, null, null, sMt2, null, null, sMt1, null }, + { null, sMt2, null, sMt1, sMt2, null, sMt1, sMt1, null }, + { null, sMt2, null, null, sMt2, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, null, sMt2, null, sMt1, sMt1, null }, + { sMt1, null, null, null, sMt2, null, null, null, sMt2 }, + { null, null, sMt1, null, sMt2, null, sMt2, null, null }, + { sMt1, null, null, null, sMt2, null, null, null, null }, + { null, null, sMt1, null, sMt2, null, null, null, null }, + { sMt1, sMt2, null, null, null, null, null, null, null }, + { sMt2, sMt1, null, null, null, null, null, null, null }, + { sMt1, null, null, sMt2, null, null, null, null, null }, + { sMt2, null, null, sMt1, null, null, null, null, null }, + { sMt1, sMt1, sMt1, sMt1, sMt1, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt1, sMt2, sMt1, sMt1, null }, + { null, sMt1, sMt1, sMt2, sMt1, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, sMt1, sMt1, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, sMt1, sMt1, sMt1, sMt2, sMt1, null, sMt2, null }, + { sMt1, sMt1, null, sMt1, sMt2, sMt2, sMt1, sMt1, null }, + { null, sMt1, sMt1, sMt2, sMt2, sMt1, null, sMt1, sMt1 }, + { null, sMt2, null, sMt1, sMt2, sMt1, sMt1, sMt1, sMt1 }, + { sMt1, null, null, null, sMt1, null, null, null, null }, + { null, sMt1, null, sMt1, null, null, null, null, null }, + { sMt1, sMt1, null, sMt2, null, sMt1, sMt2, null, null }, + { null, sMt1, sMt1, sMt1, null, sMt2, null, null, sMt2 } }; public static List<Integer> sSingleNonBlockDamagableRecipeList_validsShapes1 = new ArrayList<>(44); public static boolean sSingleNonBlockDamagableRecipeList_validsShapes1_update = false; public static List<Integer> sSingleNonBlockDamagableRecipeList_warntOutput = new ArrayList<>(50); @@ -304,7 +306,9 @@ public class GT_ModHandler { } /** - * @param aValue the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid Mojang... + * @param aValue the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 + * (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it + * properly, stupid Mojang... */ public static ItemStack setFuelValue(ItemStack aStack, short aValue) { aStack.setTagCompound(GT_Utility.getNBTContainingShort(aStack.getTagCompound(), "GT.ItemFuelValue", aValue)); @@ -312,7 +316,9 @@ public class GT_ModHandler { } /** - * @return the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid Mojang... + * @return the Value of this Stack, when burning inside a Furnace (200 = 1 Burn Process = 500 EU, max = 32767 (that + * is 81917.5 EU)), limited to Short because the vanilla Furnace otherwise can't handle it properly, stupid + * Mojang... */ public static int getFuelValue(ItemStack aStack) { return TileEntityFurnace.getItemBurnTime(aStack); @@ -341,19 +347,19 @@ public class GT_ModHandler { public static ItemStack getIC2Item(String aItem, long aAmount, ItemStack aReplacement) { if (GT_Utility.isStringInvalid(aItem) || !GregTech_API.sPreloadStarted) return null; // if (D1) GT_Log.out.println("Requested the Item '" + aItem + "' from the IC2-API"); - if (!sIC2ItemMap.containsKey(aItem)) - try { - ItemStack tStack = IC2Items.getItem(aItem); - sIC2ItemMap.put(aItem, tStack); - if (tStack == null && D1) GT_Log.err.println(aItem + " is not found in the IC2 Items!"); - } catch (Throwable e) { - /*Do nothing*/ - } + if (!sIC2ItemMap.containsKey(aItem)) try { + ItemStack tStack = IC2Items.getItem(aItem); + sIC2ItemMap.put(aItem, tStack); + if (tStack == null && D1) GT_Log.err.println(aItem + " is not found in the IC2 Items!"); + } catch (Throwable e) { + /* Do nothing */ + } return GT_Utility.copyAmount(aAmount, sIC2ItemMap.get(aItem), aReplacement); } /** - * Gets an Item from IndustrialCraft, but the Damage Value can be specified, and returns a Replacement Item with the same Damage if not possible + * Gets an Item from IndustrialCraft, but the Damage Value can be specified, and returns a Replacement Item with the + * same Damage if not possible */ public static ItemStack getIC2Item(String aItem, long aAmount, int aMeta, ItemStack aReplacement) { ItemStack rStack = getIC2Item(aItem, aAmount, aReplacement); @@ -402,7 +408,8 @@ public class GT_ModHandler { } /** - * Gets an Item from the specified mod, but the Damage Value can be specified, and returns a Replacement Item with the same Damage if not possible + * Gets an Item from the specified mod, but the Damage Value can be specified, and returns a Replacement Item with + * the same Damage if not possible */ public static ItemStack getModItem(String aModID, String aItem, long aAmount, int aMeta, ItemStack aReplacement) { ItemStack rStack = getModItem(aModID, aItem, aAmount, aReplacement); @@ -438,11 +445,10 @@ public class GT_ModHandler { public static boolean addValuableOre(Block aBlock, int aMeta, int aValue) { if (aValue <= 0) return false; try { - Class.forName("ic2.core.IC2") - .getMethod("addValuableOre", IRecipeInput.class, int.class) + Class.forName("ic2.core.IC2").getMethod("addValuableOre", IRecipeInput.class, int.class) .invoke(null, new RecipeInputItemStack(new ItemStack(aBlock, 1, aMeta)), aValue); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return true; } @@ -475,7 +481,7 @@ public class GT_ModHandler { GT_Utility.copyOrNull(aOutput), aChance); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return true; } @@ -488,7 +494,7 @@ public class GT_ModHandler { try { ic2.api.recipe.Recipes.recyclerBlacklist.add(new RecipeInputItemStack(aRecycledStack)); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return true; } @@ -513,10 +519,8 @@ public class GT_ModHandler { if (aInput.stackSize == 1 && addSmeltingRecipe(aInput, aOutput)) temp = true; return (RA.addAlloySmelterRecipe( aInput, - OrePrefixes.ingot.contains(aOutput) - ? ItemList.Shape_Mold_Ingot.get(0) - : OrePrefixes.block.contains(aOutput) - ? ItemList.Shape_Mold_Block.get(0) + OrePrefixes.ingot.contains(aOutput) ? ItemList.Shape_Mold_Ingot.get(0) + : OrePrefixes.block.contains(aOutput) ? ItemList.Shape_Mold_Block.get(0) : OrePrefixes.nugget.contains(aOutput) ? ItemList.Shape_Mold_Nugget.get(0) : null, aOutput, 130, @@ -527,24 +531,24 @@ public class GT_ModHandler { /** * LiquidTransposer Recipe for both directions */ - public static boolean addLiquidTransposerRecipe( - ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) { + public static boolean addLiquidTransposerRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, + ItemStack aFullContainer, int aMJ) { return true; } /** * LiquidTransposer Recipe for filling Containers */ - public static boolean addLiquidTransposerFillRecipe( - ItemStack aEmptyContainer, FluidStack aLiquid, ItemStack aFullContainer, int aMJ) { + public static boolean addLiquidTransposerFillRecipe(ItemStack aEmptyContainer, FluidStack aLiquid, + ItemStack aFullContainer, int aMJ) { return true; } /** * LiquidTransposer Recipe for emptying Containers */ - public static boolean addLiquidTransposerEmptyRecipe( - ItemStack aFullContainer, FluidStack aLiquid, ItemStack aEmptyContainer, int aMJ) { + public static boolean addLiquidTransposerEmptyRecipe(ItemStack aFullContainer, FluidStack aLiquid, + ItemStack aEmptyContainer, int aMJ) { return true; } @@ -575,8 +579,8 @@ public class GT_ModHandler { return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, false); } - public static boolean addPulverisationRecipe( - ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance) { + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, + int aChance) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, false); } @@ -584,27 +588,21 @@ public class GT_ModHandler { return addPulverisationRecipe(aInput, aOutput1, null, 0, aOverwrite); } - public static boolean addPulverisationRecipe( - ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, boolean aOverwrite) { + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, + boolean aOverwrite) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, 100, aOverwrite); } - public static boolean addPulverisationRecipe( - ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, boolean aOverwrite) { + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance, + boolean aOverwrite) { return addPulverisationRecipe(aInput, aOutput1, aOutput2, aChance, null, 0, aOverwrite); } /** * Adds Several Pulverizer-Type Recipes. */ - public static boolean addPulverisationRecipe( - ItemStack aInput, - ItemStack aOutput1, - ItemStack aOutput2, - int aChance2, - ItemStack aOutput3, - int aChance3, - boolean aOverwrite) { + public static boolean addPulverisationRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, + ItemStack aOutput3, int aChance3, boolean aOverwrite) { aOutput1 = GT_OreDictUnificator.get(true, aOutput1); aOutput2 = GT_OreDictUnificator.get(true, aOutput2); if (GT_Utility.isStackInvalid(aInput) || GT_Utility.isStackInvalid(aOutput1)) return false; @@ -612,16 +610,16 @@ public class GT_ModHandler { if (GT_Utility.getContainerItem(aInput, false) == null) { RA.addPulveriserRecipe( aInput, - new ItemStack[] {aOutput1, aOutput2, aOutput3}, - new int[] {10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3}, + new ItemStack[] { aOutput1, aOutput2, aOutput3 }, + new int[] { 10000, aChance2 <= 0 ? 1000 : 100 * aChance2, aChance3 <= 0 ? 1000 : 100 * aChance3 }, 400, 2); } return true; } - public static boolean addPulverisationRecipe( - ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray, int aEUt, int aRecipeDurationInTicks) { + public static boolean addPulverisationRecipe(ItemStack aInputItem, ItemStack[] aOutputArray, int[] aChanceArray, + int aEUt, int aRecipeDurationInTicks) { ItemStack[] aUnifiedOutputArray = new ItemStack[aOutputArray.length]; int counter = 0; @@ -636,13 +634,13 @@ public class GT_ModHandler { return true; } - public static boolean addImmersiveEngineeringRecipe( - ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, ItemStack aOutput3, int aChance3) { + public static boolean addImmersiveEngineeringRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, + int aChance2, ItemStack aOutput3, int aChance3) { return true; } - public static boolean addMagneticraftRecipe( - ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, ItemStack aOutput3, int aChance3) { + public static boolean addMagneticraftRecipe(ItemStack aInput, ItemStack aOutput1, ItemStack aOutput2, int aChance2, + ItemStack aOutput3, int aChance3) { return true; } @@ -656,13 +654,8 @@ public class GT_ModHandler { /** * Induction Smelter Recipes and Alloy Smelter Recipes */ - public static boolean addAlloySmelterRecipe( - ItemStack aInput1, - ItemStack aInput2, - ItemStack aOutput1, - int aDuration, - int aEUt, - boolean aAllowSecondaryInputEmpty) { + public static boolean addAlloySmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, int aDuration, + int aEUt, boolean aAllowSecondaryInputEmpty) { if (aInput1 == null || (aInput2 == null && !aAllowSecondaryInputEmpty) || aOutput1 == null) return false; aOutput1 = GT_OreDictUnificator.get(true, aOutput1); return RA.addAlloySmelterRecipe(aInput1, aInput2, aOutput1, aDuration, aEUt); @@ -671,8 +664,8 @@ public class GT_ModHandler { /** * Induction Smelter Recipes for TE */ - public static boolean addInductionSmelterRecipe( - ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, ItemStack aOutput2, int aEnergy, int aChance) { + public static boolean addInductionSmelterRecipe(ItemStack aInput1, ItemStack aInput2, ItemStack aOutput1, + ItemStack aOutput2, int aEnergy, int aChance) { return true; } @@ -689,11 +682,8 @@ public class GT_ModHandler { /** * Adds GT versions of the IC2 recipes from the supplied IC2RecipeList. */ - public static void addIC2RecipesToGT( - Map<IRecipeInput, RecipeOutput> aIC2RecipeList, - GT_Recipe.GT_Recipe_Map aGTRecipeMap, - boolean aAddGTRecipe, - boolean aRemoveIC2Recipe, + public static void addIC2RecipesToGT(Map<IRecipeInput, RecipeOutput> aIC2RecipeList, + GT_Recipe.GT_Recipe_Map aGTRecipeMap, boolean aAddGTRecipe, boolean aRemoveIC2Recipe, boolean aExcludeGTIC2Items) { Map<ItemStack, ItemStack> aRecipesToRemove = new HashMap<>(); for (Entry<IRecipeInput, RecipeOutput> iRecipeInputRecipeOutputEntry : aIC2RecipeList.entrySet()) { @@ -703,11 +693,10 @@ public class GT_ModHandler { if (aAddGTRecipe && (aGTRecipeMap.findRecipe(null, false, Long.MAX_VALUE, null, tStack) == null)) { try { - if (aExcludeGTIC2Items - && ((tStack.getUnlocalizedName().contains("gt.metaitem.01") - || tStack.getUnlocalizedName().contains("gt.blockores") - || tStack.getUnlocalizedName().contains("ic2.itemCrushed") - || tStack.getUnlocalizedName().contains("ic2.itemPurifiedCrushed")))) + if (aExcludeGTIC2Items && ((tStack.getUnlocalizedName().contains("gt.metaitem.01") + || tStack.getUnlocalizedName().contains("gt.blockores") + || tStack.getUnlocalizedName().contains("ic2.itemCrushed") + || tStack.getUnlocalizedName().contains("ic2.itemPurifiedCrushed")))) continue; switch (aGTRecipeMap.mUnlocalizedName) { case "gt.recipe.macerator": @@ -715,16 +704,10 @@ public class GT_ModHandler { case "gt.recipe.compressor": aGTRecipeMap.addRecipe( true, - new ItemStack[] { - GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry - .getKey() - .getAmount(), - tStack) - }, - iRecipeInputRecipeOutputEntry - .getValue() - .items + new ItemStack[] { GT_Utility.copyAmount( + iRecipeInputRecipeOutputEntry.getKey().getAmount(), + tStack) }, + iRecipeInputRecipeOutputEntry.getValue().items .toArray(new ItemStack[0]), null, null, @@ -737,16 +720,10 @@ public class GT_ModHandler { case "gt.recipe.thermalcentrifuge": aGTRecipeMap.addRecipe( true, - new ItemStack[] { - GT_Utility.copyAmount( - iRecipeInputRecipeOutputEntry - .getKey() - .getAmount(), - tStack) - }, - iRecipeInputRecipeOutputEntry - .getValue() - .items + new ItemStack[] { GT_Utility.copyAmount( + iRecipeInputRecipeOutputEntry.getKey().getAmount(), + tStack) }, + iRecipeInputRecipeOutputEntry.getValue().items .toArray(new ItemStack[0]), null, null, @@ -762,12 +739,7 @@ public class GT_ModHandler { } } if (aRemoveIC2Recipe) - aRecipesToRemove.put( - tStack, - iRecipeInputRecipeOutputEntry - .getValue() - .items - .get(0)); + aRecipesToRemove.put(tStack, iRecipeInputRecipeOutputEntry.getValue().items.get(0)); } } } @@ -779,7 +751,7 @@ public class GT_ModHandler { try { return ic2.api.recipe.Recipes.extractor.getRecipes(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return sExtractorRecipes; } @@ -788,7 +760,7 @@ public class GT_ModHandler { try { return ic2.api.recipe.Recipes.compressor.getRecipes(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return sCompressorRecipes; } @@ -797,7 +769,7 @@ public class GT_ModHandler { try { return ic2.api.recipe.Recipes.macerator.getRecipes(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return sMaceratorRecipes; } @@ -806,7 +778,7 @@ public class GT_ModHandler { try { return ic2.api.recipe.Recipes.centrifuge.getRecipes(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return sThermalCentrifugeRecipes; } @@ -815,7 +787,7 @@ public class GT_ModHandler { try { return ic2.api.recipe.Recipes.oreWashing.getRecipes(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return sOreWashingRecipes; } @@ -824,7 +796,7 @@ public class GT_ModHandler { try { return ic2.api.recipe.Recipes.matterAmplifier.getRecipes(); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return sMassfabRecipes; } @@ -936,9 +908,15 @@ public class GT_ModHandler { NBTTagCompound tNBT = new NBTTagCompound(); tNBT.setInteger("amplification", aValue); GT_Utility.callMethod( - ic2.api.recipe.Recipes.matterAmplifier, "addRecipe", false, false, false, aAmplifier, tNBT); + ic2.api.recipe.Recipes.matterAmplifier, + "addRecipe", + false, + false, + false, + aAmplifier, + tNBT); } catch (Throwable e) { - /*Do nothing*/ + /* Do nothing */ } return true; } @@ -950,8 +928,7 @@ public class GT_ModHandler { aResult = GT_OreDictUnificator.get(true, aResult); if (aResult == null || aRecipe == null || aResult.stackSize <= 0) return false; try { - mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine - .getRecipeList() + mods.railcraft.api.crafting.RailcraftCraftingManager.rollingMachine.getRecipeList() .add(new ShapedOreRecipe(GT_Utility.copyOrNull(aResult), aRecipe)); } catch (Throwable e) { return addCraftingRecipe(GT_Utility.copyOrNull(aResult), aRecipe); @@ -974,8 +951,8 @@ public class GT_ModHandler { /** * Shapeless Crafting Recipes. Deletes conflicting Recipes too. */ - public static boolean addCraftingRecipe( - ItemStack aResult, Enchantment[] aEnchantmentsAdded, int[] aEnchantmentLevelsAdded, Object[] aRecipe) { + public static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, + int[] aEnchantmentLevelsAdded, Object[] aRecipe) { return addCraftingRecipe( aResult, aEnchantmentsAdded, @@ -999,25 +976,19 @@ public class GT_ModHandler { /** * Regular Crafting Recipes. Deletes conflicting Recipes too. * <p/> - * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" on them. + * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" + * on them. * <p/> * Enums are automatically getting their "name()"-Method called in order to deliver an OreDict String. * <p/> * Lowercase Letters are reserved for Tools. They are as follows: * <p/> - * 'b' ToolDictNames.craftingToolBlade - * 'c' ToolDictNames.craftingToolCrowbar, - * 'd' ToolDictNames.craftingToolScrewdriver, - * 'f' ToolDictNames.craftingToolFile, - * 'h' ToolDictNames.craftingToolHardHammer, - * 'i' ToolDictNames.craftingToolSolderingIron, - * 'j' ToolDictNames.craftingToolSolderingMetal, - * 'k' ToolDictNames.craftingToolKnive - * 'm' ToolDictNames.craftingToolMortar, - * 'p' ToolDictNames.craftingToolDrawplate, - * 'r' ToolDictNames.craftingToolSoftHammer, - * 's' ToolDictNames.craftingToolSaw, - * 'w' ToolDictNames.craftingToolWrench, + * 'b' ToolDictNames.craftingToolBlade 'c' ToolDictNames.craftingToolCrowbar, 'd' + * ToolDictNames.craftingToolScrewdriver, 'f' ToolDictNames.craftingToolFile, 'h' + * ToolDictNames.craftingToolHardHammer, 'i' ToolDictNames.craftingToolSolderingIron, 'j' + * ToolDictNames.craftingToolSolderingMetal, 'k' ToolDictNames.craftingToolKnive 'm' + * ToolDictNames.craftingToolMortar, 'p' ToolDictNames.craftingToolDrawplate, 'r' + * ToolDictNames.craftingToolSoftHammer, 's' ToolDictNames.craftingToolSaw, 'w' ToolDictNames.craftingToolWrench, * 'x' ToolDictNames.craftingToolWireCutter, */ public static boolean addCraftingRecipe(ItemStack aResult, Object[] aRecipe) { @@ -1027,25 +998,19 @@ public class GT_ModHandler { /** * Regular Crafting Recipes. Deletes conflicting Recipes too. * <p/> - * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" on them. + * You can insert instances of IItemContainer into the Recipe Input Array directly without having to call "get(1)" + * on them. * <p/> * Enums are automatically getting their "name()"-Method called in order to deliver an OreDict String. * <p/> * Lowercase Letters are reserved for Tools. They are as follows: * <p/> - * 'b' ToolDictNames.craftingToolBlade - * 'c' ToolDictNames.craftingToolCrowbar, - * 'd' ToolDictNames.craftingToolScrewdriver, - * 'f' ToolDictNames.craftingToolFile, - * 'h' ToolDictNames.craftingToolHardHammer, - * 'i' ToolDictNames.craftingToolSolderingIron, - * 'j' ToolDictNames.craftingToolSolderingMetal, - * 'k' ToolDictNames.craftingToolKnive - * 'm' ToolDictNames.craftingToolMortar, - * 'p' ToolDictNames.craftingToolDrawplate, - * 'r' ToolDictNames.craftingToolSoftHammer, - * 's' ToolDictNames.craftingToolSaw, - * 'w' ToolDictNames.craftingToolWrench, + * 'b' ToolDictNames.craftingToolBlade 'c' ToolDictNames.craftingToolCrowbar, 'd' + * ToolDictNames.craftingToolScrewdriver, 'f' ToolDictNames.craftingToolFile, 'h' + * ToolDictNames.craftingToolHardHammer, 'i' ToolDictNames.craftingToolSolderingIron, 'j' + * ToolDictNames.craftingToolSolderingMetal, 'k' ToolDictNames.craftingToolKnive 'm' + * ToolDictNames.craftingToolMortar, 'p' ToolDictNames.craftingToolDrawplate, 'r' + * ToolDictNames.craftingToolSoftHammer, 's' ToolDictNames.craftingToolSaw, 'w' ToolDictNames.craftingToolWrench, * 'x' ToolDictNames.craftingToolWireCutter, */ public static boolean addCraftingRecipe(ItemStack aResult, long aBitMask, Object[] aRecipe) { @@ -1072,24 +1037,12 @@ public class GT_ModHandler { /** * Internal realisation of the Crafting Recipe adding Process. */ - private static boolean addCraftingRecipe( - ItemStack aResult, - Enchantment[] aEnchantmentsAdded, - int[] aEnchantmentLevelsAdded, - boolean aMirrored, - boolean aBuffered, - boolean aKeepNBT, - boolean aDismantleable, - boolean aRemovable, - boolean aReversible, - boolean aRemoveAllOthersWithSameOutput, - boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - boolean aRemoveAllOtherShapedsWithSameOutput, - boolean aRemoveAllOtherNativeRecipes, - boolean aCheckForCollisions, - boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, - boolean aOnlyAddIfResultIsNotNull, - Object[] aRecipe) { + private static boolean addCraftingRecipe(ItemStack aResult, Enchantment[] aEnchantmentsAdded, + int[] aEnchantmentLevelsAdded, boolean aMirrored, boolean aBuffered, boolean aKeepNBT, + boolean aDismantleable, boolean aRemovable, boolean aReversible, boolean aRemoveAllOthersWithSameOutput, + boolean aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, boolean aRemoveAllOtherShapedsWithSameOutput, + boolean aRemoveAllOtherNativeRecipes, boolean aCheckForCollisions, + boolean aOnlyAddIfThereIsAnyRecipeOutputtingThis, boolean aOnlyAddIfResultIsNotNull, Object[] aRecipe) { aResult = GT_OreDictUnificator.get(true, aResult); if (aOnlyAddIfResultIsNotNull && aResult == null) return false; if (aResult != null && Items.feather.getDamage(aResult) == W) Items.feather.setDamage(aResult, 0); @@ -1101,11 +1054,11 @@ public class GT_ModHandler { for (byte i = 0; i < aRecipe.length; i++) { if (aRecipe[i] instanceof IItemContainer) aRecipe[i] = ((IItemContainer) aRecipe[i]).get(1); else if (aRecipe[i] instanceof Enum) aRecipe[i] = ((Enum) aRecipe[i]).name(); - else if (!(aRecipe[i] == null - || aRecipe[i] instanceof ItemStack + else if (!(aRecipe[i] == null || aRecipe[i] instanceof ItemStack || aRecipe[i] instanceof ItemData || aRecipe[i] instanceof String - || aRecipe[i] instanceof Character)) aRecipe[i] = aRecipe[i].toString(); + || aRecipe[i] instanceof Character)) + aRecipe[i] = aRecipe[i].toString(); } try { @@ -1199,8 +1152,9 @@ public class GT_ModHandler { for (; idx < aRecipe.length; idx += 2) { if (aRecipe[idx] == null || aRecipe[idx + 1] == null) { if (D1) { - GT_Log.err.println("WARNING: Missing Item for shaped Recipe: " - + (aResult == null ? "null" : aResult.getDisplayName())); + GT_Log.err.println( + "WARNING: Missing Item for shaped Recipe: " + + (aResult == null ? "null" : aResult.getDisplayName())); for (Object tContent : aRecipe) GT_Log.err.println(tContent); } return false; @@ -1281,23 +1235,19 @@ public class GT_ModHandler { if (aResult == null || aResult.stackSize <= 0) return false; - if (aRemoveAllOthersWithSameOutput - || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT + if (aRemoveAllOthersWithSameOutput || aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT || aRemoveAllOtherShapedsWithSameOutput || aRemoveAllOtherNativeRecipes) { - if (tDoWeCareIfThereWasARecipe || !aBuffered) - tThereWasARecipe = removeRecipeByOutput( - aResult, - !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, - aRemoveAllOtherShapedsWithSameOutput, - aRemoveAllOtherNativeRecipes) - || tThereWasARecipe; + if (tDoWeCareIfThereWasARecipe || !aBuffered) tThereWasARecipe = removeRecipeByOutput( + aResult, + !aRemoveAllOthersWithSameOutputIfTheyHaveSameNBT, + aRemoveAllOtherShapedsWithSameOutput, + aRemoveAllOtherNativeRecipes) || tThereWasARecipe; else removeRecipeByOutputDelayed(aResult); } |
