Skip to content

Commit

Permalink
fix vote count
Browse files Browse the repository at this point in the history
  • Loading branch information
sisby-folk committed Jul 15, 2024
1 parent 3dc4378 commit 34177ae
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ org.gradle.configureondemand=true
# Enable advanced multi-module optimizations (share tiny-remaper instance between projects)
fabric.loom.multiProjectOptimisation=true
# Mod Properties
baseVersion = 0.3.0
baseVersion = 0.3.1
defaultBranch = 1.21
branch = 1.21
4 changes: 2 additions & 2 deletions src/main/java/net/modfest/ballotbox/BallotBoxCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ private static int votes(ServerPlayerEntity player, String ignored, Consumer<Tex
votes.computeIfAbsent(BallotBoxPlatformClient.categories.get(category), k -> HashMultiset.create()).add(BallotBoxPlatformClient.options.get(option));
}
}));
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("%d players have submitted %d votes so far!".formatted(BallotBox.STATE.selections().size(), votes.size())).formatted(Formatting.AQUA)));
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("%d players have submitted %d votes so far!".formatted(BallotBox.STATE.selections().size(), votes.values().stream().mapToInt(Multiset::size).sum())).formatted(Formatting.AQUA)));
votes.forEach((category, options) -> {
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("--- Top %d for %s ---".formatted(BallotBox.CONFIG.awardLimit.value(), category.name())).formatted(Formatting.LIGHT_PURPLE)));
int i = 0;
Expand All @@ -74,7 +74,7 @@ private static int votes(ServerPlayerEntity player, String ignored, Consumer<Tex
}
});
feedback.accept(Text.literal("[BallotBox] ").formatted(Formatting.GREEN).append(Text.literal("--- End Votes ---").formatted(Formatting.AQUA)));
return votes.size();
return 0;
}

private static int vote(ServerPlayerEntity player, String ignored, Consumer<Text> feedback) {
Expand Down

0 comments on commit 34177ae

Please sign in to comment.