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

This commit is contained in:
Meme Man authored and GitHub committed 2026-08-04 19:10:26 +01:00
1 parent 4fa61fa0c0
commit 885eba73ba
1 file changed
+2 -2
@@ -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;
}