aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJason Mitchell <mitchej@gmail.com>2021-01-16 19:57:59 -0800
committerJason Mitchell <mitchej@gmail.com>2021-01-16 19:57:59 -0800
commit6a23b6a59a6f2664ae8af68c33f60b3a6d57ab8e (patch)
tree158ba4613d58e0cfab2d645641b9ed3490eba784 /src
parenteefd6dee33b2c290290e3ccd948967a63c76472a (diff)
downloadGT5-Unofficial-6a23b6a59a6f2664ae8af68c33f60b3a6d57ab8e.tar.gz
GT5-Unofficial-6a23b6a59a6f2664ae8af68c33f60b3a6d57ab8e.tar.bz2
GT5-Unofficial-6a23b6a59a6f2664ae8af68c33f60b3a6d57ab8e.zip
Better fix.
Should be isStringValid(), not isStackValid()
Diffstat (limited to 'src')
-rw-r--r--src/main/java/gregtech/api/util/GT_OreDictUnificator.java18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
index eccdfc1bcc..a45e002cfa 100644
--- a/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
+++ b/src/main/java/gregtech/api/util/GT_OreDictUnificator.java
@@ -79,7 +79,7 @@ public class GT_OreDictUnificator {
if (GT_Utility.isStringInvalid(aName)) return null;
ItemStack tStack = sName2StackMap.get(aName.toString());
if (GT_Utility.isStackValid(tStack)) return GT_Utility.copyAmount(aAmount, tStack);
- return GT_Utility.copyAmount(aAmount, getOres(aName).toArray());
+ return GT_Utility.copyAmount(aAmount, getOresImmutable(aName).toArray());
}
public static ItemStack get(Object aName, long aAmount) {
@@ -472,17 +472,9 @@ public class GT_OreDictUnificator {
* Fast version of {@link #getOres(Object)},
* which doesn't call {@link System#arraycopy(Object, int, Object, int, int)} in {@link ArrayList#addAll}
*/
- public static List<ItemStack> getOresImmutable(@Nullable Object oreName) {
- return getOresImmutable(oreName != null ? oreName.toString() : null);
- }
-
- /**
- * Fast version of {@link #getOres(Object)},
- * which doesn't call {@link System#arraycopy(Object, int, Object, int, int)} in {@link ArrayList#addAll}
- */
- public static List<ItemStack> getOresImmutable(@Nullable String oreName) {
- if(oreName == null) oreName = E;
-
- return GT_Utility.isStackValid(oreName) ? Collections.unmodifiableList(OreDictionary.getOres(oreName)) : Collections.emptyList();
+ public static List<ItemStack> getOresImmutable(@Nullable Object aOreName) {
+ String aName = aOreName == null ? E : aOreName.toString();
+
+ return GT_Utility.isStringValid(aName) ? Collections.unmodifiableList(OreDictionary.getOres(aName)) : Collections.emptyList();
}
}