diff options
author | Wesley Wolfe <weswolf@aol.com> | 2012-05-06 13:39:46 -0500 |
---|---|---|
committer | Wesley Wolfe <weswolf@aol.com> | 2012-05-24 23:01:33 -0500 |
commit | c43012ef1caed94c27038652b3a11f6b9bcce6fd (patch) | |
tree | aeb11640f139f845f6abd048a9ac518b390a5953 /src | |
parent | 92dce25d3cbb614a66d7a883221bb3a8359af78e (diff) | |
download | craftbukkit-c43012ef1caed94c27038652b3a11f6b9bcce6fd.tar craftbukkit-c43012ef1caed94c27038652b3a11f6b9bcce6fd.tar.gz craftbukkit-c43012ef1caed94c27038652b3a11f6b9bcce6fd.tar.lz craftbukkit-c43012ef1caed94c27038652b3a11f6b9bcce6fd.tar.xz craftbukkit-c43012ef1caed94c27038652b3a11f6b9bcce6fd.zip |
Fixed broken hashCode()
Diffstat (limited to 'src')
-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; } |