Integrated Terminals

Integrated Terminals

20M Downloads

Simple Magnets compartibility

uhloin opened this issue ยท 5 comments

commented

Issue type:

  • ๐Ÿ› Bug

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:

  • This mod: 1.23.15
  • Minecraft: 1.21.1
  • Mod loader version: NeoForge 21.1.68
commented

Thanks for reporting!

commented

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?

commented

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

I will report.

commented

... 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

commented

Ah yeah, that would definitely explain it :-)