Fix faster_ingredients bypassing defensive copy of ItemValue
Kudos to @nutant233 for noticing this
This commit is contained in:
parent
cf5c81f7e2
commit
6b37051980
|
|
@ -142,9 +142,7 @@ public abstract class IngredientMixin implements ExtendedIngredient {
|
|||
private ItemStack[] computeItemsArray() {
|
||||
// Fast path for case with one item
|
||||
if (this.values.length == 1) {
|
||||
if (this.values[0] instanceof Ingredient.ItemValue itemValue) {
|
||||
return new ItemStack[] { itemValue.item };
|
||||
} else if (this.values[0] instanceof Ingredient.TagValue tagValue && mfix$areTagsAvailable()) {
|
||||
if (this.values[0] instanceof Ingredient.TagValue tagValue && mfix$areTagsAvailable()) {
|
||||
var tag = BuiltInRegistries.ITEM.getTag(tagValue.tag);
|
||||
if (tag.isPresent() && tag.get().size() > 0) {
|
||||
var holderSet = tag.get();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user