From b8bd619bbfdecddccf8a1a3129a11e0fccca200b Mon Sep 17 00:00:00 2001 From: Maxim Date: Fri, 14 Jul 2023 12:54:49 +0200 Subject: GPL Special Item access (#2134) * Added getters to allow a machine to set the special item for recipe checking --- src/main/java/gregtech/api/logic/ProcessingLogic.java | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/main/java/gregtech/api/logic') diff --git a/src/main/java/gregtech/api/logic/ProcessingLogic.java b/src/main/java/gregtech/api/logic/ProcessingLogic.java index db97ac151f..bcf460e5e1 100644 --- a/src/main/java/gregtech/api/logic/ProcessingLogic.java +++ b/src/main/java/gregtech/api/logic/ProcessingLogic.java @@ -29,6 +29,7 @@ public class ProcessingLogic { protected IRecipeLockable recipeLockableMachine; protected Supplier recipeMapSupplier; protected GT_Recipe lastRecipe; + protected ItemStack specialSlotItem; protected ItemStack[] inputItems; protected ItemStack[] outputItems; protected ItemStack[] currentOutputItems; @@ -73,6 +74,11 @@ public class ProcessingLogic { return this; } + public ProcessingLogic setSpecialSlotItem(ItemStack specialSlotItem) { + this.specialSlotItem = specialSlotItem; + return this; + } + /** * Overwrites item output result of the calculation. */ @@ -213,6 +219,7 @@ public class ProcessingLogic { public ProcessingLogic clear() { this.inputItems = null; this.inputFluids = null; + this.specialSlotItem = null; this.outputItems = null; this.outputFluids = null; this.calculatedEut = 0; @@ -252,8 +259,14 @@ public class ProcessingLogic { recipeLockableMachine.getSingleRecipeCheck() .getRecipe()); } else { - findRecipeResult = recipeMap - .findRecipeWithResult(lastRecipe, false, false, availableVoltage, inputFluids, null, inputItems); + findRecipeResult = recipeMap.findRecipeWithResult( + lastRecipe, + false, + false, + availableVoltage, + inputFluids, + specialSlotItem, + inputItems); } GT_Recipe recipe; -- cgit