aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util/GT_Recipe.java
diff options
context:
space:
mode:
authorboubou19 <miisterunknown@gmail.com>2024-08-22 09:08:45 +0200
committerGitHub <noreply@github.com>2024-08-22 07:08:45 +0000
commita9dfc0fe81a0b89ea51d6cdfd1a3a960f1e2cc14 (patch)
tree97f10aacc92352cd7e71ecb70b0088c3282028f0 /src/main/java/gregtech/api/util/GT_Recipe.java
parentb22db6288809a012bcc7d39c768662d4198ec370 (diff)
downloadGT5-Unofficial-a9dfc0fe81a0b89ea51d6cdfd1a3a960f1e2cc14.tar.gz
GT5-Unofficial-a9dfc0fe81a0b89ea51d6cdfd1a3a960f1e2cc14.tar.bz2
GT5-Unofficial-a9dfc0fe81a0b89ea51d6cdfd1a3a960f1e2cc14.zip
avoid item oredict and allocation spam (#2937)
* avoid item oredict and allocation spam * Spotless apply for branch fix/comparison_spam for #2937 (#2938) spotlessApply Co-authored-by: GitHub GTNH Actions <> --------- Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> Co-authored-by: Martin Robertz <dream-master@gmx.net>
Diffstat (limited to 'src/main/java/gregtech/api/util/GT_Recipe.java')
-rw-r--r--src/main/java/gregtech/api/util/GT_Recipe.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Recipe.java b/src/main/java/gregtech/api/util/GT_Recipe.java
index 74f15e428c..3bc78ad160 100644
--- a/src/main/java/gregtech/api/util/GT_Recipe.java
+++ b/src/main/java/gregtech/api/util/GT_Recipe.java
@@ -50,6 +50,16 @@ import it.unimi.dsi.fastutil.objects.Reference2LongOpenHashMap;
public class GT_Recipe implements Comparable<GT_Recipe> {
+ private static ItemStack dataStick;
+ private static ItemStack dataOrb;
+ private static ItemStack ic2FluidCell;
+
+ public static void setItemStacks() {
+ ic2FluidCell = Ic2Items.FluidCell.copy();
+ dataStick = ItemList.Tool_DataStick.get(1L);
+ dataOrb = ItemList.Tool_DataOrb.get(1L);
+ }
+
/**
* If you want to change the Output, feel free to modify or even replace the whole ItemStack Array, for Inputs,
* please add a new Recipe, because of the HashMaps.
@@ -584,9 +594,9 @@ public class GT_Recipe implements Comparable<GT_Recipe> {
*/
private boolean shouldCheckNBT(ItemStack item) {
if (GTppRecipeHelper) {
- return GT_Utility.areStacksEqual(item, Ic2Items.FluidCell.copy(), true)
- || GT_Utility.areStacksEqual(item, ItemList.Tool_DataStick.get(1L), true)
- || GT_Utility.areStacksEqual(item, ItemList.Tool_DataOrb.get(1L), true);
+ return GT_Utility.areStacksEqual(item, ic2FluidCell, true)
+ || GT_Utility.areStacksEqual(item, dataStick, true)
+ || GT_Utility.areStacksEqual(item, dataOrb, true);
}
return false;
}