aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoranhgelus <anhgelus.morhtuuzh@proton.me>2024-08-25 14:43:47 +0000
committeranhgelus <anhgelus.morhtuuzh@proton.me>2024-08-25 14:43:47 +0000
commit2296148b0612ebad0b927bd7d27ad9c8f09b172b (patch)
tree59d2e6cca143d1a256b79f9420964e640489f4a3 /src
parent5c0617cd3de4e786b3643e67bf610d5349164243 (diff)
feat(game): spectator can get the list of moles
Diffstat (limited to 'src')
-rw-r--r--src/main/java/world/anhgelus/molehunt/Molehunt.java5
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;
}));