mirror of
https://github.com/MinecraftForge/MinecraftForge
synced 2026-08-22 04:26:10 -04:00
Update equality check for RegistryObject to include RegistryObject#key. (#10863)
This commit is contained in:
parent
bc6408ee24
commit
631b756d5b
1 changed files with 2 additions and 2 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue