Skip to content

Commit

Permalink
Fix issues with party chat
Browse files Browse the repository at this point in the history
Signed-off-by: applenick <applenick@users.noreply.github.com>
  • Loading branch information
applenick committed Dec 9, 2024
1 parent 9ef44d0 commit b0e6d1b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

import java.util.Collection;
import java.util.List;
import java.util.Objects;
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.TextComponent;
import net.kyori.adventure.text.format.NamedTextColor;
Expand Down Expand Up @@ -60,7 +61,10 @@ public Squad getTarget(MatchPlayer matchPlayer, CommandContext<CommandSender> co

@Override
public Collection<MatchPlayer> getViewers(Squad squad) {
return squad.getPlayers().stream().map(uuid -> matchManager.getPlayer(uuid)).toList();
return squad.getPlayers().stream()
.filter(Objects::nonNull)
.map(uuid -> matchManager.getPlayer(uuid))
.toList();
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.bukkit.command.CommandSender;
import tc.oc.pgm.api.PGM;
import tc.oc.pgm.api.player.MatchPlayer;
import tc.oc.pgm.lib.org.incendo.cloud.annotation.specifier.Greedy;
import tc.oc.pgm.lib.org.incendo.cloud.annotations.Argument;
import tc.oc.pgm.lib.org.incendo.cloud.annotations.Command;
import tc.oc.pgm.lib.org.incendo.cloud.annotations.CommandDescription;
Expand Down Expand Up @@ -204,7 +205,7 @@ public Component format(UUID player, int index) {
public void chat(
CommandContext<CommandSender> context,
MatchPlayer sender,
@Argument(value = "message", suggestions = "players") String message) {
@Argument(value = "message", suggestions = "players") @Greedy String message) {
checkEnabled();
if (message == null) {
PGM.get().getChatManager().setChannel(sender, SquadChannel.INSTANCE);
Expand Down

0 comments on commit b0e6d1b

Please sign in to comment.