Remove player from all glow teams when glow is turned off
This commit is contained in:
parent
57b5b8fe84
commit
ff9133ecfa
|
|
@ -42,7 +42,7 @@ import java.util.stream.Collectors;
|
|||
.forEach(team -> team.removePlayer(player));
|
||||
|
||||
if (args[1].equalsIgnoreCase("off")) {
|
||||
turnOffGlow(commandSender, player, otherPlayer);
|
||||
turnOffGlow(commandSender, player, otherPlayer, board);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -88,10 +88,15 @@ import java.util.stream.Collectors;
|
|||
}
|
||||
}
|
||||
|
||||
private void turnOffGlow(CommandSender commandSender, Player player, boolean otherPlayer) {
|
||||
private void turnOffGlow(CommandSender commandSender, Player player, boolean otherPlayer, Scoreboard board) {
|
||||
player.sendRichMessage(Messages.GLOW.GLOW_OFF);
|
||||
player.setGlowing(false);
|
||||
|
||||
board.getTeams().stream()
|
||||
.filter(team -> team.getName().startsWith("Glow-"))
|
||||
.filter(team -> team.hasPlayer(player))
|
||||
.forEach(team -> team.removePlayer(player));
|
||||
|
||||
if (otherPlayer) {
|
||||
commandSender.sendRichMessage(Messages.GLOW.GLOW_OFF_FOR_PLAYER, Placeholder.component("player", player.name()));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user