
partial nbt comparison issue
Yoghurt4C opened this issue ยท 18 comments
ok so obviously the reason why this happens is because the whole "input item must have a superset of nbt tags" thing doesn't extend properly to nested nbt tags lol
trying to find out a better way of comparing the tags
alright:
- i'll push an update with this fix
- then PR it into Botania
- then push another update after botania updates, that just calls the method in botania instead of duplicating it in btweaks
Oh! Your old solution using NBTTagCompound#merge
doesn't do a superset comparison on list tags either.
This is kind of a weird edge case because to properly do the comparison on ordered lists, you'd need to specify the list indices for the subset of elements you want to match in addition to the elements themselves.
I tested a bunch of cases with this smh, I think i have to assume you're not telling zs the NBT tag you think you're telling it
I was thinking you might have the wrong type somewhere (zen is super loose on types i think).
But actually, come to think of it, probably the array is fucking it up
I think a good compromise would be to just assume that all arrays are unordered (just treat them the same as a tag compound). Arrays don't turn up too often on items, and when they do, they usually specify an index somewhere in the tag compound anyways (chests, bees apparently, ...) so you can match on that
I thought about treating them as unordered but immediately trashed that idea when I remembered how some swedish weirdos use lists to store coordinate triples.
But why would you want to create a recipe that only works with, like, something bound to a specific coordinate lol
Maybe I'm asking for a tool with a wooden handle and an unobtainium large plate and I don't want shrewd players giving me an unobtainium handle with a wooden large plate?
Oh, I just noticed you're iterating over the tags for the input item and then ignoring them if they aren't in the recipe, which means an input item will match a recipe if it has at least as many tags as the recipe but the tag names are all completely different.