JustAlittleWolf / EasyNavigator

Navigate coordinates efficiently by having a compass that shows you the way!
MIT License
0 stars 0 forks source link

Empty Tag Bug #7

Closed XxVelZxX closed 2 months ago

XxVelZxX commented 2 months ago

Hi! I was making a modpack for myself and my friends, but at one point I ran into a bug in the form of non-stacking items. I have a lot of mods, so I had to go through all of them, and although I didn't believe it until the last minute, this mod was the cause of this bug. Me and my friend even took bets on which mod would turn out to be the one, and I ended up losing to the discord bot... Now I've become a local meme. Thank you.

And yes, I'm pretty sure this mod is the cause of the bug, because it only happens when this mod is present. Or it's some weird conflict, but with what exactly - no idea.

Minecraft version: 1.20.1 Fabric version: 0.15.11 YACL version: 3.2.2 and later 3.5.0 Easy Navigator version: 1.2.1

The bug is that for some reason all (not sure) items get an empty NBT tag “tag: {}}”, which causes them to be considered different items compared to normal items, which prevents them from stacking with them.

I have Tom's Simple Storage mod installed, and when you split items within storage, they stop stacking. If you check the chest with them with “/data get block ~ ~ ~ Items”, you can see that half of them have an empty NBT tag “tag: {}}” when the other half don't.

There is also a second option, without the mod above: You need to go into creative and start taking blocks by pressing MMB. Normally, if you click on a block, you get that block, and all subsequent clicks just select it on your hotbar, but with your mod, each subsequent click will add a new copy of the block to the hotbar. Another interesting thing is that you can combine such items in your inventory, but not in chests and other containers.

I haven't checked if all this happens if you run the game with only your mod, so maybe it is a conflict. But the fact that it all happens when installing this mod is still a fact.

And that's pretty much it. I apologize if this message contains grammatical errors or strange word order. English is not my native language and I used DeepL for translation. ...and maybe a little bit of Google...

Great mod btw.

JustAlittleWolf commented 2 months ago

Thanks for the in-depth issue! This seems to be caused by https://github.com/JustAlittleWolf/EasyNavigator/blob/b5d6819f66c1cd7fd975735499a8309169e676d1/src/main/java/me/wolfii/easynavigator/mixin/DrawContextMixin.java#L18 where every time an item is rendered, it tries to read the NBT. Unfortunately the getOrCreateNbt method was used incorrectly here, resulting in an empty NBT tag created each time an item is rendered, for every item that the player sees (so in chests, in your inventory, and in your hotbar). I wasn't able to reproduce the issue with Tom's Simple Storage mod installed, I probably didn't follow your instructions correctly.

Bevore I push the new release could you check if this actually resolves the issue for you? It says 1.20.4, but should work fine with 1.20.1. EasyNavigator+1.20.4-1.2.1-779b62f.jar.zip (github doesn't allow .jar uploads, so you'll have to extract it)

Cheers!

XxVelZxX commented 2 months ago

Wow! I didn't expect you to be so quick. I checked the new version and yes, it fixes everything, both with taking blocks and Tom's Simple Storage mod. Thank you!

JustAlittleWolf commented 2 months ago

New version is now also available on modrinth and curseforge