Simple Magnets compartibility
uhloin opened this issue ยท 5 comments
Issue type:
- ๐ Bug
Short description:
Cannot get back an Advanced Magnet (from mod Simple Magnets) from Storage Terminal
Steps to reproduce the problem:
- Use a Colossal Chest 5x5x5 (didn't checked, but probably vanilla chest will work too)
- Set an item interface
- Set a storage terminal
- Craft an Advanced Magnet
- Activate attraction mode (select in the hotbar and right click)
- Put to the terminal
- Try get back
Versions:
- This mod: 1.23.15
- Minecraft: 1.21.1
- Mod loader version: NeoForge 21.1.68
Yes, similar, and there was 1 more such item from another mod, but I forgot it.
I will report.
... the Advanced Magnet may not implement the
equals
andhashCode
methods correctly ...
Yup, I used an ItemStack[]
argument in the record used for the datacomponent of the advanced magnet which I think is messing things up as it likely compares the arrays by identity rather than by contents.
https://github.com/SuperMartijn642/SimpleMagnets/blob/3545be2fec95d1be7d3c6dc91cb54071de27bbfb/src/main/java/com/supermartijn642/simplemagnets/AdvancedMagnet.java#L128-L129