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

This commit is contained in:
Meme Man authored and GitHub committed 2026-07-21 11:25:36 -07:00
1 parent 77785cb181
commit 22d0c94c82
1 file changed
+2 -2
@@ -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;
}