Recipes added to the Crusher Ritual do not respect NBT tags on inputs
KirinDave opened this issue ยท 5 comments
Describe the bug
While using kubejs to inject recipes into the Crusher ritual for compatibility, I discovered that the Crusher does not appear to respect NBT tags on inputs while selecting an output.
For example, ElementalCraft's "Pure Ore Chunks" are differentiated by an ore type NBT tag (see example Kubejs script below). When adding more than one such recipe, only the very first recipe offered is selected.
To Reproduce
Steps to reproduce the behavior:
- Run with ElementalCraft, Occultism and JEI in the same instance.
- Run this script in kubejs's "server" directory.
- Summon a Foliot with the Crusher ritual.
- Spawn in a gold and iron pure ore chunk from elementalcraft, and observe that only one recipe is processed.
- Note that JEI shows all recipes, but with a tagless pure ore cluster.
Expected behavior
I would expect ritual inputs to respect NBT tags when matching for outputs.
Screenshots
None required
System (please complete the following information):
- Occultism Version: 1.0.12
- OS: Windows (any)
- Minecraft Version: 1.16.5
- Modpack Link and Version, or list of mods: Reproducible in ATM6 or without a modpack
Additional context
As other packs (e.g., Enigmatica 6) have been injecting recipes into the Crusher, it seems like an oversight that NBT is not supported. ElementalCraft is an obvious candidate, but several other magic mods have crushable recipes that would require NBT to be respected.
This may be a feature request and not a bug, depending on your expectations for modpack compatibility support.
@KirinDave Thanks for the report!
Indeed the recipe system does not use nbt but rather the item ID, as of "the flattening" it is not recommended (in fact heavily discouraged by the forge best practices) to have one item ID represent multiple items.
Do you have other examples of mods that do this at a large scale?
I can look into it, it's absolutely possible to do, but I am hesitant to update my processes if affected mods possibly upgrade to follow forge's best practice anyway.
Elemental craft pure ore are extremely modular and can adapt to any ore that other mods can add. Also I would argue that handling NBT is required when comparing item stacks.
The most obvious candidates for item nbt data matching in the context of the Occultism rituals are probably: potions (vanilla and botania), books with enchantments, items with enchantments, Apotheosis charms, and tipped arrows. Of course, I grant some of these are pretty weird to imagine crushing.
That said, I want to make sure I'm not asking for sophisticated matching here, so "stackability" is enough even though that would exclude most tools and weapons. I'm not ambitious enough to imagine making it so you'd need to grind an Astral Crystal Sword with properties specified by predicates. ;) Nor would it be your problem to fix specifically if I wanted to.
That said, I want to make sure I'm not asking for sophisticated matching here, so "stackability" is enough even though that would exclude most tools and weapons. I'm not ambitious enough to imagine making it so you'd need to grind an Astral Crystal Sword with properties specified by predicates. ;) Nor would it be your problem to fix specifically if I wanted to.
That is what I initially thought was required, and it would basically be a mod of its own :)
Exact NBT matches I can do :)
@KirinDave I looked into this further - as I mentioned I'm using the forge best practice process, and as it turns out this already allows for the functionality you are looking for:
{
"type": "occultism:crushing",
"ingredient": {
"type": "forge:nbt",
"item": "minecraft:dirt",
"nbt": {
"testkey": "testvalue"
}
},
"result": {
"item": "occultism:copper_dust",
"count": 2
},
"crushing_time": 10
}
If you use the ingredient type "forge:nbt" you can specify the nbt to match. The mod will automatically handle the resulting ingredient correctly.