Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-12-18 20:40:08 +01:00
Fixed broken hashCode()
Dieser Commit ist enthalten in:
Ursprung
92dce25d3c
Commit
c43012ef1c
@ -125,7 +125,7 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
int hash = 5;
|
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;
|
return hash;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -189,9 +189,6 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean equals(Object obj) {
|
public boolean equals(Object obj) {
|
||||||
if (obj == null) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
if (!(obj instanceof OfflinePlayer)) {
|
if (!(obj instanceof OfflinePlayer)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -655,7 +652,7 @@ public class CraftPlayer extends CraftHumanEntity implements Player {
|
|||||||
@Override
|
@Override
|
||||||
public int hashCode() {
|
public int hashCode() {
|
||||||
if (hash == 0 || hash == 485) {
|
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;
|
return hash;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren