neoforged/NeoForge

[1.21.3] Crash when using item tag in GLM

Opened this issue · 2 comments

Minecraft Version: 1.21.3

NeoForge Version: 21.3.3-beta

Logs: https://pastebin.com/TL6ijBxY

Steps to Reproduce:

  1. Use item tag in GLM
  2. Run Datagen
        add("grass_drops_fibers", new AddItemModifier(
                new LootItemCondition[] {
                        LootItemRandomChanceCondition.randomChance(0.1f).build(),
                        MatchTool.toolMatches(ItemPredicate.Builder.item().of(BuiltInRegistries.ITEM, YTechItemTags.SHARP_FLINTS)).build(),
                        LootItemBlockStatePropertyCondition.hasBlockStateProperties(Blocks.SHORT_GRASS).build()
                },
                YTechItems.GRASS_FIBERS.get()
        ));

Description of issue:
Crash happen when using item tag in GLM. Given tag YTechItemTags.SHARP_FLINTS works fine in Recipe Datagen

Same when used custom Tag in Advancement datagen

Caused by: java.lang.IllegalStateException: Missing tag TagKey[minecraft:item / ytech:sharp_flints]
	at TRANSFORMER/minecraft@1.21.3/net.minecraft.core.HolderGetter.lambda$getOrThrow$1(HolderGetter.java:17)
	at java.base/java.util.Optional.orElseThrow(Optional.java:403)
	at TRANSFORMER/minecraft@1.21.3/net.minecraft.core.HolderGetter.getOrThrow(HolderGetter.java:17)
	at TRANSFORMER/minecraft@1.21.3/net.minecraft.advancements.critereon.ItemPredicate$Builder.of(ItemPredicate.java:71)
	at TRANSFORMER/ytech@1.21.1-0.6.0/com.yanny.ytech.generation.YTechGlobalLootModifierProvider.start(YTechGlobalLootModifierProvider.java:34)
	at TRANSFORMER/neoforge@21.3.10-beta/net.neoforged.neoforge.common.data.GlobalLootModifierProvider.run(GlobalLootModifierProvider.java:70)
	at TRANSFORMER/neoforge@21.3.10-beta/net.neoforged.neoforge.common.data.GlobalLootModifierProvider.lambda$run$0(GlobalLootModifierProvider.java:65)
	at java.base/java.util.concurrent.CompletableFuture.uniComposeStage(CompletableFuture.java:1187)