Calemi / CalemiUtils-1.12.2

Utilities that make your Minecraft experience better!
Apache License 2.0
1 stars 1 forks source link

All crafted items have an empty NBT tag which makes them not stack with mined items. #4

Closed winauer closed 5 years ago

winauer commented 5 years ago

Describe the bug Items that were obtained through crafting don't stack with identical items that were mined.

To Reproduce:

Expected behavior Identical items should stack.

Screenshots N/A

Singleplayer or Multiplayer? Singleplayer

Other Mods Installed None

Mod Version 1.0.4

Calemi commented 5 years ago

Huh, I found this bug with the network cables but I thought it was fixed. I'll look into this when I get more time. The next update is long overdue but it should be worth it.

pupnewfster commented 5 years ago

Not quite sure what this mod does so I am not making a PR to fix this as the issue appears to be a bit wider spread than I first thought, but the biggest part is that you (@Calemi ) are adding NBT tags to any random item (even ones not from your mod), just to then query if it has a specific tag. For example, the biggest offender I saw is here where you add an empty tag compound to any item that gets hovered over. Looking at the usages of ItemHelper#getNBT there appears to be some other places as well that you assign it seemingly arbitrarily. For example here you are assigning it to all items in the building unit (not just if it is the ItemBuildingUnitTemplate, which would be by moving that line into the if statement).

There are a good number of other places from the few I looked at where it doesn't really seem to make sense to me that it is being used, except I am unsure what assumptions parts of your code makes and didn't want to break things by going through and trying to fix them.

Calemi commented 5 years ago

Yeah, I managed to fix the issues. Just dumb code I left when updating. It was exactly what you pointed out. Thanks for going deeper to find the issue and some others, I appreciate that.

Darkfiend009 commented 5 years ago

I appreciate you both working on this. I was having this issue in my modpack and pupnewfster was kind enough to help identify where the conflict was. Thank you both!

Calemi commented 5 years ago

Just released v1.0.5 and this issue should be all fixed up! There are still some places that ItemHelper#getNBT still exists in situations where it shouldn't, but the main bug should be gone. Thanks again to the all of you for helping out! Please report another bug, or dm me if you have any further issues. For now, this one is closed.