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