aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/world/anhgelus/molehunt/Molehunt.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/world/anhgelus/molehunt/Molehunt.java b/src/main/java/world/anhgelus/molehunt/Molehunt.java
index abce46b..c2b8b4f 100644
--- a/src/main/java/world/anhgelus/molehunt/Molehunt.java
+++ b/src/main/java/world/anhgelus/molehunt/Molehunt.java
@@ -145,14 +145,20 @@ public class Molehunt implements ModInitializer {
throw (new SimpleCommandExceptionType(Text.translatable("commands.molehunt.error.game_not_started"))).create();
}
- var source = context.getSource();
+ final var source = context.getSource();
+ final var player = source.getPlayer();
+ assert player != null;
- if (game.isAMole(source.getPlayer())) {
+ if (game.isAMole(player)) {
source.sendFeedback(
() -> Text.translatable("commands.molehunt.role.mole")
.append("\n\n")
.append(Text.translatable("commands.molehunt.role.mole.list", game.getMolesAsString())),
false);
+ } else if (player.isSpectator()) {
+ source.sendFeedback(
+ () -> Text.translatable("commands.molehunt.role.survivor.mole_count", game.getMoles().size()),
+ false);
} else {
source.sendFeedback(
() -> Text.translatable("commands.molehunt.role.survivor")