From c43cdd94e65c6e19d8380d1b2c87ce19d5d49011 Mon Sep 17 00:00:00 2001 From: miozune Date: Mon, 9 Sep 2024 09:21:25 +0900 Subject: Remove findRecipe methods (#3084) Co-authored-by: Martin Robertz Co-authored-by: boubou19 --- .../tileentities/machines/basic/MTEBoxinator.java | 12 +++---- .../machines/multi/MTEIntegratedOreFactory.java | 41 +++++++++++----------- .../machines/multi/MTEOreDrillingPlantBase.java | 6 ++-- .../machines/multi/MTEPrimitiveBlastFurnace.java | 4 ++- .../machines/steam/MTESteamMaceratorBronze.java | 7 ++-- .../machines/steam/MTESteamMaceratorSteel.java | 7 ++-- .../java/gregtech/common/tools/ToolHardHammer.java | 14 ++++---- .../java/gregtech/common/tools/ToolJackHammer.java | 12 ++++--- 8 files changed, 58 insertions(+), 45 deletions(-) (limited to 'src/main/java/gregtech/common') diff --git a/src/main/java/gregtech/common/tileentities/machines/basic/MTEBoxinator.java b/src/main/java/gregtech/common/tileentities/machines/basic/MTEBoxinator.java index 43d2d6b295..d7edfec413 100644 --- a/src/main/java/gregtech/common/tileentities/machines/basic/MTEBoxinator.java +++ b/src/main/java/gregtech/common/tileentities/machines/basic/MTEBoxinator.java @@ -206,13 +206,11 @@ public class MTEBoxinator extends MTEBasicMachine { if ((ItemList.Schematic_1by1.isStackEqual(tInput1)) || (ItemList.Schematic_2by2.isStackEqual(tInput1)) || (ItemList.Schematic_3by3.isStackEqual(tInput1))) { if (hasValidCache(aStack, aTypeCache, false)) return true; - if (RecipeMaps.packagerRecipes.findRecipe( - getBaseMetaTileEntity(), - true, - GTValues.V[mTier], - null, - GTUtility.copyAmount(64, aStack), - tInput1) != null) { + if (RecipeMaps.packagerRecipes.findRecipeQuery() + .items(GTUtility.copyAmount(64, aStack), tInput1) + .voltage(GTValues.V[mTier]) + .notUnificated(true) + .find() != null) { return true; } if (ItemList.Schematic_1by1.isStackEqual(getInputAt(1)) && GTModHandler.getRecipeOutput(aStack) != null) diff --git a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java index 7de3fb8dbe..187bf4ed69 100644 --- a/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java +++ b/src/main/java/gregtech/common/tileentities/machines/multi/MTEIntegratedOreFactory.java @@ -46,7 +46,6 @@ import com.gtnewhorizon.structurelib.structure.ISurvivalBuildEnvironment; import com.gtnewhorizon.structurelib.structure.StructureDefinition; import gregtech.api.GregTechAPI; -import gregtech.api.enums.GTValues; import gregtech.api.enums.Materials; import gregtech.api.enums.Textures; import gregtech.api.interfaces.ITexture; @@ -463,8 +462,9 @@ public class MTEIntegratedOreFactory extends MTEExtendedPowerMultiBlockBase aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GTRecipe tRecipe = RecipeMaps.hammerRecipes - .findRecipe(null, true, MAX_IC2, null, new ItemStack(aBlock, 1, aMetaData)); + GTRecipe tRecipe = RecipeMaps.hammerRecipes.findRecipeQuery() + .items(new ItemStack(aBlock, 1, aMetaData)) + .notUnificated(true) + .find(); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = RecipeMaps.hammerRecipes - .findRecipe(null, true, MAX_IC2, null, GTUtility.copyAmount(1, tDrop)); + tRecipe = RecipeMaps.hammerRecipes.findRecipeQuery() + .items(GTUtility.copyAmount(1, tDrop)) + .notUnificated(true) + .find(); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { diff --git a/src/main/java/gregtech/common/tools/ToolJackHammer.java b/src/main/java/gregtech/common/tools/ToolJackHammer.java index 6c46a4c9be..bc0a7ddcc0 100644 --- a/src/main/java/gregtech/common/tools/ToolJackHammer.java +++ b/src/main/java/gregtech/common/tools/ToolJackHammer.java @@ -78,12 +78,16 @@ public class ToolJackHammer extends ToolDrillLV { public int convertBlockDrops(List aDrops, ItemStack aStack, EntityPlayer aPlayer, Block aBlock, int aX, int aY, int aZ, byte aMetaData, int aFortune, boolean aSilkTouch, BlockEvent.HarvestDropsEvent aEvent) { int rConversions = 0; - GTRecipe tRecipe = RecipeMaps.hammerRecipes - .findRecipe(null, true, 2147483647L, null, new ItemStack(aBlock, 1, aMetaData)); + GTRecipe tRecipe = RecipeMaps.hammerRecipes.findRecipeQuery() + .items(new ItemStack(aBlock, 1, aMetaData)) + .notUnificated(true) + .find(); if ((tRecipe == null) || (aBlock.hasTileEntity(aMetaData))) { for (ItemStack tDrop : aDrops) { - tRecipe = RecipeMaps.hammerRecipes - .findRecipe(null, true, 2147483647L, null, GTUtility.copyAmount(1, tDrop)); + tRecipe = RecipeMaps.hammerRecipes.findRecipeQuery() + .items(GTUtility.copyAmount(1, tDrop)) + .notUnificated(true) + .find(); if (tRecipe != null) { ItemStack tHammeringOutput = tRecipe.getOutput(0); if (tHammeringOutput != null) { -- cgit