Skip to content

Commit

Permalink
Send message to player to notify them when queued votes are processed
Browse files Browse the repository at this point in the history
  • Loading branch information
meowsome committed Jul 22, 2021
1 parent 21ac85c commit 7df42f8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ public void onPlayerJoin(PlayerJoinEvent event) {
PlayerVotes pv = SuperbVote.getPlugin().getVoteStorage().getVotes(event.getPlayer().getUniqueId());
List<Vote> votes = SuperbVote.getPlugin().getQueuedVotes().getAndRemoveVotes(event.getPlayer().getUniqueId());
if (!votes.isEmpty()) {
// Send message to player letting them know why they're receiving a bunch of random gifts
String queueMessage = ChatColor.translateAlternateColorCodes('&', SuperbVote.getPlugin().getConfig().getString("queue-message"));
event.getPlayer().sendMessage(queueMessage);

for (Vote vote : votes) {
processVote(pv, vote, false, false, true);
pv = new PlayerVotes(pv.getUuid(), event.getPlayer().getName(),pv.getVotes() + 1, PlayerVotes.Type.CURRENT);
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ rewards:

# Whether or not players need to be online to vote. If set, offline player votes are queued for when the player next logs in.
require-online: true
queue-message: "&aThanks for voting recently! You will now receive your prizes."

# Broadcast settings:
broadcast:
Expand Down

0 comments on commit 7df42f8

Please sign in to comment.