Botania Tweaks

Botania Tweaks

3M Downloads

partial nbt comparison issue

Yoghurt4C opened this issue ยท 18 comments

commented

aka bee problems
image
image

commented

and the nbt on the item you are throwing onto the plate is...?

commented

image

commented

image

commented

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

commented

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
commented

Your fix doesn't seem to do a superset comparison on list tags.

commented

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.

commented

still having issues with this, tried a bunch of nested nbt variations (like snipping the whole species chromosome:
<forestry:bee_princess_ge>.withTag({Genome: {Chromosomes: [{UID1: "gendustry.bee.Manasteel", UID0: "gendustry.bee.Manasteel", Slot: 0 as byte}]}})), but it doesn't want to work
image

commented

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

commented

how am I supposed to present the tag to ct?

commented

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

commented

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

commented

...but then matching becomes really fun (match every pair of elements??)

commented

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.

commented

But why would you want to create a recipe that only works with, like, something bound to a specific coordinate lol

commented

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?

commented

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.

commented

Ah, I used to have a counter that tracked how many tags matched, but didn't think I needed it, didn't think of that case