Update equality check for RegistryObject to include RegistryObject#key. (#10863)
Some checks failed
Publish / build (push) Has been cancelled
Push actions / labels (push) Has been cancelled

This commit is contained in:
Meme Man 2026-08-04 21:10:47 +03:00 committed by GitHub
parent bc6408ee24
commit 631b756d5b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

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