diff options
Diffstat (limited to 'src/main/java/gregtech/loaders/oreprocessing')
16 files changed, 1011 insertions, 832 deletions
diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingBlock.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingBlock.java index 86630cbe08..c893d75674 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingBlock.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingBlock.java @@ -16,17 +16,19 @@ public class ProcessingBlock implements gregtech.api.interfaces.IOreRecipeRegist public void registerOre( OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { if (aMaterial != Materials.Clay && aMaterial != Materials.Basalt) { - GT_Values.RA.addCutterRecipe( - GT_Utility.copyAmount(1L, aStack), - aMaterial == MaterialsBotania.Livingrock - || aMaterial == MaterialsBotania.Livingwood - || aMaterial == MaterialsBotania.Dreamwood - ? GT_Utility.getIntegratedCircuit(3) - : null, - GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 9L), - null, - (int) Math.max(aMaterial.getMass() * 10L, 1L), - 30); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_Values.RA.addCutterRecipe( + GT_Utility.copyAmount(1L, aStack), + aMaterial == MaterialsBotania.Livingrock + || aMaterial == MaterialsBotania.Livingwood + || aMaterial == MaterialsBotania.Dreamwood + ? GT_Utility.getIntegratedCircuit(3) + : null, + GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 9L), + null, + (int) Math.max(aMaterial.getMass() * 10L, 1L), + 30); + } } ItemStack tStack1 = GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L); @@ -45,14 +47,17 @@ public class ProcessingBlock implements gregtech.api.interfaces.IOreRecipeRegist GT_ModHandler.removeRecipeDelayed( tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3, tStack3); } + if (aMaterial.mStandardMoltenFluid != null) { if (!(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) { - GT_Values.RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Block.get(0L), - aMaterial.getMolten(1296L), - GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L), - 288, - 8); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_Values.RA.addFluidSolidifierRecipe( + ItemList.Shape_Mold_Block.get(0L), + aMaterial.getMolten(1296L), + GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L), + 288, + 8); + } } } if (GregTech_API.sRecipeFile.get( @@ -89,10 +94,15 @@ public class ProcessingBlock implements gregtech.api.interfaces.IOreRecipeRegist if (tStack1 != null) GT_ModHandler.addShapelessCraftingRecipe(tStack1, new Object[] {OrePrefixes.block.get(aMaterial)}); } - if (!OrePrefixes.block.isIgnored(aMaterial)) - GT_ModHandler.addCompressionRecipe( - GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 9L), - GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L)); + + if (!OrePrefixes.block.isIgnored(aMaterial)) { + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCompressionRecipe( + GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 9L), + GT_OreDictUnificator.get(OrePrefixes.block, aMaterial, 1L)); + } + } + switch (aMaterial.mName) { case "Mercury": System.err.println( diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingBolt.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingBolt.java index 17ba07917f..1234d3fc53 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingBolt.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingBolt.java @@ -3,6 +3,7 @@ package gregtech.loaders.oreprocessing; import gregtech.api.enums.Materials; import gregtech.api.enums.OrePrefixes; import gregtech.api.enums.SubTag; +import gregtech.api.enums.Tier; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_Utility; import gregtech.common.GT_Proxy; @@ -16,12 +17,14 @@ public class ProcessingBolt implements gregtech.api.interfaces.IOreRecipeRegistr @Override public void registerOre( OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - if ((aMaterial.mUnificatable) - && (aMaterial.mMaterialInto == aMaterial) - && !aMaterial.contains(SubTag.NO_WORKING)) { - GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(2L, aStack), GT_Proxy.tBits, new Object[] { - "s ", " X", 'X', OrePrefixes.stick.get(aMaterial) - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + if ((aMaterial.mUnificatable) + && (aMaterial.mMaterialInto == aMaterial) + && !aMaterial.contains(SubTag.NO_WORKING)) { + GT_ModHandler.addCraftingRecipe(GT_Utility.copyAmount(2L, aStack), GT_Proxy.tBits, new Object[] { + "s ", " X", 'X', OrePrefixes.stick.get(aMaterial) + }); + } } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java index 7a85572b5b..ae25bcee98 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingFoil.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.GregTech_API; import gregtech.api.enums.GT_Values; import gregtech.api.enums.Materials; @@ -22,7 +24,7 @@ public class ProcessingFoil implements IOreRecipeRegistrator { GT_Utility.copyAmount(1L, GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L)), GT_OreDictUnificator.get(OrePrefixes.foil, aMaterial, 4L), (int) Math.max(aMaterial.getMass(), 1L), - 24); + calculateRecipeEU(aMaterial, 24)); GregTech_API.registerCover( aStack, TextureFactory.of(aMaterial.mIconSet.mTextures[70], aMaterial.mRGBa, false), null); } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingGear.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingGear.java index d05d2188b7..f5f9a1688a 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingGear.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingGear.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -27,7 +29,7 @@ public class ProcessingGear implements gregtech.api.interfaces.IOreRecipeRegistr aMaterial.getMolten(576L), GT_OreDictUnificator.get(aPrefix, aMaterial, 1L), 128, - 8); + calculateRecipeEU(aMaterial, 8)); } if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial) @@ -62,18 +64,20 @@ public class ProcessingGear implements gregtech.api.interfaces.IOreRecipeRegistr }); break; default: - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.gearGt, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "SPS", - "PwP", - "SPS", - 'P', - OrePrefixes.plate.get(aMaterial), - 'S', - OrePrefixes.stick.get(aMaterial) - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.gearGt, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "SPS", + "PwP", + "SPS", + 'P', + OrePrefixes.plate.get(aMaterial), + 'S', + OrePrefixes.stick.get(aMaterial) + }); + } } } break; @@ -85,7 +89,7 @@ public class ProcessingGear implements gregtech.api.interfaces.IOreRecipeRegistr aMaterial.getMolten(144L), GT_Utility.copyAmount(1L, aStack), 16, - 8); + calculateRecipeEU(aMaterial, 8)); } if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial) @@ -104,18 +108,20 @@ public class ProcessingGear implements gregtech.api.interfaces.IOreRecipeRegistr new Object[] {"P ", " f", 'P', OrePrefixes.stoneSmooth}); break; default: - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - " S ", - "hPx", - " S ", - 'S', - OrePrefixes.stick.get(aMaterial), - 'P', - OrePrefixes.plate.get(aMaterial) - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + " S ", + "hPx", + " S ", + 'S', + OrePrefixes.stick.get(aMaterial), + 'P', + OrePrefixes.plate.get(aMaterial) + }); + } } } break; diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java index 411309f396..507a015950 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingGem.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; @@ -54,46 +56,48 @@ public class ProcessingGem GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), - 16); + calculateRecipeEU(aMaterial, 16)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), - 24); + calculateRecipeEU(aMaterial, 24)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(2L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(3L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterialMass * 3L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(4L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterialMass * 4L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(5L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterialMass * 5L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(9L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterialMass * 9L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); } if (aNoWorking) { - GT_Values.RA.addLatheRecipe( - GT_Utility.copyAmount(1L, aStack), - GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), - GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 2L), - (int) Math.max(aMaterialMass, 1L), - 16); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_Values.RA.addLatheRecipe( + GT_Utility.copyAmount(1L, aStack), + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), + GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial, 2L), + (int) Math.max(aMaterialMass, 1L), + calculateRecipeEU(aMaterial, 16)); + } } else { if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial)) { GT_ModHandler.addCraftingRecipe( diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java index 88995c0e0b..bd98e6a162 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingIngot.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.GregTech_API; import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; @@ -42,7 +44,7 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), 32, - 8); + calculateRecipeEU(aMaterial, 8)); } } GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); @@ -71,47 +73,49 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist } if (!aNoSmashing) { - GT_Values.RA.addForgeHammerRecipe( - GT_Utility.copyAmount(3L, aStack), - GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 2L), - (int) Math.max(aMaterialMass, 1L), - 16); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_Values.RA.addForgeHammerRecipe( + GT_Utility.copyAmount(3L, aStack), + GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 2L), + (int) Math.max(aMaterialMass, 1L), + calculateRecipeEU(aMaterial, 16)); + } GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), - 24); + calculateRecipeEU(aMaterial, 24)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(2L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(3L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterialMass * 3L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(4L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterialMass * 4L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(5L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterialMass * 5L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(9L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterialMass * 9L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(1L, aStack), GT_Utility.getIntegratedCircuit(10), GT_OreDictUnificator.get(OrePrefixes.foil, aMaterial, 4L), (int) Math.max(aMaterialMass * 2L, 1L), - 24); + calculateRecipeEU(aMaterial, 24)); } break; @@ -121,19 +125,23 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(2L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), - 96); - if (aSpecialRecipeReq - && GregTech_API.sRecipeFile.get( - ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.ingotDouble, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"I", "I", "h", 'I', OrePrefixes.ingot.get(aMaterial)}); + calculateRecipeEU(aMaterial, 96)); + + // Enable crafting with hammer if tier is < IV. + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + if (aSpecialRecipeReq + && GregTech_API.sRecipeFile.get( + ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.ingotDouble, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"I", "I", "h", 'I', OrePrefixes.ingot.get(aMaterial)}); + } } } break; @@ -143,27 +151,29 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateTriple, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); GT_Values.RA.addBenderRecipe( GT_Utility.copyAmount(3L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterialMass * 3L, 1L), - 96); - if (aSpecialRecipeReq - && GregTech_API.sRecipeFile.get( - ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.ingotTriple, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "I", - "B", - "h", - 'I', - OrePrefixes.ingotDouble.get(aMaterial), - 'B', - OrePrefixes.ingot.get(aMaterial) - }); + calculateRecipeEU(aMaterial, 96)); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + if (aSpecialRecipeReq + && GregTech_API.sRecipeFile.get( + ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.ingotTriple, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "I", + "B", + "h", + 'I', + OrePrefixes.ingotDouble.get(aMaterial), + 'B', + OrePrefixes.ingot.get(aMaterial) + }); + } } } break; @@ -173,22 +183,26 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), - 96); - if (aSpecialRecipeReq - && GregTech_API.sRecipeFile.get( - ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.ingotQuadruple, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "I", - "B", - "h", - 'I', - OrePrefixes.ingotTriple.get(aMaterial), - 'B', - OrePrefixes.ingot.get(aMaterial) - }); + calculateRecipeEU(aMaterial, 96)); + + // If tier < IV add manual crafting. + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + if (aSpecialRecipeReq + && GregTech_API.sRecipeFile.get( + ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.ingotQuadruple, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "I", + "B", + "h", + 'I', + OrePrefixes.ingotTriple.get(aMaterial), + 'B', + OrePrefixes.ingot.get(aMaterial) + }); + } } } break; @@ -198,22 +212,25 @@ public class ProcessingIngot implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuintuple, aMaterial, 1L), (int) Math.max(aMaterialMass, 1L), - 96); - if (aSpecialRecipeReq - && GregTech_API.sRecipeFile.get( - ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.ingotQuintuple, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "I", - "B", - "h", - 'I', - OrePrefixes.ingotQuadruple.get(aMaterial), - 'B', - OrePrefixes.ingot.get(aMaterial) - }); + calculateRecipeEU(aMaterial, 96)); + + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + if (aSpecialRecipeReq + && GregTech_API.sRecipeFile.get( + ConfigCategories.Tools.hammermultiingot, aMaterial.toString(), true)) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.ingotQuintuple, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "I", + "B", + "h", + 'I', + OrePrefixes.ingotQuadruple.get(aMaterial), + 'B', + OrePrefixes.ingot.get(aMaterial) + }); + } } } break; diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java index b1a73e19b5..7e2dfbd439 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingNugget.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -15,10 +17,7 @@ public class ProcessingNugget implements gregtech.api.interfaces.IOreRecipeRegis @Override public void registerOre( OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - if (aMaterial == Materials.Iron) - GT_ModHandler.addSmeltingRecipe( - GT_Utility.copyAmount(1L, aStack), - GT_OreDictUnificator.get(OrePrefixes.nugget, Materials.WroughtIron, 1L)); + GT_Values.RA.addAlloySmelterRecipe( GT_Utility.copyAmount(9L, aStack), aMaterial.contains(SubTag.SMELTING_TO_GEM) @@ -29,7 +28,8 @@ public class ProcessingNugget implements gregtech.api.interfaces.IOreRecipeRegis aMaterial.mSmeltInto, 1L), 200, - 2); + calculateRecipeEU(aMaterial, 2)); + if (aMaterial.mStandardMoltenFluid != null) if (!(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) { GT_Values.RA.addFluidSolidifierRecipe( @@ -37,8 +37,9 @@ public class ProcessingNugget implements gregtech.api.interfaces.IOreRecipeRegis aMaterial.getMolten(16L), GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 1L), 16, - 4); + calculateRecipeEU(aMaterial, 4)); } + GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); GT_RecipeRegistrator.registerReverseMacerating( aStack, aMaterial, aPrefix.mMaterialAmount, null, null, null, false); @@ -48,11 +49,13 @@ public class ProcessingNugget implements gregtech.api.interfaces.IOreRecipeRegis ItemList.Shape_Mold_Nugget.get(0L), GT_Utility.copyAmount(9L, aStack), 100, - 1); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"sI ", 'I', OrePrefixes.ingot.get(aMaterial)}); + calculateRecipeEU(aMaterial, 1)); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.nugget, aMaterial, 9L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"sI ", 'I', OrePrefixes.ingot.get(aMaterial)}); + } } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java index 709a6c36b3..f39e04d61e 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPipe.java @@ -25,137 +25,142 @@ public class ProcessingPipe implements gregtech.api.interfaces.IOreRecipeRegistr @Override public void registerOre( OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - switch (aPrefix) { - case pipeHuge: - case pipeLarge: - case pipeMedium: - case pipeSmall: - case pipeTiny: - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.pipeTiny, aMaterial, 8L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"PPP", "h w", "PPP", 'P', OrePrefixes.plate.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.pipeSmall, aMaterial, 6L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PWP", - "P P", - "PHP", - 'P', - aMaterial == Materials.Wood - ? OrePrefixes.plank.get(aMaterial) - : OrePrefixes.plate.get(aMaterial), - 'H', - aMaterial.contains(SubTag.WOOD) - ? ToolDictNames.craftingToolSoftHammer - : ToolDictNames.craftingToolHardHammer, - 'W', - aMaterial.contains(SubTag.WOOD) - ? ToolDictNames.craftingToolSaw - : ToolDictNames.craftingToolWrench - }); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.pipeMedium, aMaterial, 2L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PPP", - "W H", - "PPP", - 'P', - aMaterial == Materials.Wood - ? OrePrefixes.plank.get(aMaterial) - : OrePrefixes.plate.get(aMaterial), - 'H', - aMaterial.contains(SubTag.WOOD) - ? ToolDictNames.craftingToolSoftHammer - : ToolDictNames.craftingToolHardHammer, - 'W', - aMaterial.contains(SubTag.WOOD) - ? ToolDictNames.craftingToolSaw - : ToolDictNames.craftingToolWrench - }); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.pipeLarge, aMaterial, 1L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PHP", - "P P", - "PWP", - 'P', - aMaterial == Materials.Wood - ? OrePrefixes.plank.get(aMaterial) - : OrePrefixes.plate.get(aMaterial), - 'H', - aMaterial.contains(SubTag.WOOD) - ? ToolDictNames.craftingToolSoftHammer - : ToolDictNames.craftingToolHardHammer, - 'W', - aMaterial.contains(SubTag.WOOD) - ? ToolDictNames.craftingToolSaw - : ToolDictNames.craftingToolWrench - }); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.pipeHuge, aMaterial, 1L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {"DhD", "D D", "DwD", 'D', OrePrefixes.plateDouble.get(aMaterial)}); - break; - case pipeRestrictiveHuge: - case pipeRestrictiveLarge: - case pipeRestrictiveMedium: - case pipeRestrictiveSmall: - case pipeRestrictiveTiny: - gregtech.api.enums.GT_Values.RA.addAssemblerRecipe( - GT_OreDictUnificator.get(aOreDictName.replaceFirst("Restrictive", ""), null, 1L, false, true), - GT_OreDictUnificator.get( - OrePrefixes.ring, - Materials.Steel, - aPrefix.mSecondaryMaterial.mAmount / OrePrefixes.ring.mMaterialAmount), - GT_Utility.copyAmount(1L, aStack), - (int) (aPrefix.mSecondaryMaterial.mAmount * 400L / OrePrefixes.ring.mMaterialAmount), - 4); - break; - case pipeQuadruple: - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PP ", - "PP ", - " ", - 'P', + // These are only generated if a materials tier is < IV. + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + switch (aPrefix) { + case pipeHuge: + case pipeLarge: + case pipeMedium: + case pipeSmall: + case pipeTiny: + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.pipeTiny, aMaterial, 8L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"PPP", "h w", "PPP", 'P', OrePrefixes.plate.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.pipeSmall, aMaterial, 6L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PWP", + "P P", + "PHP", + 'P', + aMaterial == Materials.Wood + ? OrePrefixes.plank.get(aMaterial) + : OrePrefixes.plate.get(aMaterial), + 'H', + aMaterial.contains(SubTag.WOOD) + ? ToolDictNames.craftingToolSoftHammer + : ToolDictNames.craftingToolHardHammer, + 'W', + aMaterial.contains(SubTag.WOOD) + ? ToolDictNames.craftingToolSaw + : ToolDictNames.craftingToolWrench + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.pipeMedium, aMaterial, 2L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PPP", + "W H", + "PPP", + 'P', + aMaterial == Materials.Wood + ? OrePrefixes.plank.get(aMaterial) + : OrePrefixes.plate.get(aMaterial), + 'H', + aMaterial.contains(SubTag.WOOD) + ? ToolDictNames.craftingToolSoftHammer + : ToolDictNames.craftingToolHardHammer, + 'W', + aMaterial.contains(SubTag.WOOD) + ? ToolDictNames.craftingToolSaw + : ToolDictNames.craftingToolWrench + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.pipeLarge, aMaterial, 1L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PHP", + "P P", + "PWP", + 'P', + aMaterial == Materials.Wood + ? OrePrefixes.plank.get(aMaterial) + : OrePrefixes.plate.get(aMaterial), + 'H', + aMaterial.contains(SubTag.WOOD) + ? ToolDictNames.craftingToolSoftHammer + : ToolDictNames.craftingToolHardHammer, + 'W', + aMaterial.contains(SubTag.WOOD) + ? ToolDictNames.craftingToolSaw + : ToolDictNames.craftingToolWrench + }); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.pipeHuge, aMaterial, 1L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {"DhD", "D D", "DwD", 'D', OrePrefixes.plateDouble.get(aMaterial)}); + break; + case pipeRestrictiveHuge: + case pipeRestrictiveLarge: + case pipeRestrictiveMedium: + case pipeRestrictiveSmall: + case pipeRestrictiveTiny: + gregtech.api.enums.GT_Values.RA.addAssemblerRecipe( GT_OreDictUnificator.get( - aOreDictName.replaceFirst("Quadruple", "Medium"), null, 1L, false, true) - }); - gregtech.api.enums.GT_Values.RA.addAssemblerRecipe( - GT_OreDictUnificator.get( - aOreDictName.replaceFirst("Quadruple", "Medium"), null, 4L, false, true), - ItemList.Circuit_Integrated.getWithDamage(0, 4), - GT_Utility.copyAmount(1L, aStack), - 40, - 8); - break; - case pipeNonuple: - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1, aStack), - GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "PPP", - "PPP", - "PPP", - 'P', + aOreDictName.replaceFirst("Restrictive", ""), null, 1L, false, true), GT_OreDictUnificator.get( - aOreDictName.replaceFirst("Nonuple", "Small"), null, 1L, false, true) - }); - gregtech.api.enums.GT_Values.RA.addAssemblerRecipe( - GT_OreDictUnificator.get(aOreDictName.replaceFirst("Nonuple", "Small"), null, 9L, false, true), - ItemList.Circuit_Integrated.getWithDamage(0, 9), - GT_Utility.copyAmount(1L, aStack), - 60, - 8); - break; - default: - break; + OrePrefixes.ring, + Materials.Steel, + aPrefix.mSecondaryMaterial.mAmount / OrePrefixes.ring.mMaterialAmount), + GT_Utility.copyAmount(1L, aStack), + (int) (aPrefix.mSecondaryMaterial.mAmount * 400L / OrePrefixes.ring.mMaterialAmount), + 4); + break; + case pipeQuadruple: + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount(1, aStack), + GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PP ", + "PP ", + " ", + 'P', + GT_OreDictUnificator.get( + aOreDictName.replaceFirst("Quadruple", "Medium"), null, 1L, false, true) + }); + gregtech.api.enums.GT_Values.RA.addAssemblerRecipe( + GT_OreDictUnificator.get( + aOreDictName.replaceFirst("Quadruple", "Medium"), null, 4L, false, true), + ItemList.Circuit_Integrated.getWithDamage(0, 4), + GT_Utility.copyAmount(1L, aStack), + 40, + 8); + break; + case pipeNonuple: + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount(1, aStack), + GT_ModHandler.RecipeBits.REVERSIBLE | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "PPP", + "PPP", + "PPP", + 'P', + GT_OreDictUnificator.get( + aOreDictName.replaceFirst("Nonuple", "Small"), null, 1L, false, true) + }); + gregtech.api.enums.GT_Values.RA.addAssemblerRecipe( + GT_OreDictUnificator.get( + aOreDictName.replaceFirst("Nonuple", "Small"), null, 9L, false, true), + ItemList.Circuit_Integrated.getWithDamage(0, 9), + GT_Utility.copyAmount(1L, aStack), + 60, + 8); + break; + default: + break; + } } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java index c96d49ae46..2ec37ed6e9 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingPlate.java @@ -7,16 +7,11 @@ import static gregtech.api.enums.GT_Values.RA; import static gregtech.api.enums.GT_Values.W; import static gregtech.api.util.GT_ModHandler.RecipeBits.BUFFERED; import static gregtech.api.util.GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; import static gregtech.common.GT_Proxy.tBits; import gregtech.api.GregTech_API; -import gregtech.api.enums.ConfigCategories; -import gregtech.api.enums.ItemList; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; -import gregtech.api.enums.TextureSet; -import gregtech.api.enums.ToolDictNames; +import gregtech.api.enums.*; import gregtech.api.render.TextureFactory; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -100,7 +95,6 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L)); if (aMaterial.mFuelPower > 0) { - RA.addFuel(GT_Utility.copyAmount(1L, aStack), NI, aMaterial.mFuelPower, aMaterial.mFuelType); } @@ -108,7 +102,11 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist && !(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) { RA.addFluidSolidifierRecipe( - ItemList.Shape_Mold_Plate.get(0L), aMaterial.getMolten(L), aMaterial.getPlates(1), 32, 8); + ItemList.Shape_Mold_Plate.get(0L), + aMaterial.getMolten(L), + aMaterial.getPlates(1), + 32, + calculateRecipeEU(aMaterial, 8)); } GT_ModHandler.addCraftingRecipe( @@ -129,61 +127,65 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist if (!aNoSmashing && GregTech_API.sRecipeFile.get(ConfigCategories.Tools.hammerplating, aMaterial.toString(), true)) { - GT_ModHandler.addCraftingRecipe( - aMaterial.getPlates(1), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] { - "h", // craftingToolHardHammer - "X", - "X", - 'X', - OrePrefixes.ingot.get(aMaterial) - }); - - // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false - GT_ModHandler.addCraftingRecipe( - aMaterial.getPlates(1), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] { - "H", // craftingToolForgeHammer - "X", - 'H', - ToolDictNames.craftingToolForgeHammer, - 'X', - OrePrefixes.ingot.get(aMaterial) - }); - - GT_ModHandler.addCraftingRecipe( - aMaterial.getPlates(1), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] { - "h", // craftingToolHardHammer - "X", - 'X', - OrePrefixes.gem.get(aMaterial) - }); - - // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false - GT_ModHandler.addCraftingRecipe( - aMaterial.getPlates(1), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] { - "H", // craftingToolForgeHammer - "X", - 'H', - ToolDictNames.craftingToolForgeHammer, - 'X', - OrePrefixes.gem.get(aMaterial) - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + aMaterial.getPlates(1), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] { + "h", // craftingToolHardHammer + "X", + "X", + 'X', + OrePrefixes.ingot.get(aMaterial) + }); + + // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false + GT_ModHandler.addCraftingRecipe( + aMaterial.getPlates(1), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] { + "H", // craftingToolForgeHammer + "X", + 'H', + ToolDictNames.craftingToolForgeHammer, + 'X', + OrePrefixes.ingot.get(aMaterial) + }); + + GT_ModHandler.addCraftingRecipe( + aMaterial.getPlates(1), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] { + "h", // craftingToolHardHammer + "X", + 'X', + OrePrefixes.gem.get(aMaterial) + }); + + // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false + GT_ModHandler.addCraftingRecipe( + aMaterial.getPlates(1), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] { + "H", // craftingToolForgeHammer + "X", + 'H', + ToolDictNames.craftingToolForgeHammer, + 'X', + OrePrefixes.gem.get(aMaterial) + }); + } } if ((aMaterial.contains(SubTag.MORTAR_GRINDABLE)) && (GregTech_API.sRecipeFile.get(ConfigCategories.Tools.mortar, aMaterial.mName, true))) { - GT_ModHandler.addShapelessCraftingRecipe( - aMaterial.getDust(1), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] {ToolDictNames.craftingToolMortar, OrePrefixes.plate.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + aMaterial.getDust(1), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] {ToolDictNames.craftingToolMortar, OrePrefixes.plate.get(aMaterial)}); + } } } } @@ -201,7 +203,7 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(2L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateQuadruple, aMaterial, 1L), (int) Math.max(aMaterialMass * 2L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); if (GregTech_API.sRecipeFile.get( gregtech.api.enums.ConfigCategories.Tools.hammerdoubleplate, @@ -210,35 +212,39 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist Object aPlateStack = OrePrefixes.plate.get(aMaterial); - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - "I", - "B", - "h", // craftingToolHardHammer - 'I', - aPlateStack, - 'B', - aPlateStack - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + "I", + "B", + "h", // craftingToolHardHammer + 'I', + aPlateStack, + 'B', + aPlateStack + }); + } // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, aPlateStack, aPlateStack - }); + // GT_ModHandler.addShapelessCraftingRecipe( + // GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new + // Object[] { + // gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, aPlateStack, + // aPlateStack + // }); } RA.addBenderRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 2L), GT_Utility.copyAmount(1L, aStack), (int) Math.max(aMaterialMass * 2L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); } else { RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 2L), - gregtech.api.enums.ItemList.Circuit_Integrated.getWithDamage(0L, 2L), + GT_Utility.getIntegratedCircuit(2), Materials.Glue.getFluid(10L), GT_Utility.copyAmount(1L, aStack), 64, @@ -259,46 +265,49 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(3L, aStack), GT_OreDictUnificator.get(OrePrefixes.plateDense, aMaterial, 1L), (int) Math.max(aMaterialMass * 3L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); if (GregTech_API.sRecipeFile.get( gregtech.api.enums.ConfigCategories.Tools.hammertripleplate, OrePrefixes.plate.get(aMaterial).toString(), true)) { - Object aPlateStack = OrePrefixes.plate.get(aMaterial); - - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - "I", - "B", - "h", // craftingToolHardHammer - 'I', - OrePrefixes.plateDouble.get(aMaterial), - 'B', - aPlateStack - }); - - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - aPlateStack, - aPlateStack, - aPlateStack - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + Object aPlateStack = OrePrefixes.plate.get(aMaterial); + + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + "I", + "B", + "h", // craftingToolHardHammer + 'I', + OrePrefixes.plateDouble.get(aMaterial), + 'B', + aPlateStack + }); + + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, + aPlateStack, + aPlateStack, + aPlateStack + }); + } } RA.addBenderRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 3L), GT_Utility.copyAmount(1L, aStack), (int) Math.max(aMaterialMass * 3L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); } else { RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 3L), - gregtech.api.enums.ItemList.Circuit_Integrated.getWithDamage(0L, 3L), + GT_Utility.getIntegratedCircuit(3), Materials.Glue.getFluid(20L), GT_Utility.copyAmount(1L, aStack), 96, @@ -337,40 +346,42 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist OrePrefixes.plate.get(aMaterial).toString(), true)) { - Object aPlateStack = OrePrefixes.plate.get(aMaterial); - - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - "I", - "B", - "h", // craftingToolHardHammer - 'I', - OrePrefixes.plateTriple.get(aMaterial), - 'B', - aPlateStack - }); - - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, - aPlateStack, - aPlateStack, - aPlateStack, - aPlateStack - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + Object aPlateStack = OrePrefixes.plate.get(aMaterial); + + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + "I", + "B", + "h", // craftingToolHardHammer + 'I', + OrePrefixes.plateTriple.get(aMaterial), + 'B', + aPlateStack + }); + + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + gregtech.api.enums.ToolDictNames.craftingToolForgeHammer, + aPlateStack, + aPlateStack, + aPlateStack, + aPlateStack + }); + } } RA.addBenderRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), GT_Utility.copyAmount(1L, aStack), (int) Math.max(aMaterialMass * 4L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); } else { RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L), - gregtech.api.enums.ItemList.Circuit_Integrated.getWithDamage(0L, 4L), + GT_Utility.getIntegratedCircuit(4), Materials.Glue.getFluid(30L), GT_Utility.copyAmount(1L, aStack), 128, @@ -392,35 +403,37 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist OrePrefixes.plate.get(aMaterial).toString(), true)) { - Object aPlateStack = OrePrefixes.plate.get(aMaterial); - - GT_ModHandler.addCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - "I", - "B", - "h", // craftingToolHardHammer - 'I', - OrePrefixes.plateQuadruple.get(aMaterial), - 'B', - aPlateStack - }); - - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { - ToolDictNames.craftingToolForgeHammer, - aPlateStack, - aPlateStack, - aPlateStack, - aPlateStack, - aPlateStack - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + Object aPlateStack = OrePrefixes.plate.get(aMaterial); + + GT_ModHandler.addCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + "I", + "B", + "h", // craftingToolHardHammer + 'I', + OrePrefixes.plateQuadruple.get(aMaterial), + 'B', + aPlateStack + }); + + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), DO_NOT_CHECK_FOR_COLLISIONS | BUFFERED, new Object[] { + ToolDictNames.craftingToolForgeHammer, + aPlateStack, + aPlateStack, + aPlateStack, + aPlateStack, + aPlateStack + }); + } } RA.addBenderRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 5L), GT_Utility.copyAmount(1L, aStack), (int) Math.max(aMaterialMass * 5L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); } else { @@ -447,7 +460,7 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 9L), GT_Utility.copyAmount(1L, aStack), (int) Math.max(aMaterialMass * 9L, 1L), - 96); + calculateRecipeEU(aMaterial, 96)); } } @@ -463,7 +476,7 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist aMaterial.getMolten(L / 2), GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 1L), 16, - 8); + calculateRecipeEU(aMaterial, 8)); } if (aMaterial.mUnificatable @@ -471,18 +484,20 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist && !aNoSmashing && GregTech_API.sRecipeFile.get(ConfigCategories.Tools.hammerplating, aMaterial.toString(), true)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 1L), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] {"h X", 'X', OrePrefixes.plate.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 1L), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] {"h X", 'X', OrePrefixes.plate.get(aMaterial)}); - // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 1L), - tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE - new Object[] { - "H X", 'H', ToolDictNames.craftingToolForgeHammer, 'X', OrePrefixes.plate.get(aMaterial) - }); + // Only added if IC2 Forge Hammer is enabled in Recipes.cfg: B:ic2forgehammer_true=false + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 1L), + tBits, // DO_NOT_CHECK_FOR_COLLISIONS|BUFFERED|ONLY_ADD_IF_RESULT_IS_NOT_NULL|NOT_REMOVABLE + new Object[] { + "H X", 'H', ToolDictNames.craftingToolForgeHammer, 'X', OrePrefixes.plate.get(aMaterial) + }); + } } RA.addAlloySmelterRecipe( @@ -490,21 +505,21 @@ public class ProcessingPlate implements gregtech.api.interfaces.IOreRecipeRegist ItemList.Shape_Mold_Casing.get(0L), GT_Utility.copyAmount(3L, aStack), 128, - 15); + calculateRecipeEU(aMaterial, 15)); RA.addCutterRecipe( GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 2L), NI, (int) Math.max(aMaterial.getMass(), 1L), - 16); + calculateRecipeEU(aMaterial, 16)); RA.addExtruderRecipe( GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), ItemList.Shape_Extruder_Casing.get(0L), GT_OreDictUnificator.get(OrePrefixes.itemCasing, aMaterial, 2L), (int) Math.max(aMaterial.getMass(), 1L), - 45); + calculateRecipeEU(aMaterial, 45)); GT_RecipeRegistrator.registerReverseFluidSmelting(aStack, aMaterial, aPrefix.mMaterialAmount, null); } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingRotor.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingRotor.java index a3151c5bb4..7915b7915a 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingRotor.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingRotor.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -21,52 +23,60 @@ public class ProcessingRotor implements gregtech.api.interfaces.IOreRecipeRegist ItemStack tPlate = GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial, 4L); ItemStack tRing = GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L); if (GT_Utility.isStackValid(tPlate) && GT_Utility.isStackValid(tRing)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), GT_Proxy.tBits, new Object[] { - "PhP", - "SRf", - "PdP", - 'P', - aMaterial == Materials.Wood - ? OrePrefixes.plank.get(aMaterial) - : OrePrefixes.plate.get(aMaterial), - 'R', - OrePrefixes.ring.get(aMaterial), - 'S', - OrePrefixes.screw.get(aMaterial) - }); + + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), GT_Proxy.tBits, new Object[] { + "PhP", + "SRf", + "PdP", + 'P', + aMaterial == Materials.Wood + ? OrePrefixes.plank.get(aMaterial) + : OrePrefixes.plate.get(aMaterial), + 'R', + OrePrefixes.ring.get(aMaterial), + 'S', + OrePrefixes.screw.get(aMaterial) + }); + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] {tPlate.copy(), tRing.copy(), GT_Utility.getIntegratedCircuit(4)}, Materials.Tin.getMolten(32), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), - 240, - 24); + (int) Math.max(aMaterial.getMass(), 1L), + calculateRecipeEU(aMaterial, 24)); + GT_Values.RA.addAssemblerRecipe( new ItemStack[] {tPlate.copy(), tRing.copy(), GT_Utility.getIntegratedCircuit(4)}, Materials.Lead.getMolten(48), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), - 240, - 24); + (int) Math.max(aMaterial.getMass(), 1L), + calculateRecipeEU(aMaterial, 24)); + GT_Values.RA.addAssemblerRecipe( new ItemStack[] {tPlate.copy(), tRing.copy(), GT_Utility.getIntegratedCircuit(4)}, Materials.SolderingAlloy.getMolten(16), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), - 240, - 24); + (int) Math.max(aMaterial.getMass(), 1L), + calculateRecipeEU(aMaterial, 24)); } GT_Values.RA.addExtruderRecipe( GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 5L), ItemList.Shape_Extruder_Rotor.get(0L), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), - 200, - 60); + (int) Math.max(aMaterial.getMass(), 1L), + calculateRecipeEU(aMaterial, 24)); + if (!(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) { GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Rotor.get(0L), aMaterial.getMolten(612L), GT_OreDictUnificator.get(OrePrefixes.rotor, aMaterial, 1L), - 100, - 60); + (int) Math.max(aMaterial.getMass(), 1L), + calculateRecipeEU(aMaterial, 24)); } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingScrew.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingScrew.java index f89451fbe0..eefad6af6b 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingScrew.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingScrew.java @@ -1,9 +1,8 @@ package gregtech.loaders.oreprocessing; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + +import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -24,12 +23,14 @@ public class ProcessingScrew implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(1L, aStack), null, (int) Math.max(aMaterial.getMass() / 8L, 1L), - 4); + calculateRecipeEU(aMaterial, 4)); if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial)) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"fX", "X ", 'X', OrePrefixes.bolt.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"fX", "X ", 'X', OrePrefixes.bolt.get(aMaterial)}); + } } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java index bf50836627..09f3936aad 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingShaping.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -24,6 +26,7 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi int tAmount = (int) (aPrefix.mMaterialAmount / 3628800L); if ((tAmount > 0) && (tAmount <= 64) && (aPrefix.mMaterialAmount % 3628800L == 0L)) { int tVoltageMultiplier = aMaterial.mBlastFurnaceTemp >= 2800 ? 60 : 15; + int tTrueVoltage = aMaterial.getProcessingMaterialTierEU(); if (aMaterial.contains(SubTag.NO_SMASHING)) { tVoltageMultiplier /= 4; @@ -37,13 +40,17 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi ItemList.Shape_Extruder_Block.get(0L), GT_OreDictUnificator.get(OrePrefixes.block, aMaterial.mSmeltInto, tAmount), 10 * tAmount, - 8 * tVoltageMultiplier); - GT_Values.RA.addAlloySmelterRecipe( - GT_Utility.copyAmount(9L, aStack), - ItemList.Shape_Mold_Block.get(0L), - GT_OreDictUnificator.get(OrePrefixes.block, aMaterial.mSmeltInto, tAmount), - 5 * tAmount, - 4 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); + + // Allow creation of alloy smelter recipes for material recycling if < IV tier. + if (tTrueVoltage < Tier.IV) { + GT_Values.RA.addAlloySmelterRecipe( + GT_Utility.copyAmount(9L, aStack), + ItemList.Shape_Mold_Block.get(0L), + GT_OreDictUnificator.get(OrePrefixes.block, aMaterial.mSmeltInto, tAmount), + 5 * tAmount, + calculateRecipeEU(aMaterial, 4 * tVoltageMultiplier)); + } } if (((aPrefix != OrePrefixes.ingot) || (aMaterial != aMaterial.mSmeltInto))) { GT_Values.RA.addExtruderRecipe( @@ -51,7 +58,7 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi ItemList.Shape_Extruder_Ingot.get(0L), GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial.mSmeltInto, tAmount), 10, - 4 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 4 * tVoltageMultiplier)); } GT_Values.RA.addExtruderRecipe( @@ -59,26 +66,29 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi ItemList.Shape_Extruder_Pipe_Tiny.get(0L), GT_OreDictUnificator.get(OrePrefixes.pipeTiny, aMaterial.mSmeltInto, tAmount * 2), 4 * tAmount, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); + if (!(aMaterial == Materials.Redstone || aMaterial == Materials.Glowstone)) { GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Pipe_Small.get(0L), GT_OreDictUnificator.get(OrePrefixes.pipeSmall, aMaterial.mSmeltInto, tAmount), 8 * tAmount, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); + GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(3L, aStack), ItemList.Shape_Extruder_Pipe_Medium.get(0L), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, aMaterial.mSmeltInto, tAmount), 24 * tAmount, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); + GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(6L, aStack), ItemList.Shape_Extruder_Pipe_Large.get(0L), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, aMaterial.mSmeltInto, tAmount), 48 * tAmount, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); } GT_Values.RA.addExtruderRecipe( @@ -86,98 +96,99 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi ItemList.Shape_Extruder_Pipe_Huge.get(0L), GT_OreDictUnificator.get(OrePrefixes.pipeHuge, aMaterial.mSmeltInto, tAmount), 96 * tAmount, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Plate.get(0L), GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial.mSmeltInto, tAmount), - (int) Math.max(aMaterialMass * 1L * tAmount, tAmount), - 8 * tVoltageMultiplier); + (int) Math.max(aMaterialMass * tAmount, tAmount), + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), ItemList.Shape_Extruder_Small_Gear.get(0L), GT_OreDictUnificator.get(OrePrefixes.gearGtSmall, aMaterial.mSmeltInto, tAmount), - (int) Math.max(aMaterialMass * 1L * tAmount, tAmount), - 8 * tVoltageMultiplier); + (int) Math.max(aMaterialMass * tAmount, tAmount), + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(6L, aStack), ItemList.Shape_Extruder_Turbine_Blade.get(0L), GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial.mSmeltInto, tAmount), - (int) Math.max(aMaterialMass * 1L * tAmount, tAmount), - 8 * tVoltageMultiplier); + (int) Math.max(aMaterialMass * tAmount, tAmount), + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); + if (!(aMaterial == Materials.AnnealedCopper || aMaterial == Materials.WroughtIron)) { GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Ring.get(0L), aMaterial.getMolten(36L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), 100, - 4 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 4 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Screw.get(0L), aMaterial.getMolten(18L), GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 1L), 50, - 2 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Rod.get(0L), aMaterial.getMolten(72L), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), 150, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Bolt.get(0L), aMaterial.getMolten(18L), GT_OreDictUnificator.get(OrePrefixes.bolt, aMaterial, 1L), 50, - 2 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Round.get(0L), aMaterial.getMolten(18L), GT_OreDictUnificator.get(OrePrefixes.round, aMaterial, 1L), 50, - 2 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Rod_Long.get(0L), aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L), 300, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Turbine_Blade.get(0L), aMaterial.getMolten(864L), GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 1L), 400, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Pipe_Tiny.get(0L), aMaterial.getMolten(72L), GT_OreDictUnificator.get(OrePrefixes.pipeTiny, aMaterial, 1L), 20, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Pipe_Small.get(0L), aMaterial.getMolten(144L), GT_OreDictUnificator.get(OrePrefixes.pipeSmall, aMaterial, 1L), 40, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Pipe_Medium.get(0L), aMaterial.getMolten(432L), GT_OreDictUnificator.get(OrePrefixes.pipeMedium, aMaterial, 1L), 80, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Pipe_Large.get(0L), aMaterial.getMolten(864L), GT_OreDictUnificator.get(OrePrefixes.pipeLarge, aMaterial, 1L), 160, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addFluidSolidifierRecipe( ItemList.Shape_Mold_Pipe_Huge.get(0L), aMaterial.getMolten(1728L), GT_OreDictUnificator.get(OrePrefixes.pipeHuge, aMaterial, 1L), 320, - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); } if (tAmount * 2 <= 64) { if (!(aMaterial == Materials.Aluminium)) { @@ -186,14 +197,14 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi ItemList.Shape_Extruder_Rod.get(0L), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mSmeltInto, tAmount * 2), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 6 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 6 * tVoltageMultiplier)); } else { GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Rod.get(0L), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mSmeltInto, tAmount * 2), 200, - 2 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); } } if (tAmount * 2 <= 64) @@ -202,105 +213,120 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi ItemList.Shape_Extruder_Wire.get(0L), GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial.mSmeltInto, tAmount * 2), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 6 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 6 * tVoltageMultiplier)); if (tAmount * 8 <= 64) GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Bolt.get(0L), GT_OreDictUnificator.get(OrePrefixes.bolt, aMaterial.mSmeltInto, tAmount * 8), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); if (tAmount * 4 <= 64) { GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Ring.get(0L), GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial.mSmeltInto, tAmount * 4), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 6 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 6 * tVoltageMultiplier)); if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial) && !aMaterial.contains(SubTag.NO_SMASHING)) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"h ", "fX", 'X', OrePrefixes.stick.get(aMaterial)}); + + // If material tier < IV then add manual recipe. + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.ring, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"h ", "fX", 'X', OrePrefixes.stick.get(aMaterial)}); + } } + GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(2L, new Object[] {aStack}), + GT_Utility.copyAmount(2L, aStack), ItemList.Shape_Extruder_Sword.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(3L, new Object[] {aStack}), + GT_Utility.copyAmount(3L, aStack), ItemList.Shape_Extruder_Pickaxe.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 3L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(1L, new Object[] {aStack}), + GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Shovel.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadShovel, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 1L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(3L, new Object[] {aStack}), + GT_Utility.copyAmount(3L, aStack), ItemList.Shape_Extruder_Axe.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadAxe, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 3L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(2L, new Object[] {aStack}), + GT_Utility.copyAmount(2L, aStack), ItemList.Shape_Extruder_Hoe.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(6L, new Object[] {aStack}), + GT_Utility.copyAmount(6L, aStack), ItemList.Shape_Extruder_Hammer.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadHammer, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 6L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(2L, new Object[] {aStack}), + GT_Utility.copyAmount(2L, aStack), ItemList.Shape_Extruder_File.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadFile, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(2L, new Object[] {aStack}), + GT_Utility.copyAmount(2L, aStack), ItemList.Shape_Extruder_Saw.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); GT_Values.RA.addExtruderRecipe( - GT_Utility.copyAmount(4L, new Object[] {aStack}), + GT_Utility.copyAmount(4L, aStack), ItemList.Shape_Extruder_Gear.get(0L, new Object[0]), GT_OreDictUnificator.get(OrePrefixes.gearGt, aMaterial.mSmeltInto, tAmount), (int) Math.max(aMaterialMass * 5L * tAmount, tAmount), - 8 * tVoltageMultiplier); + calculateRecipeEU(aMaterial, 8 * tVoltageMultiplier)); if (!(aMaterial == Materials.StyreneButadieneRubber || aMaterial == Materials.Silicone)) { - GT_Values.RA.addAlloySmelterRecipe( - GT_Utility.copyAmount(2L, aStack), - ItemList.Shape_Mold_Plate.get(0L), - GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial.mSmeltInto, tAmount), - (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 2 * tVoltageMultiplier); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_Values.RA.addAlloySmelterRecipe( + GT_Utility.copyAmount(2L, aStack), + ItemList.Shape_Mold_Plate.get(0L), + GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial.mSmeltInto, tAmount), + (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); + } } else { + // If tier < IV then add ability to turn ingots into plates via alloy smelter. + if (tTrueVoltage < Tier.IV) { + GT_Values.RA.addAlloySmelterRecipe( + GT_Utility.copyAmount(1L, aStack), + ItemList.Shape_Mold_Plate.get(0L), + GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial.mSmeltInto, tAmount), + (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); + } + } + + // If tier < IV then add ability to turn ingots into gears via alloy smelter. + if (tTrueVoltage < Tier.IV) { GT_Values.RA.addAlloySmelterRecipe( - GT_Utility.copyAmount(1L, aStack), - ItemList.Shape_Mold_Plate.get(0L), - GT_OreDictUnificator.get(OrePrefixes.plate, aMaterial.mSmeltInto, tAmount), - (int) Math.max(aMaterialMass * 2L * tAmount, tAmount), - 2 * tVoltageMultiplier); + GT_Utility.copyAmount(8L, aStack), + ItemList.Shape_Mold_Gear.get(0L), + GT_OreDictUnificator.get(OrePrefixes.gearGt, aMaterial.mSmeltInto, tAmount), + (int) Math.max(aMaterialMass * 10L * tAmount, tAmount), + calculateRecipeEU(aMaterial, 2 * tVoltageMultiplier)); } - GT_Values.RA.addAlloySmelterRecipe( - GT_Utility.copyAmount(8L, aStack), - ItemList.Shape_Mold_Gear.get(0L), - GT_OreDictUnificator.get(OrePrefixes.gearGt, aMaterial.mSmeltInto, tAmount), - (int) Math.max(aMaterialMass * 10L * tAmount, tAmount), - 2 * tVoltageMultiplier); + switch (aMaterial.mSmeltInto.mName) { case "Glass": GT_Values.RA.addExtruderRecipe( @@ -455,7 +481,7 @@ public class ProcessingShaping implements gregtech.api.interfaces.IOreRecipeRegi tAmount * 128, 1 * tVoltageMultiplier); break; - case "Polytetrafluoroethylene": + case "Polytetrafluoroethylene": // Recipe for cells from PTFE, why is it here? GT_Values.RA.addExtruderRecipe( GT_Utility.copyAmount(1L, aStack), ItemList.Shape_Extruder_Cell.get(0L), diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java index 8f710a509a..a24a1b7866 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStick.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -15,10 +17,12 @@ public class ProcessingStick implements gregtech.api.interfaces.IOreRecipeRegist @Override public void registerOre( OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.springSmall, aMaterial, 1L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {" s ", "fPx", 'P', OrePrefixes.stick.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.springSmall, aMaterial, 1L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {" s ", "fPx", 'P', OrePrefixes.stick.get(aMaterial)}); + } if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_WORKING)) { GT_Values.RA.addLatheRecipe( aMaterial.contains(SubTag.CRYSTAL) @@ -27,22 +31,24 @@ public class ProcessingStick implements gregtech.api.interfaces.IOreRecipeRegist GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), GT_OreDictUnificator.get(OrePrefixes.dustSmall, aMaterial.mMacerateInto, 2L), (int) Math.max(aMaterial.getMass() * 5L, 1L), - 16); + calculateRecipeEU(aMaterial, 16)); GT_Values.RA.addCutterRecipe( GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.bolt, aMaterial, 4L), null, (int) Math.max(aMaterial.getMass() * 2L, 1L), - 4); + calculateRecipeEU(aMaterial, 4)); if ((aMaterial.mUnificatable) && (aMaterial.mMaterialInto == aMaterial)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 2L), - GT_Proxy.tBits, - new Object[] {"s", "X", 'X', OrePrefixes.stickLong.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"f ", " X", 'X', OrePrefixes.ingot.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 2L), + GT_Proxy.tBits, + new Object[] {"s", "X", 'X', OrePrefixes.stickLong.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"f ", " X", 'X', OrePrefixes.ingot.get(aMaterial)}); + } } } if (!aMaterial.contains(gregtech.api.enums.SubTag.NO_SMASHING)) { @@ -50,16 +56,16 @@ public class ProcessingStick implements gregtech.api.interfaces.IOreRecipeRegist GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.springSmall, aMaterial, 2L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addForgeHammerRecipe( GT_Utility.copyAmount(2L, aStack), GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L), (int) Math.max(aMaterial.getMass(), 1L), - 16); + calculateRecipeEU(aMaterial, 16)); } GT_Values.RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.stick, Materials.Wood, 1), - ItemList.Circuit_Integrated.getWithDamage(0L, 2L), + GT_Utility.getIntegratedCircuit(2), Materials.SeedOil.getFluid(50L), ItemList.FR_Stick.get(1L), 16, diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStickLong.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStickLong.java index ca8ae1c31e..a3362ede85 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingStickLong.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingStickLong.java @@ -1,9 +1,8 @@ package gregtech.loaders.oreprocessing; -import gregtech.api.enums.GT_Values; -import gregtech.api.enums.Materials; -import gregtech.api.enums.OrePrefixes; -import gregtech.api.enums.SubTag; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + +import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; import gregtech.api.util.GT_Utility; @@ -18,26 +17,30 @@ public class ProcessingStickLong implements gregtech.api.interfaces.IOreRecipeRe @Override public void registerOre( OrePrefixes aPrefix, Materials aMaterial, String aOreDictName, String aModName, ItemStack aStack) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.spring, aMaterial, 1L), - GT_ModHandler.RecipeBits.BUFFERED, - new Object[] {" s ", "fSx", " S ", 'S', OrePrefixes.stickLong.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.spring, aMaterial, 1L), + GT_ModHandler.RecipeBits.BUFFERED, + new Object[] {" s ", "fSx", " S ", 'S', OrePrefixes.stickLong.get(aMaterial)}); + } if (!aMaterial.contains(SubTag.NO_WORKING)) { GT_Values.RA.addCutterRecipe( GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 2L), null, (int) Math.max(aMaterial.getMass(), 1L), - 4); + calculateRecipeEU(aMaterial, 4)); if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial)) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"sf", "G ", 'G', OrePrefixes.gemFlawless.get(aMaterial)}); - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 2L), - GT_Proxy.tBits, - new Object[] {"sf", "G ", 'G', OrePrefixes.gemExquisite.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"sf", "G ", 'G', OrePrefixes.gemFlawless.get(aMaterial)}); + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 2L), + GT_Proxy.tBits, + new Object[] {"sf", "G ", 'G', OrePrefixes.gemExquisite.get(aMaterial)}); + } } } if (!aMaterial.contains(SubTag.NO_SMASHING)) { @@ -45,12 +48,14 @@ public class ProcessingStickLong implements gregtech.api.interfaces.IOreRecipeRe GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.spring, aMaterial, 1L), 200, - 16); + calculateRecipeEU(aMaterial, 16)); if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial)) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"ShS", 'S', OrePrefixes.stick.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.stickLong, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"ShS", 'S', OrePrefixes.stick.get(aMaterial)}); + } } } } diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java index b016e10009..867c528e46 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingToolHead.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import gregtech.api.enums.*; import gregtech.api.util.GT_ModHandler; import gregtech.api.util.GT_OreDictUnificator; @@ -591,7 +593,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_LV, 1, aMaterial, Materials.Steel, new long[] { - 100000L, 32L, 1L, -1L + 100_000L, 32L, 1L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -616,7 +618,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_LV, 1, aMaterial, Materials.Steel, new long[] { - 75000L, 32L, 1L, -1L + 75_000L, 32L, 1L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -641,7 +643,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_LV, 1, aMaterial, Materials.Steel, new long[] { - 50000L, 32L, 1L, -1L + 50_000L, 32L, 1L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -666,7 +668,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_MV, 1, aMaterial, Materials.Aluminium, new long[] { - 400000L, 128L, 2L, -1L + 400_000L, 128L, 2L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -691,7 +693,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_MV, 1, aMaterial, Materials.Aluminium, new long[] { - 300000L, 128L, 2L, -1L + 300_000L, 128L, 2L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -716,7 +718,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_MV, 1, aMaterial, Materials.Aluminium, new long[] { - 200000L, 128L, 2L, -1L + 200_000L, 128L, 2L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -741,7 +743,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_HV, 1, aMaterial, Materials.StainlessSteel, new long[] { - 1600000L, 512L, 3L, -1L + 1_600_000L, 512L, 3L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -766,7 +768,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_HV, 1, aMaterial, Materials.StainlessSteel, new long[] { - 1200000L, 512L, 3L, -1L + 1_200_000L, 512L, 3L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -791,7 +793,7 @@ public class ProcessingToolHead GT_ModHandler.addCraftingRecipe( GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.DRILL_HV, 1, aMaterial, Materials.StainlessSteel, new long[] { - 800000L, 512L, 3L, -1L + 800_000L, 512L, 3L, -1L }), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS @@ -819,7 +821,7 @@ public class ProcessingToolHead 1, aMaterial, Materials.StainlessSteel, - new long[] {1600000L, 512L, 3L, -1L}), + new long[] {1_600_000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, @@ -846,7 +848,7 @@ public class ProcessingToolHead 1, aMaterial, Materials.StainlessSteel, - new long[] {1200000L, 512L, 3L, -1L}), + new long[] {1_200_000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, @@ -873,7 +875,7 @@ public class ProcessingToolHead 1, aMaterial, Materials.StainlessSteel, - new long[] {800000L, 512L, 3L, -1L}), + new long[] {800_000L, 512L, 3L, -1L}), GT_ModHandler.RecipeBits.DISMANTLEABLE | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS | GT_ModHandler.RecipeBits.BUFFERED, @@ -913,7 +915,7 @@ public class ProcessingToolHead aMaterial.getMolten(144 * 4), GT_OreDictUnificator.get(OrePrefixes.toolHeadDrill, aMaterial, 1L), 5 * 20, - (int) GT_Values.VP[2]); + calculateRecipeEU(aMaterial, (int) GT_Values.VP[2])); } if (aMaterial.getIngots(1) != null) { GT_Values.RA.addExtruderRecipe( @@ -921,15 +923,42 @@ public class ProcessingToolHead ItemList.Shape_Extruder_ToolHeadDrill.get(0), GT_OreDictUnificator.get(OrePrefixes.toolHeadDrill, aMaterial, 1L), 5 * 20, - (int) GT_Values.VP[2]); + calculateRecipeEU(aMaterial, (int) GT_Values.VP[2])); } } break; case toolHeadFile: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.FILE, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.FILE, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + + if ((!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.BOUNCY))) { + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.FILE, + 1, + aMaterial, + aMaterial.mHandleMaterial, + null), + GT_ModHandler.RecipeBits.MIRRORED + | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS + | GT_ModHandler.RecipeBits.BUFFERED, + new Object[] { + "P", + "P", + "S", + 'P', + OrePrefixes.plate.get(aMaterial), + 'S', + OrePrefixes.stick.get(aMaterial.mHandleMaterial) + }); + } + } + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -940,30 +969,16 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.FILE, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, - 120); - if ((!aMaterial.contains(SubTag.NO_SMASHING)) && (!aMaterial.contains(SubTag.BOUNCY))) { - GT_ModHandler.addCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.FILE, 1, aMaterial, aMaterial.mHandleMaterial, null), - GT_ModHandler.RecipeBits.MIRRORED - | GT_ModHandler.RecipeBits.DO_NOT_CHECK_FOR_COLLISIONS - | GT_ModHandler.RecipeBits.BUFFERED, - new Object[] { - "P", - "P", - "S", - 'P', - OrePrefixes.plate.get(aMaterial), - 'S', - OrePrefixes.stick.get(aMaterial.mHandleMaterial) - }); - } + calculateRecipeEU(aMaterial, 120)); + break; case toolHeadHoe: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.HOE, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.HOE, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + } GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -974,7 +989,7 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.HOE, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, - 120); + calculateRecipeEU(aMaterial, 120)); if (aSpecialRecipeReq1) GT_ModHandler.addCraftingRecipe( GT_OreDictUnificator.get(OrePrefixes.toolHeadHoe, aMaterial, 1L), @@ -994,10 +1009,33 @@ public class ProcessingToolHead new Object[] {"GG ", "f ", " ", 'G', OrePrefixes.gem.get(aMaterial)}); break; case toolHeadPickaxe: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.PICKAXE, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.PICKAXE, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + + if (aSpecialRecipeReq1) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "PII", + "f h", + 'P', + OrePrefixes.plate.get(aMaterial), + 'I', + OrePrefixes.ingot.get(aMaterial) + }); + + if (!aNoWorking) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"GGG", "f ", 'G', OrePrefixes.gem.get(aMaterial)}); + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -1009,29 +1047,29 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.PICKAXE, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, 120); - if (aSpecialRecipeReq1) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "PII", - "f h", - 'P', - OrePrefixes.plate.get(aMaterial), - 'I', - OrePrefixes.ingot.get(aMaterial) - }); - if (!aNoWorking) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadPickaxe, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"GGG", "f ", 'G', OrePrefixes.gem.get(aMaterial)}); + break; case toolHeadPlow: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.PLOW, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.PLOW, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + + if (aSpecialRecipeReq1) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"PP", "PP", "hf", 'P', OrePrefixes.plate.get(aMaterial)}); + + if (!aNoWorking) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"GG", "GG", " f", 'G', OrePrefixes.gem.get(aMaterial)}); + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -1042,23 +1080,37 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.PLOW, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, - 120); - if (aSpecialRecipeReq1) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"PP", "PP", "hf", 'P', OrePrefixes.plate.get(aMaterial)}); - if (!aNoWorking) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadPlow, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"GG", "GG", " f", 'G', OrePrefixes.gem.get(aMaterial)}); + calculateRecipeEU(aMaterial, 120)); + break; case toolHeadSaw: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SAW, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SAW, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + + if (aSpecialRecipeReq1) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "PP ", + "fh ", + 'P', + OrePrefixes.plate.get(aMaterial), + 'I', + OrePrefixes.ingot.get(aMaterial) + }); + + if (!aNoWorking) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"GGf", 'G', OrePrefixes.gem.get(aMaterial)}); + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -1069,30 +1121,37 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SAW, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, - 120); - if (aSpecialRecipeReq1) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "PP ", - "fh ", - 'P', - OrePrefixes.plate.get(aMaterial), - 'I', - OrePrefixes.ingot.get(aMaterial) - }); - if (!aNoWorking) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadSaw, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"GGf", 'G', OrePrefixes.gem.get(aMaterial)}); + calculateRecipeEU(aMaterial, 120)); + break; case toolHeadSense: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SENSE, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SENSE, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + + if (aSpecialRecipeReq1) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "PPI", + "hf ", + 'P', + OrePrefixes.plate.get(aMaterial), + 'I', + OrePrefixes.ingot.get(aMaterial) + }); + + if (!aNoWorking) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"GGG", " f ", " ", 'G', OrePrefixes.gem.get(aMaterial)}); + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -1103,24 +1162,8 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SENSE, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, - 120); - if (aSpecialRecipeReq1) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "PPI", - "hf ", - 'P', - OrePrefixes.plate.get(aMaterial), - 'I', - OrePrefixes.ingot.get(aMaterial) - }); - if (!aNoWorking) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadSense, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"GGG", " f ", " ", 'G', OrePrefixes.gem.get(aMaterial)}); + calculateRecipeEU(aMaterial, 120)); + break; case toolHeadShovel: GT_ModHandler.addShapelessCraftingRecipe( @@ -1152,10 +1195,33 @@ public class ProcessingToolHead new Object[] {"fG", 'G', OrePrefixes.gem.get(aMaterial)}); break; case toolHeadSword: - GT_ModHandler.addShapelessCraftingRecipe( - GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( - GT_MetaGenerated_Tool_01.SWORD, 1, aMaterial, aMaterial.mHandleMaterial, null), - new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + + GT_ModHandler.addShapelessCraftingRecipe( + GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( + GT_MetaGenerated_Tool_01.SWORD, 1, aMaterial, aMaterial.mHandleMaterial, null), + new Object[] {aOreDictName, OrePrefixes.stick.get(aMaterial.mHandleMaterial)}); + + if (aSpecialRecipeReq1) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + " P ", + "fPh", + 'P', + OrePrefixes.plate.get(aMaterial), + 'I', + OrePrefixes.ingot.get(aMaterial) + }); + + if (!aNoWorking) + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {" G", "fG", 'G', OrePrefixes.gem.get(aMaterial)}); + } + GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial.mHandleMaterial, 1L), @@ -1166,24 +1232,7 @@ public class ProcessingToolHead GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats( GT_MetaGenerated_Tool_01.SWORD, 1, aMaterial, aMaterial.mHandleMaterial, null), 200, - 120); - if (aSpecialRecipeReq1) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - " P ", - "fPh", - 'P', - OrePrefixes.plate.get(aMaterial), - 'I', - OrePrefixes.ingot.get(aMaterial) - }); - if (!aNoWorking) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.toolHeadSword, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {" G", "fG", 'G', OrePrefixes.gem.get(aMaterial)}); + calculateRecipeEU(aMaterial, 120)); break; case toolHeadUniversalSpade: GT_ModHandler.addShapelessCraftingRecipe( @@ -1783,48 +1832,52 @@ public class ProcessingToolHead GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Magnalium, 1L), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(170, 1, aMaterial, aMaterial, null), 160, - 100); + calculateRecipeEU(aMaterial, 100)); GT_Values.RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 8L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Titanium, 1L), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(172, 1, aMaterial, aMaterial, null), 320, - 400); + calculateRecipeEU(aMaterial, 400)); GT_Values.RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 12L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.TungstenSteel, 1L), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(174, 1, aMaterial, aMaterial, null), 640, - 1600); + calculateRecipeEU(aMaterial, 1600)); GT_Values.RA.addAssemblerRecipe( GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 16L), GT_OreDictUnificator.get(OrePrefixes.stickLong, Materials.Americium, 1L), GT_MetaGenerated_Tool_01.INSTANCE.getToolWithStats(176, 1, aMaterial, aMaterial, null), 1280, - 6400); + calculateRecipeEU(aMaterial, 6400)); + if (aSpecialRecipeReq2) { - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] { - "fPd", - "SPS", - " P ", - 'P', - aMaterial == Materials.Wood - ? OrePrefixes.plank.get(aMaterial) - : OrePrefixes.plateDouble.get(aMaterial), - 'R', - OrePrefixes.ring.get(aMaterial), - 'S', - OrePrefixes.screw.get(aMaterial) - }); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] { + "fPd", + "SPS", + " P ", + 'P', + aMaterial == Materials.Wood + ? OrePrefixes.plank.get(aMaterial) + : OrePrefixes.plateDouble.get(aMaterial), + 'R', + OrePrefixes.ring.get(aMaterial), + 'S', + OrePrefixes.screw.get(aMaterial) + }); + } + GT_Values.RA.addFormingPressRecipe( GT_OreDictUnificator.get(OrePrefixes.plateDouble, aMaterial, 3L), GT_OreDictUnificator.get(OrePrefixes.screw, aMaterial, 2L), GT_OreDictUnificator.get(OrePrefixes.turbineBlade, aMaterial, 1L), 200, - 60); + calculateRecipeEU(aMaterial, 60)); } break; default: diff --git a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java index 71724bf27f..f3b81834aa 100644 --- a/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java +++ b/src/main/java/gregtech/loaders/oreprocessing/ProcessingWire.java @@ -1,5 +1,7 @@ package gregtech.loaders.oreprocessing; +import static gregtech.api.util.GT_Utility.calculateRecipeEU; + import appeng.api.config.TunnelType; import appeng.core.Api; import cpw.mods.fml.common.Optional; @@ -54,124 +56,134 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr GT_Utility.copyAmount(1L, aStack), GT_OreDictUnificator.get(OrePrefixes.springSmall, aMaterial, 2L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addWiremillRecipe( GT_Utility.copyAmount(1L, aStack), GT_Utility.getIntegratedCircuit(1), GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 4L), 200, - 8); - // GT_Values.RA.addWiremillRecipe(GT_OreDictUnificator.get(OrePrefixes.ingot, aMaterial, 1L), - // GT_Utility.copy(new Object[]{GT_Utility.copyAmount(2L, aStack), - // GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, 8L)}), 100, 4); - // GT_Values.RA.addWiremillRecipe(GT_OreDictUnificator.get(OrePrefixes.stick, aMaterial, 1L), - // GT_Utility.copy(new Object[]{aStack, GT_OreDictUnificator.get(OrePrefixes.wireFine, aMaterial, - // 4L)}), 50, 4); + calculateRecipeEU(aMaterial, 8)); } if (aMaterial.mUnificatable && (aMaterial.mMaterialInto == aMaterial) - && !aMaterial.contains(SubTag.NO_WORKING)) - GT_ModHandler.addCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), - GT_Proxy.tBits, - new Object[] {"Xx", 'X', OrePrefixes.plate.get(aMaterial)}); + && !aMaterial.contains(SubTag.NO_WORKING)) { + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 1L), + GT_Proxy.tBits, + new Object[] {"Xx", 'X', OrePrefixes.plate.get(aMaterial)}); + } + } GT_Values.RA.addAssemblerRecipe( GT_Utility.copyAmount(2L, aStack), - ItemList.Circuit_Integrated.getWithDamage(0L, 2L), + GT_Utility.getIntegratedCircuit(2), GT_OreDictUnificator.get(OrePrefixes.wireGt02, aMaterial, 1L), 150, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( GT_Utility.copyAmount(4L, aStack), - ItemList.Circuit_Integrated.getWithDamage(0L, 4L), + GT_Utility.getIntegratedCircuit(4), GT_OreDictUnificator.get(OrePrefixes.wireGt04, aMaterial, 1L), 200, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( GT_Utility.copyAmount(8L, aStack), - ItemList.Circuit_Integrated.getWithDamage(0L, 8L), + GT_Utility.getIntegratedCircuit(8), GT_OreDictUnificator.get(OrePrefixes.wireGt08, aMaterial, 1L), 300, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( GT_Utility.copyAmount(12L, aStack), - ItemList.Circuit_Integrated.getWithDamage(0L, 12L), + GT_Utility.getIntegratedCircuit(12), GT_OreDictUnificator.get(OrePrefixes.wireGt12, aMaterial, 1L), 400, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( GT_Utility.copyAmount(16L, aStack), - ItemList.Circuit_Integrated.getWithDamage(0L, 16L), + GT_Utility.getIntegratedCircuit(16), GT_OreDictUnificator.get(OrePrefixes.wireGt16, aMaterial, 1L), 500, - 8); + calculateRecipeEU(aMaterial, 8)); break; case wireGt02: cableWidth = 2; correspondingCable = OrePrefixes.cableGt02; - GT_ModHandler.addShapelessCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), new Object[] {aOreDictName}); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), - new Object[] {OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 2L), new Object[] {aOreDictName}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), + new Object[] {OrePrefixes.wireGt01.get(aMaterial), OrePrefixes.wireGt01.get(aMaterial)}); + } break; case wireGt04: cableWidth = 4; correspondingCable = OrePrefixes.cableGt04; - GT_ModHandler.addShapelessCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 4L), new Object[] {aOreDictName}); - GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, aStack), new Object[] { - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial) - }); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), - new Object[] {OrePrefixes.wireGt02.get(aMaterial), OrePrefixes.wireGt02.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 4L), new Object[] {aOreDictName}); + GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, aStack), new Object[] { + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial) + }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), + new Object[] {OrePrefixes.wireGt02.get(aMaterial), OrePrefixes.wireGt02.get(aMaterial)}); + } break; case wireGt08: cableWidth = 8; correspondingCable = OrePrefixes.cableGt08; - GT_ModHandler.addShapelessCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 8L), new Object[] {aOreDictName}); - GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, aStack), new Object[] { - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial), - OrePrefixes.wireGt01.get(aMaterial) - }); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), - new Object[] {OrePrefixes.wireGt04.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 8L), new Object[] {aOreDictName}); + GT_ModHandler.addShapelessCraftingRecipe(GT_Utility.copyAmount(1L, aStack), new Object[] { + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial), + OrePrefixes.wireGt01.get(aMaterial) + }); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), + new Object[] {OrePrefixes.wireGt04.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)}); + } break; case wireGt12: cableWidth = 12; correspondingCable = OrePrefixes.cableGt12; - GT_ModHandler.addShapelessCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 12L), new Object[] {aOreDictName}); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), - new Object[] {OrePrefixes.wireGt08.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 12L), + new Object[] {aOreDictName}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), + new Object[] {OrePrefixes.wireGt08.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)}); + } break; case wireGt16: cableWidth = 16; correspondingCable = OrePrefixes.cableGt16; - GT_ModHandler.addShapelessCraftingRecipe( - GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 16L), new Object[] {aOreDictName}); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), - new Object[] {OrePrefixes.wireGt08.get(aMaterial), OrePrefixes.wireGt08.get(aMaterial)}); - GT_ModHandler.addShapelessCraftingRecipe( - GT_Utility.copyAmount(1L, aStack), - new Object[] {OrePrefixes.wireGt12.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)}); + if (aMaterial.getProcessingMaterialTierEU() < Tier.IV) { - if (GT_Mod.gregtechproxy.mAE2Integration) { - AE2addNewAttunement(aStack); + GT_ModHandler.addShapelessCraftingRecipe( + GT_OreDictUnificator.get(OrePrefixes.wireGt01, aMaterial, 16L), + new Object[] {aOreDictName}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), + new Object[] {OrePrefixes.wireGt08.get(aMaterial), OrePrefixes.wireGt08.get(aMaterial)}); + GT_ModHandler.addShapelessCraftingRecipe( + GT_Utility.copyAmount(1L, aStack), + new Object[] {OrePrefixes.wireGt12.get(aMaterial), OrePrefixes.wireGt04.get(aMaterial)}); + + if (GT_Mod.gregtechproxy.mAE2Integration) { + AE2addNewAttunement(aStack); + } } break; default: @@ -320,21 +332,21 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr Materials.Rubber.getMolten(144 * costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( aStack, GT_Utility.getIntegratedCircuit(24), Materials.StyreneButadieneRubber.getMolten(108 * costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( aStack, GT_Utility.getIntegratedCircuit(24), Materials.Silicone.getMolten(72 * costMultiplier), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); for (Materials dielectric : dielectrics) { for (Materials syntheticRubber : syntheticRubbers) { GT_Values.RA.addAssemblerRecipe( @@ -344,13 +356,13 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr syntheticRubber.getMolten(costMultiplier * 144), GT_OreDictUnificator.get(correspondingCable, aMaterial, 4L), 400, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] {aStack, dielectric.getDustSmall(costMultiplier)}, syntheticRubber.getMolten(costMultiplier * 36), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); } } } else { @@ -363,7 +375,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr Materials.Silicone.getMolten(costMultiplier * 72), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { aStack, @@ -374,7 +386,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr Materials.Silicone.getMolten(costMultiplier * 72), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); for (Materials dielectric : dielectrics) { for (Materials syntheticRubber : syntheticRubbers) { GT_Values.RA.addAssemblerRecipe( @@ -386,7 +398,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr syntheticRubber.getMolten(costMultiplier * 144), GT_OreDictUnificator.get(correspondingCable, aMaterial, 4L), 400, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { GT_Utility.copyAmount(4, aStack), @@ -397,7 +409,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr syntheticRubber.getMolten(costMultiplier * 144), GT_OreDictUnificator.get(correspondingCable, aMaterial, 4L), 400, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { aStack, @@ -407,7 +419,7 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr syntheticRubber.getMolten(costMultiplier * 36), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); GT_Values.RA.addAssemblerRecipe( new ItemStack[] { aStack, @@ -418,18 +430,19 @@ public class ProcessingWire implements gregtech.api.interfaces.IOreRecipeRegistr syntheticRubber.getMolten(costMultiplier * 36), GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), 100, - 8); + calculateRecipeEU(aMaterial, 8)); } } } break; } + // Honestly when can this machine be removed? ); GT_Values.RA.addUnboxingRecipe( GT_OreDictUnificator.get(correspondingCable, aMaterial, 1L), GT_Utility.copyAmount(1L, aStack), null, 100, - 8); + calculateRecipeEU(aMaterial, 8)); if (GT_Mod.gregtechproxy.mAE2Integration) { AE2AddNetAttunementCable(aStack, correspondingCable, aMaterial); } |