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) { public static Disguise getDisguise(Entity disguised) {
if (disguised == null) if (disguised == null)
return null; return null;
return DisguiseUtilities.getDisguise(disguised.getEntityId()); return DisguiseUtilities.getMainDisguise(disguised.getEntityId());
} }
/** /**

View File

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