summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNathan Adams <dinnerbone@dinnerbone.com>2011-10-10 22:45:52 +0100
committerNathan Adams <dinnerbone@dinnerbone.com>2011-10-10 22:45:52 +0100
commit7e005474b68460101971579d45e8b4ed9cdf9b9e (patch)
tree4c6037f269a772c9f672172fff40e5f2459f7cea /src
parent1195944c90d07efc0e4397dfc327baf8050c5fbc (diff)
downloadcraftbukkit-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.java19
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();
+ }
}