Move the timer to be async if we're using bukkit's timer.

This should improve the performance of the plugin even more, because it
won't do any database calls while inside the loop which is what was
usually the hang up time.

This is completely untested and possibly could throw tons of errors.
This commit is contained in:
graywolf336
2014-07-21 19:11:12 -05:00
parent e4f32559b6
commit b63773c7a9
6 changed files with 54 additions and 28 deletions

View File

@ -336,7 +336,7 @@ public class JailManager {
if(j != null) {
for(Prisoner p : j.getAllPrisoners().values()) {
getPlugin().getPrisonerManager().releasePrisoner(getPlugin().getServer().getPlayer(p.getUUID()), p);
getPlugin().getPrisonerManager().schedulePrisonerRelease(p);
}
return getPlugin().getJailIO().getLanguageString(LangString.PRISONERSCLEARED, j.getName());
@ -360,7 +360,7 @@ public class JailManager {
}else {
for(Jail j : getJails()) {
for(Prisoner p : j.getAllPrisoners().values()) {
getPlugin().getPrisonerManager().releasePrisoner(getPlugin().getServer().getPlayer(p.getUUID()), p);
getPlugin().getPrisonerManager().schedulePrisonerRelease(p);
}
}