Silent's Gems

Silent's Gems

9M Downloads

NBT data is changing

KidsDontPlay opened this issue ยท 5 comments

commented

Versions

Minecraft Version: 1.12.2
Silent's Gems Version: 2.5.3
Silent Lib Version: 2.2.9

when RenderItem.renderItemAndEffectIntoGUI() is called with a silent gem tool the NBT data changes.
https://hastebin.com/firowomuwa.go

commented

Is this happening every render tick, or just the first time? If it's just the first time or occasionally (like after applying an upgrade or something), then it looks like everything is working as intended.

Every time you login, or when there's a significant change made to a tool, it "recalculates stats". Part of that process is clearing the model cache ("Layer0", "Layer1", etc). Then the client builds the model cache for faster rendering times.

commented

it changes only the first time. but NBT data shouldn't change when calling a getter or render method that isn't intended for changing the object. caching would be better outside of stackTagCompound.

A user found that incompatibility. I use ItemHandlerHelper.canItemStacksStack() to compare stacks and that's why it can't find silent gem tools

commented

I had almost forgetten, but this is kind of related to an old issue, #80. Because the model cache is stored client-side only, it fails comparison checks with the stack on the server. I let this slide at the time because JEI loosened its sanity checks to resolve the issue. No reason not to fix it now, and it's related to another problem I wanted to address.

commented

ok.
for now I wrote a workaround.
that works for me but it destroys your caching

commented

Alright, got everything fixed on my end. The new caching system resulted in a roughly 5-10% FPS drop, but the bug is fixed. Both new tools and armor and those already stuck in storage can be removed without issue.