|
8 | 8 | import java.util.Optional;
|
9 | 9 | import java.util.function.Consumer;
|
10 | 10 | import net.kyori.adventure.text.Component;
|
| 11 | +import net.minecraft.advancements.critereon.DataComponentMatchers; |
11 | 12 | import net.minecraft.advancements.critereon.ItemPredicate;
|
12 | 13 | import net.minecraft.advancements.critereon.MinMaxBounds;
|
13 | 14 | import net.minecraft.core.Holder;
|
14 | 15 | import net.minecraft.core.HolderSet;
|
| 16 | +import net.minecraft.core.component.DataComponentExactPredicate; |
15 | 17 | import net.minecraft.core.component.DataComponentMap;
|
16 | 18 | import net.minecraft.core.component.DataComponentPatch;
|
17 |
| -import net.minecraft.core.component.DataComponentPredicate; |
18 | 19 | import net.minecraft.core.component.DataComponents;
|
19 | 20 | import net.minecraft.core.component.PatchedDataComponentMap;
|
20 | 21 | import net.minecraft.nbt.CompoundTag;
|
@@ -158,9 +159,9 @@ public static CraftItemStack asNewCraftStack(Item item, int amount) {
|
158 | 159 |
|
159 | 160 | public static ItemPredicate asCriterionConditionItem(ItemStack original) {
|
160 | 161 | net.minecraft.world.item.ItemStack nms = CraftItemStack.asNMSCopy(original);
|
161 |
| - DataComponentPredicate predicate = DataComponentPredicate.allOf(PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, nms.getComponentsPatch())); |
| 162 | + DataComponentExactPredicate predicate = DataComponentExactPredicate.allOf(PatchedDataComponentMap.fromPatch(DataComponentMap.EMPTY, nms.getComponentsPatch())); |
162 | 163 |
|
163 |
| - return new ItemPredicate(Optional.of(HolderSet.direct(nms.getItemHolder())), MinMaxBounds.Ints.ANY, predicate, Collections.emptyMap()); |
| 164 | + return new ItemPredicate(Optional.of(HolderSet.direct(nms.getItemHolder())), MinMaxBounds.Ints.ANY, new DataComponentMatchers(predicate, Collections.emptyMap())); |
164 | 165 | }
|
165 | 166 |
|
166 | 167 | public net.minecraft.world.item.ItemStack handle;
|
|
0 commit comments