You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Refined Storage 2, when the player requests a resource to be extracted from the Grid, it does so by sending the item & components from client to server.
It then relies on equals/hashCode on the data component map to extract the exact stack being requested.
However, the example stack being sent over the wire to be extracted yields another hashCode than the exact same stack in storage.
I have not investigated very deep - just comparing the #toString of the stacks (which is the same) with the hashCode result (which is different).
I fixed the implementation of hashCode for PartInstance, but it doesn't seem to have fixed the issue. All of my data components seem to have correct hashCode implementations, so I'm not sure what else to look for.
Versions
Actual Behavior
In Refined Storage 2, when the player requests a resource to be extracted from the Grid, it does so by sending the item & components from client to server.
It then relies on
equals
/hashCode
on the data component map to extract the exact stack being requested.However, the example stack being sent over the wire to be extracted yields another
hashCode
than the exact same stack in storage.I have not investigated very deep - just comparing the
#toString
of the stacks (which is the same) with thehashCode
result (which is different).(After a first check I see https://github.com/SilentChaos512/Silent-Gear/blob/1.21.x/src/main/java/net/silentchaos512/gear/gear/part/PartInstance.java#L277 - which relies on
hashCode
ofItemStack
- which is not implemented, that returns object identity which is unpredictable)This results in the item not being able to be extracted, since it couldn't be found, even if the data components are the same.
Note: This causes a problem in RS, but it's not RS specific, this will/can have problems in other mods relying on stack equality too.
Person having this issue: refinedmods/refinedstorage2#735
Expected Behavior
The stack being able to be extracted.
Steps to Reproduce the Problem
The text was updated successfully, but these errors were encountered: