Skip to content

ExtraModelKey has no equals or hashCode #4806

@sylv256

Description

@sylv256

Description

ExtraModelKey has no equals or hashCode methods meaning HashMap differentiates only by == a.k.a. instance.

Reproduction

  1. Register an Extra Model.
  2. Get the model using a new ExtraModelKey with the same Identifier.
  3. Null jumpscare!

Additional Details

This is a serious issue when dealing with extra models, because it means you must store your ExtraModelKeys somewhere as a constant.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions