Update equality check for RegistryObject to include RegistryObject#key.

This commit is contained in:
Meme Man 2026-07-24 14:20:27 +03:00
parent 4fa61fa0c0
commit d37f9929fb

View file

@ -467,8 +467,8 @@ public final class RegistryObject<T> implements Supplier<T> {
@Override
public boolean equals(Object obj) {
if (this == obj) return true;
if (obj instanceof RegistryObject o) {
return Objects.equals(o.name, name);
if (obj instanceof RegistryObject<?> o) {
return o.key == key && Objects.equals(o.name, name);
}
return false;
}