public record BundlePredicate(Optional<CollectionPredicate<ItemInstance, ItemPredicate>> items) implements SingleComponentItemPredicate<BundleContents> {
15
public static final Codec<BundlePredicate> CODEC = RecordCodecBuilder.create(
16
i -> i.group(CollectionPredicate.<ItemInstance, ItemPredicate>codec(ItemPredicate.CODEC).optionalFieldOf("items").forGetter(BundlePredicate::items))
17
.apply(i, BundlePredicate::new)
18
);
19
20
@Override
21
public DataComponentType<BundleContents> componentType() {
22
return DataComponents.BUNDLE_CONTENTS;
23
}
24
25
public boolean matches(final BundleContents value) {
Decompiled Minecraft 26.3 source of BundlePredicate (net/minecraft/core/component/predicates/BundlePredicate.java) with Mojang official mappings, stored verbatim on the site.