aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/gregtech/api/util
diff options
context:
space:
mode:
authorRaven Szewczyk <git@eigenraven.me>2023-01-24 15:26:02 +0000
committerGitHub <noreply@github.com>2023-01-24 16:26:02 +0100
commite197a79a0558c6ce1b116d871a71a214962a01a3 (patch)
tree8277d99d5fc82a6420030eefbbd7b3640a13cf25 /src/main/java/gregtech/api/util
parent2d9bfa024c21fd69289dabefa810bab8a95ded50 (diff)
downloadGT5-Unofficial-e197a79a0558c6ce1b116d871a71a214962a01a3.tar.gz
GT5-Unofficial-e197a79a0558c6ce1b116d871a71a214962a01a3.tar.bz2
GT5-Unofficial-e197a79a0558c6ce1b116d871a71a214962a01a3.zip
Fix array ClassCastExceptions (#1681)
* Fix array classcastexceptions * Remove extra parens
Diffstat (limited to 'src/main/java/gregtech/api/util')
-rw-r--r--src/main/java/gregtech/api/util/GT_ModHandler.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/main/java/gregtech/api/util/GT_ModHandler.java b/src/main/java/gregtech/api/util/GT_ModHandler.java
index 4ec093bdf6..93e8137912 100644
--- a/src/main/java/gregtech/api/util/GT_ModHandler.java
+++ b/src/main/java/gregtech/api/util/GT_ModHandler.java
@@ -697,7 +697,7 @@ public class GT_ModHandler {
boolean aExcludeGTIC2Items) {
Map<ItemStack, ItemStack> aRecipesToRemove = new HashMap<>();
for (Entry<IRecipeInput, RecipeOutput> iRecipeInputRecipeOutputEntry : aIC2RecipeList.entrySet()) {
- if ((iRecipeInputRecipeOutputEntry.getValue()).items.size() > 0) {
+ if (!iRecipeInputRecipeOutputEntry.getValue().items.isEmpty()) {
for (ItemStack tStack : (iRecipeInputRecipeOutputEntry.getKey()).getInputs()) {
if (GT_Utility.isStackValid(tStack)) {
if (aAddGTRecipe
@@ -717,11 +717,15 @@ public class GT_ModHandler {
true,
new ItemStack[] {
GT_Utility.copyAmount(
- (iRecipeInputRecipeOutputEntry.getKey()).getAmount(),
+ iRecipeInputRecipeOutputEntry
+ .getKey()
+ .getAmount(),
tStack)
},
- (ItemStack[])
- (iRecipeInputRecipeOutputEntry.getValue()).items.toArray(),
+ iRecipeInputRecipeOutputEntry
+ .getValue()
+ .items
+ .toArray(new ItemStack[0]),
null,
null,
null,
@@ -735,11 +739,15 @@ public class GT_ModHandler {
true,
new ItemStack[] {
GT_Utility.copyAmount(
- (iRecipeInputRecipeOutputEntry.getKey()).getAmount(),
+ iRecipeInputRecipeOutputEntry
+ .getKey()
+ .getAmount(),
tStack)
},
- (ItemStack[])
- (iRecipeInputRecipeOutputEntry.getValue()).items.toArray(),
+ iRecipeInputRecipeOutputEntry
+ .getValue()
+ .items
+ .toArray(new ItemStack[0]),
null,
null,
null,
@@ -755,7 +763,11 @@ public class GT_ModHandler {
}
if (aRemoveIC2Recipe)
aRecipesToRemove.put(
- tStack, ((RecipeOutput) iRecipeInputRecipeOutputEntry.getValue()).items.get(0));
+ tStack,
+ iRecipeInputRecipeOutputEntry
+ .getValue()
+ .items
+ .get(0));
}
}
}