Skip to content

Commit

Permalink
Don't broadcast vote party reminders if vanished
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Aug 11, 2024
1 parent 7a500f9 commit cb4646f
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions VotingPlugin/src/com/bencodez/votingplugin/voteparty/VoteParty.java
Original file line number Diff line number Diff line change
Expand Up @@ -346,18 +346,20 @@ public void setVotedUsers(ArrayList<String> value) {
}

public void checkVoteReminder(VotingPluginUser user) {
int neededVotes = getNeededVotes();

for (String str : plugin.getSpecialRewardsConfig().getVotePartyVoteReminderAtVotes()) {
if (MessageAPI.isInt(str)) {
int num = Integer.parseInt(str);
if (neededVotes == num) {
String broadcastMessage = plugin.getSpecialRewardsConfig().getVotePartyVoteReminderBroadcast();
HashMap<String, String> placeholders = new HashMap<String, String>();
placeholders.put("player", user.getPlayerName());
placeholders.put("votesrequired", "" + neededVotes);
MiscUtils.getInstance()
.broadcast(PlaceholderUtils.replacePlaceHolder(broadcastMessage, placeholders));
if (!user.isVanished() || !plugin.getOptions().isTreatVanishAsOffline()) {
int neededVotes = getNeededVotes();

for (String str : plugin.getSpecialRewardsConfig().getVotePartyVoteReminderAtVotes()) {
if (MessageAPI.isInt(str)) {
int num = Integer.parseInt(str);
if (neededVotes == num) {
String broadcastMessage = plugin.getSpecialRewardsConfig().getVotePartyVoteReminderBroadcast();
HashMap<String, String> placeholders = new HashMap<String, String>();
placeholders.put("player", user.getPlayerName());
placeholders.put("votesrequired", "" + neededVotes);
MiscUtils.getInstance()
.broadcast(PlaceholderUtils.replacePlaceHolder(broadcastMessage, placeholders));
}
}
}
}
Expand Down

0 comments on commit cb4646f

Please sign in to comment.