Skip to content

Commit 6b37051

Browse files
committed
Fix faster_ingredients bypassing defensive copy of ItemValue
Kudos to @nutant233 for noticing this
1 parent cf5c81f commit 6b37051

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

forge/src/main/java/org/embeddedt/modernfix/forge/mixin/perf/faster_ingredients/IngredientMixin.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,9 +142,7 @@ public ItemStack[] getItems() {
142142
private ItemStack[] computeItemsArray() {
143143
// Fast path for case with one item
144144
if (this.values.length == 1) {
145-
if (this.values[0] instanceof Ingredient.ItemValue itemValue) {
146-
return new ItemStack[] { itemValue.item };
147-
} else if (this.values[0] instanceof Ingredient.TagValue tagValue && mfix$areTagsAvailable()) {
145+
if (this.values[0] instanceof Ingredient.TagValue tagValue && mfix$areTagsAvailable()) {
148146
var tag = BuiltInRegistries.ITEM.getTag(tagValue.tag);
149147
if (tag.isPresent() && tag.get().size() > 0) {
150148
var holderSet = tag.get();

0 commit comments

Comments
 (0)