CyclopsMC / IntegratedTerminals

Terminals for managing and overviewing Integrated Dynamics networks
MIT License
5 stars 6 forks source link

Simple Magnets compartibility #137

Open uhloin opened 1 week ago

uhloin commented 1 week ago

Issue type:


Short description:

Cannot get back an Advanced Magnet (from mod Simple Magnets) from Storage Terminal

Steps to reproduce the problem:

  1. Use a Colossal Chest 5x5x5 (didn't checked, but probably vanilla chest will work too)
  2. Set an item interface
  3. Set a storage terminal
  4. Craft an Advanced Magnet
  5. Activate attraction mode (select in the hotbar and right click)
  6. Put to the terminal
  7. Try get back

Versions:

rubensworks commented 1 week ago

Thanks for reporting!

rubensworks commented 1 week ago

Sounds very similar to #130. Could you report this to the Simple Magnets, with a link to this issue (and #130), and a note saying that the Advanced Magnet may not implement the equals and hashCode methods correctly as required by the data components interface?

uhloin commented 1 week ago

Yes, similar, and there was 1 more such item from another mod, but I forgot it.

I will report.

SuperMartijn642 commented 1 week ago

... the Advanced Magnet may not implement the equals and hashCode 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

rubensworks commented 1 week ago

Ah yeah, that would definitely explain it :-)