You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
+ private final StackedContents<ItemOrExact> contents;
101
104
+ public Object2IntMap<ItemOrExact.Item> regularRemoved = new Object2IntOpenHashMap<>(); // needed for re-using the regular contents (for ShapelessRecipe)
102
105
+ public final ObjectSet<ItemStack> exactIngredients = new ObjectOpenCustomHashSet<>(ItemStackLinkedSet.TYPE_AND_TAG);
106
+
+ public final List<Predicate<ItemStack>> predicateIngredients = new ArrayList<>();
103
107
+
104
108
+ public StackedContentsExtrasMap(final StackedContents<ItemOrExact> contents) {
105
109
+ this.contents = contents;
106
110
+ }
107
111
+
108
112
+ public void initialize(final Recipe<?> recipe) {
109
113
+ this.exactIngredients.clear();
114
+
+ this.predicateIngredients.clear();
110
115
+ for (final Ingredient ingredient : recipe.placementInfo().ingredients()) {
@@ -356,9 +369,9 @@ index 1a6870fd5dd02022d6b0df88e8f55f8ba9cf07c9..4f3697573fbfec3865751037de00a562
356
369
public static final StreamCodec<RegistryFriendlyByteBuf, Ingredient> CONTENTS_STREAM_CODEC = ByteBufCodecs.holderSet(Registries.ITEM)
357
370
.map(Ingredient::new, i -> i.values);
358
371
public static final StreamCodec<RegistryFriendlyByteBuf, Optional<Ingredient>> OPTIONAL_CONTENTS_STREAM_CODEC = ByteBufCodecs.holderSet(Registries.ITEM)
359
-
@@ -34,19 +34,23 @@ public final class Ingredient implements Predicate<ItemStack>, StackedContents.I
360
-
public static final Codec<Ingredient> CODEC = ExtraCodecs.nonEmptyHolderSet(NON_AIR_HOLDER_SET_CODEC).xmap(Ingredient::new, i -> i.values);
372
+
@@ -35,19 +35,23 @@ public final class Ingredient implements Predicate<ItemStack>, StackedContents.I
361
373
public final HolderSet<Item> values;
374
+
public java.util.function.@org.jspecify.annotations.Nullable Predicate<ItemStack> stackPredicate; // Paper - add PredicateChoice
0 commit comments