diff options
| author | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-25 14:43:47 +0000 |
|---|---|---|
| committer | anhgelus <anhgelus.morhtuuzh@proton.me> | 2024-08-25 14:43:47 +0000 |
| commit | 2296148b0612ebad0b927bd7d27ad9c8f09b172b (patch) | |
| tree | 59d2e6cca143d1a256b79f9420964e640489f4a3 /src/main | |
| parent | 5c0617cd3de4e786b3643e67bf610d5349164243 (diff) | |
feat(game): spectator can get the list of moles
Diffstat (limited to 'src/main')
| -rw-r--r-- | src/main/java/world/anhgelus/molehunt/Molehunt.java | 5 |
1 files changed, 4 insertions, 1 deletions
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; })); |
