Skip to content

[Bug]: NullableEnumMap.MapEntry does not implement equals() and hashCode() #21

@XFactHD

Description

@XFactHD

Bug Description

FramedBlocks extracts connected textures data of supported mods (Athena is supported natively in FramedBlocks, other mods implement support on their end) from the ModelData computed by the camo model. The extracted data, if available, is then used as part of a cache key. Due to NullableEnumMap.MapEntry (which represents the entries of the NullableEnumMap which is stored in the ModelData) not implementing equals() and hashCode(), the cache breaks down and uncontrollably accumulates sets of computed quads for the same underlying data, leading to a memory leak like reported here: XFactHD/FramedBlocks#630.

This was fixed in 1.20.4 a while ago but it was missed for backporting to 1.20.1.

How to Reproduce?

  1. Install FramedBlocks 9.4.1 together with Athena 3.1.2 on 1.20.1
  2. Place a few Framed Cubes and apply an Athena-enabled block as the camo (more blocks accelerate the memory leak)
  3. Trigger repeated chunk rebatching for the section containing the blocks, via F3+A or a redstone clock
  4. Observe the used memory slowly increasing

Expected Behavior

No response

Version

3.1.2

Mod Loader Version

1.20.1 - 47.3.7

Mod Loader

Forge

Logs or additional context

No response

Code of Conduct

  • I have searched the issue tracker and confirmed that the issue has not been reported
  • I have checked the FAQ (if one is present) and my issue is not listed
  • I have verified that I am using the latest version of the mod
  • I have verified that I have installed all the required dependencies for the mod
  • I have verified that I do not have Optifine installed. We will close issues if we detect Optifine is in your pack. We cannot fix Optifine issues. Please do not report issues with Optifine present.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions