Tiny tiny code cleanup

This commit is contained in:
libraryaddict 2014-01-21 06:35:42 +13:00
parent 38ee3dc983
commit ad109b0cda
2 changed files with 4 additions and 8 deletions

View File

@ -119,7 +119,7 @@ public class DisguiseAPI {
public static Disguise getDisguise(Entity disguised) {
if (disguised == null)
return null;
return DisguiseUtilities.getDisguise(disguised.getEntityId());
return DisguiseUtilities.getMainDisguise(disguised.getEntityId());
}
/**

View File

@ -161,20 +161,16 @@ public class DisguiseUtilities {
}
}
@Deprecated
public static TargetedDisguise getDisguise(int entityId) {
public static TargetedDisguise getMainDisguise(int entityId) {
TargetedDisguise toReturn = null;
if (getDisguises().containsKey(entityId)) {
for (TargetedDisguise disguise : getDisguises().get(entityId)) {
if (disguise.getDisguiseTarget() == TargetType.SHOW_TO_EVERYONE_BUT_THESE_PLAYERS
&& disguise.getObservers().isEmpty()) {
if (disguise.getDisguiseTarget() == TargetType.SHOW_TO_EVERYONE_BUT_THESE_PLAYERS) {
return disguise;
}
if (toReturn == null) {
toReturn = disguise;
}
}
}
return toReturn;
}