geforkt von SteamWar/BungeeCore
Fix Poll Commands
Signed-off-by: Chaoscaot <chaoscaot444@gmail.com>
Dieser Commit ist enthalten in:
Ursprung
3be85af4bb
Commit
d3d48d9514
@ -46,7 +46,7 @@ public class PollresultCommand extends BasicCommand {
|
|||||||
ProxiedPlayer player = (ProxiedPlayer) sender;
|
ProxiedPlayer player = (ProxiedPlayer) sender;
|
||||||
|
|
||||||
Map<String, Integer> voted = PollAnswer.getCurrentResults();
|
Map<String, Integer> voted = PollAnswer.getCurrentResults();
|
||||||
Message.send("POLLRESULT_HEADER", player, voted.values().stream().reduce(Integer::sum), PollSystem.getQuestion());
|
Message.send("POLLRESULT_HEADER", player, voted.values().stream().reduce(Integer::sum).orElse(0), PollSystem.getQuestion());
|
||||||
for (Map.Entry<String, Integer> e: voted.entrySet()) {
|
for (Map.Entry<String, Integer> e: voted.entrySet()) {
|
||||||
Message.send("POLLRESULT_LIST", sender, e.getKey(), e.getValue());
|
Message.send("POLLRESULT_LIST", sender, e.getKey(), e.getValue());
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ public class PollAnswer {
|
|||||||
return getResults.select(rs -> {
|
return getResults.select(rs -> {
|
||||||
Map<String, Integer> retMap = new HashMap<>();
|
Map<String, Integer> retMap = new HashMap<>();
|
||||||
while (rs.next())
|
while (rs.next())
|
||||||
retMap.put(PollSystem.getAnswer(rs.getInt("Answer")), rs.getInt("Times"));
|
retMap.put(PollSystem.getAnswer(rs.getInt("Answer")-1), rs.getInt("Times"));
|
||||||
return retMap;
|
return retMap;
|
||||||
}, PollSystem.getQuestion());
|
}, PollSystem.getQuestion());
|
||||||
}
|
}
|
||||||
|
In neuem Issue referenzieren
Einen Benutzer sperren