Skip to content

Commit

Permalink
Adjust cooldown checks a bit more
Browse files Browse the repository at this point in the history
  • Loading branch information
BenCodez committed Sep 10, 2023
1 parent a010501 commit 1e9828f
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,12 +92,11 @@ public synchronized void checkPerSite(VotingPluginUser user) {
HashMap<String, Boolean> coolDownChecks = user.getCoolDownCheckSiteList();
boolean changed = false;
for (VoteSite site : plugin.getVoteSites()) {
if (user.canVoteSite(site)) {
if (!coolDownChecks.containsKey(site.getKey())
|| !coolDownChecks.get(site.getKey()).booleanValue()) {
if (!coolDownChecks.containsKey(site.getKey()) || !coolDownChecks.get(site.getKey()).booleanValue()) {
if (user.canVoteSite(site)) {
coolDownChecks.put(site.getKey(), Boolean.TRUE);
changed = true;
plugin.extraDebug("Trigger votesitecooldownend event for " + user.getUUID());
plugin.extraDebug("Triggering votesitecooldownend event for " + user.getUUID());
PlayerVoteSiteCoolDownEndEvent event = new PlayerVoteSiteCoolDownEndEvent(user, site);
plugin.getServer().getPluginManager().callEvent(event);
}
Expand Down Expand Up @@ -152,7 +151,7 @@ public void run() {
check(uuid);
}
}
}, time + 60, TimeUnit.SECONDS);
}, time, TimeUnit.SECONDS);
allSiteTasks.put(uuid, scheduledFuture);
}

Expand Down Expand Up @@ -220,7 +219,7 @@ public void scheduleGlobalCheckVoteSite(VoteSite site) {
public void run() {
checkAllVoteSite(site);
}
}, time + 65, TimeUnit.SECONDS);
}, time + 90, TimeUnit.SECONDS);
plugin.getLogger().info(
"Checking vote delay daily cooldown events/rewards in " + time + " seconds for " + site.getKey());

Expand Down

0 comments on commit 1e9828f

Please sign in to comment.