From 2296148b0612ebad0b927bd7d27ad9c8f09b172b Mon Sep 17 00:00:00 2001 From: anhgelus Date: Sun, 25 Aug 2024 14:43:47 +0000 Subject: feat(game): spectator can get the list of moles --- src/main/java/world/anhgelus/molehunt/Molehunt.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java index 52399dc..d94e523 100644 --- a/src/main/java/world/anhgelus/molehunt/Molehunt.java +++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java @@ -134,7 +134,10 @@ public class Molehunt implements ModInitializer { return Command.SINGLE_SUCCESS; }) )); - command.then(literal("moles").requires(source -> game != null && game.isAMole(source.getPlayer())).executes(context -> { + command.then(literal("moles").requires(source -> + (game != null && game.isAMole(source.getPlayer())) || + (source.getPlayer() != null && source.getPlayer().isSpectator()) + ).executes(context -> { context.getSource().sendFeedback(() -> Text.translatable("commands.molehunt.moles.list").append(" " + game.getMolesAsString()),false); return Command.SINGLE_SUCCESS; })); -- cgit v1.2.3