mirror of
https://github.com/PaperMC/Paper.git
synced 2026-11-25 10:29:41 -05:00
Fixed broken hashCode()
This commit is contained in:
1 parent
92dce25d3c
commit
c43012ef1c
2 files changed
+2
-5
No files matched your search
@@ -125,7 +125,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 97 * hash + (this.getName() != null ? this.getName().hashCode() : 0);
|
||||
hash = 97 * hash + (this.getName() != null ? this.getName().toLowerCase().hashCode() : 0);
|
||||
return hash;
|
||||
}
|
||||
|
||||
|
||||
@@ -189,9 +189,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (!(obj instanceof OfflinePlayer)) {
|
||||
return false;
|
||||
}
|
||||
@@ -655,7 +652,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
||||
@Override
|
||||
public int hashCode() {
|
||||
if (hash == 0 || hash == 485) {
|
||||
hash = 97 * 5 + (this.getName() != null ? this.getName().hashCode() : 0);
|
||||
hash = 97 * 5 + (this.getName() != null ? this.getName().toLowerCase().hashCode() : 0);
|
||||
}
|
||||
return hash;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user