Use pattern matching for instanceof (#1019)

This commit is contained in:
altrisi authored and GitHub committed 2021-07-21 22:24:24 -03:00
1 parent 97e7d660e4
commit 7ebc990ef6
8 files changed
+24 -48

No files matched your search

@@ -108,9 +108,8 @@ public class ExplosionLogHelper
@Override
public boolean equals(Object obj)
{
if (obj instanceof EntityChangedStatusWithCount)
if (obj instanceof EntityChangedStatusWithCount other)
{
EntityChangedStatusWithCount other = (EntityChangedStatusWithCount) obj;
return other.pos.equals(pos) && other.accel.equals(accel) && other.type.equals(type);
}
return super.equals(obj);