Skip to content

Commit

Permalink
singleplayer error message for /vote
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Dec 3, 2024
1 parent a7bffbd commit a017602
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ authors=ModFest
contributors=Prospector, Sisby folk, acikek
license=MIT
# Mod Version
baseVersion=0.5.3
baseVersion=0.5.4
# Branch Metadata
branch=1.21
tagBranch=1.21
Expand Down
4 changes: 4 additions & 0 deletions src/main/java/net/modfest/ballotbox/BallotBoxCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ private static int vote(ServerPlayerEntity player, Consumer<Text> feedback) {
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("Vote cannot be invoked by a non-player").formatted(Formatting.RED)));
return 0;
}
if (player.getServer().isSingleplayer()) {
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("Voting isn't available in singleplayer!").formatted(Formatting.RED)));
return 0;
}
if (!ServerPlayNetworking.canSend(player, OpenVoteScreen.ID)) {
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("Voting requires BallotBox on the client!").formatted(Formatting.RED)));
return 0;
Expand Down

0 comments on commit a017602

Please sign in to comment.