jaredlll08 / ModTweaker

ModTweaker is an addon for CraftTweaker, which provides Integration for an amount of mods.
MIT License
69 stars 63 forks source link

.withTag() will not work properly when setting Aspects on items #754

Closed Lord-Felidae closed 4 years ago

Lord-Felidae commented 4 years ago

Issue Description:

Note: If this bug occurs in a modpack, please report this to the modpack author. Otherwise, delete this line and add your description here. If you are using an unnofficial version of Minetweaker or Crafttweaker or ModTweaker please report it to the person who gave you the version. Also please look at the other issues to make sure that you are not creating a duplicate.

What happens:

.withTag() will only apply TC6 Aspects if all NBT values specified match perfectly

What you expected to happen:

.withTag() was supposed to work when just the specified NBT matches, regardless of what other NBT data is present. This worked before with the exact same scripts as I have put in below.

Additionally, .onlyWithTag() will not work when trying to set aspects.

Script used (Please Pastebin or gist your script, posting an unpasted or ungist'd script will automatically close this issue):

https://pastebin.com/ZLJGCpbe

All of the lines that set aspects on mobs are working properly

Minetweaker.log file (Please Pastebin or gist your file, posting an unpasted or ungist'd file will automatically close this issue):

https://pastebin.com/nfmzNNjM/?e=1


Affected Versions (Do not use "latest"):

Your most recent log file where the issue was present:

https://pastebin.com/nfmzNNjM/?e=1 (same file)

jaredlll08 commented 4 years ago

onlyWithTag is a condition that is only checked when doing recipes in the crafting table, it says "only accept items with this tag".

Due to how thaumcraft works, this is working as intended.

Lord-Felidae commented 4 years ago

No, that’s not what I meant, exactly, that was just one of the things I tried to work around the issue. The issue I’m having is .withTag() will not set aspects on anything that doesn’t match, as if it were in fact using .onlyWithTag(), even though it wasn’t. I’d like to reiterate that the script I have actually has worked before for quite some time, until it suddenly stopped.

jaredlll08 commented 4 years ago

nothing has changed on my side in 1.12 in a while, so if it ever worked then it must be a thaumcraft update or something.

The way that thaumcraf (and most mods with support) work is, we take our IItemStack which has the custom partial NBT matching methods, and convert it to a normal vanilla ItemStack without those methods. This is not wrong or bad, it is just how it is (why would thaumcraft care about our stacks).

I'm sorry but I'm not sure what to tell you, nothing has changed on my side, maybe thaumcraft updated or something? (If you can get it working on a version, let me know so I can see what has changed, but I really do think you would be wasting time, like the code has been like this for a while)