MarkusBordihn/BOs-Easy-Mob-Farm

[Bug] NBT data for recipes are not supported in Fabric

Closed this issue ยท 2 comments

Minecraft and Mod version ๐Ÿž
Minecraft 1.19.2, Fabric 0.16.9, mod version 8.5.1 (on modrinth)

Describe the bug ๐Ÿž
You can craft each of the tiered frames, but when adding them to a crafting recipe to make a specific farm (like plains, monster, etc.) the tier is not taken into account and the result is always tier 0.

To Reproduce โš™๏ธ
Steps to reproduce the behavior:

Craft any tiered frame
Add ingredients to craft a specific farm type
Craft the farm type with the tiered frame
The farm will be tier 0 no matter what tier frame you've used

Expected behavior โœ”๏ธ
A clear and concise description of what you expected to happen.

Depending on what tier frame I've crafted, that tier would be implemented in the farm.

Screenshots ๐Ÿ“ธ
If applicable, add screenshots to help explain your problem.
2024-11-24_14 12 07
2024-11-24_14 12 20
2024-11-24_14 12 24
2024-11-25_14 08 22
2024-11-25_14 08 32

Debugging ๐Ÿ› ๏ธ
This is what I found in the logs:

[14:10:12] [Render thread/ERROR]:
Couldn't load advancement easy_mob_farm:crafting/mob_farm_template/tier3_mob_farm_template: Task Advancement{parentId=easy_mob_farm:tier2_template, display=net.minecraft.class_185@3165b665, rewards=AdvancementRewards{experience=0, loot=[], recipes=[], function=net.minecraft.class_2158$class_2159@4f5f5bea}, criteria={create_tier3_template=net.minecraft.class_175@172a89ae}, requirements=[[create_tier3_template]]}

[14:10:12] [Render thread/ERROR]:
Couldn't load advancement easy_mob_farm:crafting/mob_farm_template/tier2_mob_farm_template: Task Advancement{parentId=easy_mob_farm:tier1_template, display=net.minecraft.class_185@275cf658, rewards=AdvancementRewards{experience=0, loot=[], recipes=[], function=net.minecraft.class_2158$class_2159@4f5f5bea}, criteria={create_tier2_template=net.minecraft.class_175@64786ce4}, requirements=[[create_tier2_template]]}

[14:10:12] [Render thread/ERROR]:
Couldn't load advancement easy_mob_farm:crafting/mob_farm_template/tier1_mob_farm_template: Task Advancement{parentId=easy_mob_farm:tier0_template, display=net.minecraft.class_185@15752ae9, rewards=AdvancementRewards{experience=0, loot=[], recipes=[], function=net.minecraft.class_2158$class_2159@4f5f5bea}, criteria={create_tier1_template=net.minecraft.class_175@32cd7bef}, requirements=[[create_tier1_template]]}

Is the issue happening in combination with other mods? (If yes, please provide a full list) ๐Ÿงฉ
No, I tested it by itself and was able to confirm that the bug still occurs.

(ps: the cards are very cute! )

Thank you very much for the report! I was able to reproduce the issue on Fabric.

It appears that the recipe's NBT data is not being considered on Fabric for some reason. Here is the relevant recipe file for reference:
GitHub: tier1_monster_plains_cave_farm.json

Interestingly, manually spawning the item works as expected with the following command:
/give Player677 easy_mob_farm:monster_plains_cave_farm{TierLevel:2,CustomModelData:2}

I will investigate this issue in more detail. It seems to be Fabric-specific, as it does not occur on Forge.

Additionally, the shared error messages are only related to advancements and do not affect the recipes themselves, so they should not be impacting this issue.

After a closer examination of the Forge and Fabric code, it appears that only Forge supports NBT data in recipes, which is unfortunate. ๐Ÿ˜ž

Iโ€™ll work on a workaround to ensure the recipes function correctly on both platforms.

The initial test looks good. Next, I'll focus on cleaning up the code and testing it across the different versions to ensure compatibility and performance.

image

image