aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/util/GT_Utility.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/main/java/gregtech/api/util/GT_Utility.java b/src/main/java/gregtech/api/util/GT_Utility.java
index a54039def9..4dfc407572 100644
--- a/src/main/java/gregtech/api/util/GT_Utility.java
+++ b/src/main/java/gregtech/api/util/GT_Utility.java
@@ -157,6 +157,7 @@ public class GT_Utility {
private static final Map<String, Fluid> sFluidUnlocalizedNameToFluid = new HashMap<>();
/** Must use {@code Supplier} here because the ore prefixes have not yet been registered at class load time. */
private static final Map<OrePrefixes, Supplier<ItemStack>> sOreToCobble = new HashMap<>();
+ private final static Map<Integer, Boolean> sOreTable = new HashMap<>();
public static volatile int VERSION = 509;
public static boolean TE_CHECK = false, BC_CHECK = false, CHECK_ALL = true, RF_CHECK = false;
public static Map<GT_PlayedSound, Integer> sPlayedSoundMap = new /*Concurrent*/HashMap<>();
@@ -2961,10 +2962,17 @@ public class GT_Utility {
}
public static boolean isOre(ItemStack aStack) {
+ int tItem = GT_Utility.stackToInt(aStack);
+ if (sOreTable.containsKey(tItem)) {
+ return sOreTable.get(tItem);
+ }
for (int id: OreDictionary.getOreIDs(aStack)) {
- if (OreDictionary.getOreName(id).startsWith("ore"))
+ if (OreDictionary.getOreName(id).startsWith("ore")) {
+ sOreTable.put(tItem, true);
return true;
+ }
}
+ sOreTable.put(tItem, false);
return false;
}