
"Inaccurate extraction" with Refined Storage 2
Closed this issue · 4 comments
Bug description
When trying to extract certain items (villager-related items) from Refined Storage 2, the extraction silently fails and Refined Storage shows the warning "inaccurate extraction". Items can be inserted into the storage system, but extracting them back does not work correctly.
This is caused by the way items with custom data components are handled. Refined Storage 2 explains this issue here:
https://refinedmods.com/refined-storage/troubleshooting/inaccurate-extraction.html
Minecraft version
1.21.1
Mod version
1.21.1-1.1.35
Mod loader and version
NeoForge 21.1.203
Steps to reproduce
- Place an item from Easy Villagers (e.g., a captured villager or trader) into Refined Storage 2.
- Try to extract the item back into the player inventory.
- Refined Storage shows "inaccurate extraction" and fails to extract the item.
Expected behavior
The item should be extracted correctly without errors, just like vanilla items.
Log files
https://gist.github.com/jerem2772/2bf1f6c648fa9cec7dd371230c10d2d3
Screenshots
No response
The villager data components are using equals and hash code:
Not 100% sure if keeping a weak reference cache inside it could cause the issue though:
It looks like the issue doesn’t come from the weak reference. The Villager item stores the entire villager NBT as its data component, and this NBT changes frequently (age, timers, offers, brain data, etc.), which makes equality unstable for Refined Storage 2.
Would it be possible to reduce the stored NBT to only the identity-relevant fields and remove volatile information, so the data component stays stable for RS2?
All information in there is needed to retain the information of the contained entity. It also does not update when in item form.