diff options
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java | 2 | ||||
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 5 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java index fd86834e..349d8d2a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -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; } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index 080a6875..3291608f 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -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; } |