Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion src/main/java/xyz/nucleoid/plasmid/impl/command/GameCommand.java
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,21 @@ private static void joinAllPlayersToGame(CommandSourceStack source, GameSpace ga
private static void tryJoinGame(ServerPlayer player, GameSpace gameSpace, JoinIntent intent) {
var result = GamePlayerJoiner.tryJoin(player, gameSpace, intent);
if (result.isError()) {
player.sendSystemMessage(result.errorCopy().withStyle(ChatFormatting.RED));
JoinIntent newIntent;
if (intent.equals(JoinIntent.SPECTATE)) {
newIntent = JoinIntent.PLAY;
} else {
newIntent = JoinIntent.SPECTATE;
}
var result2 = GamePlayerJoiner.tryJoin(player, gameSpace, newIntent);
if (result2.isError()) {
player.sendSystemMessage(result2.errorCopy().withStyle(ChatFormatting.RED));
} else {
player.sendSystemMessage(Component.translatable("text.plasmid.join_result.switched_intent",
(newIntent.equals(JoinIntent.SPECTATE) ? "player" : "spectator"),
(newIntent.equals(JoinIntent.SPECTATE) ? "spectator" : "player")
));
}
}
}

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/data/plasmid/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
"text.plasmid.join_result.not_allowed": "You are not allowed to join this game!",
"text.plasmid.join_result.spectators_only": "You are not allowed to participate in this game!",
"text.plasmid.join_result.participants_only": "You are not allowed to spectate this game!",
"text.plasmid.join_result.switched_intent": "You were not able to join as a %s and joined as a %s",
"text.plasmid.map_workspace.workspace_not_found": "Map with id '%s' was not found!",
"text.plasmid.map.bounds.get": "The bounds for the workspace are %s to %s",
"text.plasmid.map.bounds.set": "Updated bounds for workspace",
Expand Down
Loading