Update equality check for RegistryObject to include RegistryObject#key. (#10856)

This commit is contained in:
Meme Man 2026-07-21 21:16:17 +03:00 committed by GitHub
parent b7efb8287b
commit 71d814ffa6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -466,8 +466,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;
}