diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-10-10 22:45:52 +0100 |
---|---|---|
committer | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-10-10 22:45:52 +0100 |
commit | 7e005474b68460101971579d45e8b4ed9cdf9b9e (patch) | |
tree | 4c6037f269a772c9f672172fff40e5f2459f7cea /src | |
parent | 1195944c90d07efc0e4397dfc327baf8050c5fbc (diff) | |
download | craftbukkit-7e005474b68460101971579d45e8b4ed9cdf9b9e.tar craftbukkit-7e005474b68460101971579d45e8b4ed9cdf9b9e.tar.gz craftbukkit-7e005474b68460101971579d45e8b4ed9cdf9b9e.tar.lz craftbukkit-7e005474b68460101971579d45e8b4ed9cdf9b9e.tar.xz craftbukkit-7e005474b68460101971579d45e8b4ed9cdf9b9e.zip |
Added hashCode and equals to CraftWorld
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftWorld.java | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index beb87eb6..a8ce667a 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java @@ -870,4 +870,23 @@ public class CraftWorld implements World { } } } + + @Override + public int hashCode() { + return getUID().hashCode(); + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (getClass() != obj.getClass()) { + return false; + } + + final CraftWorld other = (CraftWorld) obj; + + return this.getUID() == other.getUID(); + } } |