forked from LogBlock/LogBlock
Cleanup Actor.equals() and .hashCode() + some formatting
This commit is contained in:
@@ -19,21 +19,16 @@ public class Actor {
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
int hash = 5;
|
||||
hash = 79 * hash + (this.UUID != null ? this.UUID.hashCode() : 0);
|
||||
return hash;
|
||||
return this.UUID != null ? this.UUID.hashCode() : 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object obj) {
|
||||
if (obj == null) {
|
||||
return false;
|
||||
}
|
||||
if (getClass() != obj.getClass()) {
|
||||
if (obj == null || getClass() != obj.getClass()) {
|
||||
return false;
|
||||
}
|
||||
final Actor other = (Actor) obj;
|
||||
return ((this.UUID == null && other.UUID == null) || this.UUID.equals(other.UUID));
|
||||
return this.UUID == null ? other.UUID == null : this.UUID.equals(other.UUID);
|
||||
}
|
||||
|
||||
final String name;
|
||||
@@ -111,6 +106,7 @@ public class Actor {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate an Actor object from a String name, trying to guess if it's an online player
|
||||
* and if so, setting the UUID accordingly. This only checks against currently online
|
||||
|
Reference in New Issue
Block a user