From 7e005474b68460101971579d45e8b4ed9cdf9b9e Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Mon, 10 Oct 2011 22:45:52 +0100 Subject: [PATCH] Added hashCode and equals to CraftWorld --- .../org/bukkit/craftbukkit/CraftWorld.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/org/bukkit/craftbukkit/CraftWorld.java b/src/main/java/org/bukkit/craftbukkit/CraftWorld.java index beb87eb619..a8ce667a5d 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(); + } }