From ebd1748addf3c0bdd8d25c040ccaf530b390a766 Mon Sep 17 00:00:00 2001 From: Elisis Date: Tue, 14 Nov 2023 20:42:39 +1100 Subject: Allow a recipe's displayed NEI item outputs to be changed (#2367) * Add GT_Recipe#getRepresentativeOutputs method * Spotless apply for branch nei-output-override for #2367 (#2368) spotlessApply Co-authored-by: GitHub GTNH Actions <> * Javadoc, move method, remove unnecessary import, Object to ItemStack * Actually fix merge * Spotless apply for branch nei-output-override for #2367 (#2369) spotlessApply Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> --- src/main/java/gregtech/api/util/GT_Recipe.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/main/java/gregtech/api') diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java index 61cd2134a3..7ae355b1e0 100644 --- a/src/main/java/gregtech/api/util/GT_Recipe.java +++ b/src/main/java/gregtech/api/util/GT_Recipe.java @@ -580,6 +580,20 @@ public class GT_Recipe implements Comparable { return GT_Utility.copyOrNull(mOutputs[aIndex]); } + /*** + * Dictates the ItemStacks displayed in the output slots of any NEI page handled by the default GT NEI handler. + * Override to make shown items differ from a GT_Recipe's item output array + * + * @see gregtech.nei.GT_NEI_DefaultHandler + * @param i Slot index + * @return ItemStack to be displayed in the slot + * + */ + // + public ItemStack getRepresentativeOutput(int i) { + return getOutput(i); + } + public int getOutputChance(int aIndex) { if (mChances == null) return 10000; if (aIndex < 0 || aIndex >= mChances.length) return 10000; -- cgit