Switch removeIf check

May help with https://github.com/BentoBoxWorld/BentoBox/issues/1550

I cannot understand why an CME is happening with removeIf. It should not
be possible.
This commit is contained in:
tastybento 2020-10-26 17:11:52 -07:00
parent ccb46dc72c
commit f7f36179d3

View File

@ -487,10 +487,9 @@ public class PlayersManager {
*/
public void removePlayer(Player player) {
// Clear any players with the same name
playerCache.values().removeIf(p -> p.getPlayerName().equalsIgnoreCase(player.getName()));
playerCache.values().removeIf(p -> player.getName().equalsIgnoreCase(p.getPlayerName()));
// Remove if the player's UUID is the same
playerCache.values().removeIf(p -> p.getUniqueId().equals(player.getUniqueId().toString()));
playerCache.values().removeIf(p -> player.getUniqueId().toString().equals(p.getUniqueId()));
}
}