Allowed .equals() to be used on disguises and watcher
This commit is contained in:
parent
0898c3c387
commit
ad47108567
@ -38,6 +38,10 @@ public class FlagWatcher {
|
|||||||
this.disguise = disguise;
|
this.disguise = disguise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(FlagWatcher flagWatcher) {
|
||||||
|
return entityValues.equals(flagWatcher.entityValues);
|
||||||
|
}
|
||||||
|
|
||||||
public FlagWatcher clone() {
|
public FlagWatcher clone() {
|
||||||
FlagWatcher cloned = new FlagWatcher(disguise);
|
FlagWatcher cloned = new FlagWatcher(disguise);
|
||||||
cloned.entityValues = (HashMap<Integer, Object>) entityValues.clone();
|
cloned.entityValues = (HashMap<Integer, Object>) entityValues.clone();
|
||||||
|
@ -21,13 +21,17 @@ public class MobDisguise extends Disguise {
|
|||||||
return disguise;
|
return disguise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(MobDisguise mobDisguise) {
|
||||||
|
return isAdult == mobDisguise.isAdult && this.equals(mobDisguise);
|
||||||
|
}
|
||||||
|
|
||||||
public boolean isAdult() {
|
public boolean isAdult() {
|
||||||
if (getWatcher() != null) {
|
if (getWatcher() != null) {
|
||||||
if (getWatcher() instanceof AgeableWatcher)
|
if (getWatcher() instanceof AgeableWatcher)
|
||||||
return ((AgeableWatcher) getWatcher()).isAdult();
|
return ((AgeableWatcher) getWatcher()).isAdult();
|
||||||
else if (getWatcher() instanceof ZombieWatcher)
|
else if (getWatcher() instanceof ZombieWatcher)
|
||||||
return ((ZombieWatcher) getWatcher()).isAdult();
|
return ((ZombieWatcher) getWatcher()).isAdult();
|
||||||
return isAdult;
|
return false;
|
||||||
}
|
}
|
||||||
return isAdult;
|
return isAdult;
|
||||||
}
|
}
|
||||||
|
@ -19,6 +19,10 @@ public class PlayerDisguise extends Disguise {
|
|||||||
return disguise;
|
return disguise;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean equals(PlayerDisguise playerDisguise) {
|
||||||
|
return getName().equals(playerDisguise.getName()) && this.equals(playerDisguise);
|
||||||
|
}
|
||||||
|
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return playerName;
|
return playerName;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user