diff --git a/VotingPlugin/src/com/bencodez/votingplugin/BungeeHandler.java b/VotingPlugin/src/com/bencodez/votingplugin/BungeeHandler.java index b019cbaf6..de7b32b6c 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/BungeeHandler.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/BungeeHandler.java @@ -32,7 +32,6 @@ import com.bencodez.votingplugin.bungee.BungeeMethod; import com.bencodez.votingplugin.bungee.BungeeVersion; import com.bencodez.votingplugin.objects.VoteSite; -import com.bencodez.votingplugin.topvoter.TopVoter; import com.bencodez.votingplugin.user.VotingPluginUser; import lombok.Getter; @@ -349,15 +348,6 @@ public void onRecieve(String subChannel, ArrayList args) { user.addPoints(plugin.getConfigFile().getPointsOnVote()); } - if (plugin.getConfigFile().isLimitMonthlyVotes()) { - int value = text.getMonthTotal(); - LocalDateTime cTime = plugin.getTimeChecker().getTime(); - int days = cTime.getDayOfMonth(); - if (value >= days * plugin.getVoteSites().size()) { - user.setTotal(TopVoter.Monthly, days * plugin.getVoteSites().size()); - } - } - plugin.getSpecialRewards().bungeeAllSitesCheck(user, numberOfVotes, num); if (Boolean.valueOf(args.get(5))) { @@ -452,15 +442,6 @@ public void onRecieve(String subChannel, ArrayList args) { user.addPoints(plugin.getConfigFile().getPointsOnVote()); } - if (plugin.getConfigFile().isLimitMonthlyVotes()) { - int value = text.getMonthTotal(); - LocalDateTime cTime = plugin.getTimeChecker().getTime(); - int days = cTime.getDayOfMonth(); - if (value >= days * plugin.getVoteSites().size()) { - user.setTotal(TopVoter.Monthly, days * plugin.getVoteSites().size()); - } - } - plugin.getSpecialRewards().bungeeAllSitesCheck(user, numberOfVotes, num); if (Boolean.valueOf(args.get(5))) { diff --git a/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java b/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java index 9faea8eb3..5671815f3 100644 --- a/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java +++ b/VotingPlugin/src/com/bencodez/votingplugin/listeners/PlayerVoteListener.java @@ -17,6 +17,7 @@ import com.bencodez.votingplugin.events.PlayerPostVoteEvent; import com.bencodez.votingplugin.events.PlayerVoteEvent; import com.bencodez.votingplugin.objects.VoteSite; +import com.bencodez.votingplugin.topvoter.TopVoter; import com.bencodez.votingplugin.user.VotingPluginUser; // TODO: Auto-generated Javadoc @@ -207,6 +208,20 @@ public void onplayerVote(PlayerVoteEvent event) { user.addPoints(); } user.checkDayVoteStreak(event.isForceBungee()); + + if (plugin.getConfigFile().isLimitMonthlyVotes()) { + int value = 0; + if (event.isBungee()) { + value = event.getBungeeTextTotals().getMonthTotal(); + } else { + value = user.getTotal(TopVoter.Monthly); + } + LocalDateTime cTime = plugin.getTimeChecker().getTime(); + int days = cTime.getDayOfMonth(); + if (value >= days * plugin.getVoteSites().size()) { + user.setTotal(TopVoter.Monthly, days * plugin.getVoteSites().size()); + } + } // other rewards plugin.getSpecialRewards().checkAllSites(user, event.isForceBungee());