Added hashCode and equals to CraftWorld
By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
parent
bac90b1d90
commit
9ad2b97138
1 changed files with 19 additions and 0 deletions
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue