Replace vanishedPlayers list with set (#1796)

* Replace vanishedPlayers list with set

Not sure if there is any particular reason to keep it ordered, but for now I've used a LinkedHashSet.

* Change return of new method from Set to Collection

Also makes return of old method an unmodifiable list, but this is just as breaking as just changing the method return type as far as I can see
This commit is contained in:
md678685 2018-03-25 22:12:36 +01:00 committed by GitHub
parent 9f6d0fa2d6
commit 61c1485083
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 18 additions and 7 deletions

View file

@ -715,7 +715,7 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
}
}
setHidden(true);
ess.getVanishedPlayers().add(getName());
ess.getVanishedPlayersNew().add(getName());
if (isAuthorized("essentials.vanish.effect")) {
this.getBase().addPotionEffect(new PotionEffect(PotionEffectType.INVISIBILITY, Integer.MAX_VALUE, 1, false));
}
@ -724,7 +724,7 @@ public class User extends UserData implements Comparable<User>, IMessageRecipien
p.showPlayer(getBase());
}
setHidden(false);
ess.getVanishedPlayers().remove(getName());
ess.getVanishedPlayersNew().remove(getName());
if (isAuthorized("essentials.vanish.effect")) {
this.getBase().removePotionEffect(PotionEffectType.INVISIBILITY);
}